PageRenderTime 64ms CodeModel.GetById 3ms app.highlight 48ms RepoModel.GetById 1ms app.codeStats 1ms

/App_Code/CSCode/StyleHelper.cs

https://github.com/eiursuajr/minGit
C# | 1833 lines | 1627 code | 135 blank | 71 comment | 250 complexity | 935a01e2c6925639235b02caf7038357 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1using System.Web.UI.WebControls;
   2using System.Configuration;
   3using System.Collections;
   4using System.Linq;
   5using System.Data;
   6using System.Web.Caching;
   7using System.Xml.Linq;
   8using System.Web.UI;
   9using System.Diagnostics;
  10using System.Web.Security;
  11using System;
  12using System.Text;
  13using Microsoft.VisualBasic;
  14using System.Web.UI.HtmlControls;
  15using System.Web.SessionState;
  16using System.Text.RegularExpressions;
  17using System.Web.Profile;
  18using System.Collections.Generic;
  19using System.Web.UI.WebControls.WebParts;
  20using System.Collections.Specialized;
  21using System.Web;
  22using Ektron.Cms;
  23using Ektron.Cms.Common;
  24using Ektron.Cms.Localization;
  25using Ektron.Cms.Framework.UI;
  26using Microsoft.Security.Application;
  27
  28public class StyleHelper
  29{
  30	public const string ActionBarDivider = "<td><div class=\"actionbarDivider\">&nbsp;</div></td>";
  31
  32	public static HtmlTableCell ActionBarDividerCell
  33	{
  34		get
  35		{
  36			var cell = new HtmlTableCell();
  37			cell.InnerHtml = ActionBarDivider;
  38			
  39			return cell;
  40		}
  41	}
  42
  43	public const string PrimaryFunctionCssClass = "primary";
  44	public const string SecondaryFunctionCssClass = "secondary";
  45
  46	public const string AddAssetButtonCssClass = "addAssetButton";
  47	public const string AddButtonCssClass = "addButton";
  48	public const string AddBookButtonCssClass = "addBookButton";
  49	public const string AddBrowseButtonCssClass = "addBrowseButton";
  50	public const string AddCommentButtonCssClass = "addCommentButton";
  51	public const string AddContentButtonCssClass = "addContentButton";
  52	public const string AddEmailButtonCssClass = "addEmailButton";
  53	public const string AddTaskButtonCssClass = "addTaskButton";
  54	public const string AddTranslationButtonCssClass = "addTranslationButton";
  55	public const string AddUserGroupButtonCssClass = "addUserGroupButton";
  56	public const string ApprovalsButtonCssClass = "approvalsButton";
  57	public const string ApproveButtonCssClass = "approveButton";
  58	public const string AssignFoldersButtonCssClass = "assignFoldersButton";
  59	public const string AssignItemsButtonCssClass = "assignItemsButton";
  60
  61	public const string BackButtonCssClass = "backButton";
  62	public const string BrowseButtonCssClass = "browseButton";
  63
  64	public const string CancelButtonCssClass = "cancelButton";
  65	public const string CautionButtonCssClass = "cautionButton";
  66	public const string CheckInButtonCssClass = "checkInButton";
  67	public const string CompareAnalyticsButtonCssClass = "compareAnalyticsButton";
  68	public const string CopyButtonCssClass = "copyButton";
  69	public const string ContextualHelpButtonCssClass = "contextualHelpButton";
  70	public const string CrawlFullButtonCssClass = "crawlFullButton";
  71	public const string CrawlIncrementalButtonCssClass = "crawlIncrementalButton";
  72
  73	public const string DeclineButtonCssClass = "declineButton";
  74	public const string DeleteButtonCssClass = "deleteButton";
  75	public const string DeleteDriveButtonCssClass = "deleteDriveButton";
  76	public const string DeleteEmailButtonCssClass = "deleteEmailButton";
  77	public const string DeleteHistoryButtonCssClass = "deleteHistoryButton";
  78	public const string DownButtonCssClass = "downButton";
  79
  80	public const string EditButtonCssClass = "editButton";
  81	public const string EditContentFormButtonCssClass = "editContentFormButton";
  82	public const string EditFallbackButtonCssClass = "editFallbackButton";
  83	public const string EditPropertiesButtonCssClass = "editPropertiesButton";
  84	public const string EditSmartformButtonCssClass = "editSmartformButton";
  85	public const string EmailButtonCssClass = "emailButton";
  86	public const string EnableButtonCssClass = "enableButton";
  87	public const string ExportButtonCssClass = "exportButton";
  88	public const string ExportTaxonomyButtonCssClass = "exportTaxonomyButton";
  89	public const string ExportTranslationButtonCssClass = "exportTranslationButton";
  90
  91	public const string FilterReportButtonCssClass = "filterReportButton";
  92	public const string ForwardEmailButtonCssClass = "forwardEmailButton";
  93
  94	public const string HistoryButtonCssClass = "historyButton";
  95
  96	public const string ImportTaxonomyButtonCssClass = "importTaxonomyButton";
  97	public const string InsertButtonCssClass = "insertButton";
  98	public const string InsertBookButtonCssClass = "insertBookButton";
  99	public const string InviteButtonCssClass = "inviteButton";
 100
 101	public const string LastStatusButtonCssClass = "lastStatusButton";
 102	public const string LocaleDoNotTranslateButtonCssClass = "localeDoNotTranslateButton";
 103	public const string LocaleNeedsTranslationButtonCssClass = "localeNeedsTranslationButton";
 104	public const string LocaleNotReadyButtonCssClass = "localeNotReadyButton";
 105	public const string LocaleOutForTranslationButtonCssClass = "localeOutForTranslationButton";
 106	public const string LocaleReadyButtonCssClass = "localeReadyButton";
 107	public const string LocaleTranslatedButtonCssClass = "localeTranslatedButton";
 108	public const string LogHistoryButtonCssClass = "logHistoryButton";
 109
 110	public const string NextButtonCssClass = "nextButton";
 111	public const string NextDisabledButtonCssClass = "nextDisabledButton";
 112
 113	public const string MoveButtonCssClass = "moveButton";
 114	public const string MoveContentButtonCssClass = "moveContentButton";
 115
 116	public const string OpenFolderButtonCssClass = "openFolderButton";
 117	public const string OverwriteButtonCssClass = "overwriteButton";
 118
 119	public const string PreApprovalButtonCssClass = "preApprovalButton";
 120	public const string PreviewButtonCssClass = "previewButton";
 121	public const string PreviousButtonCssClass = "previousButton";
 122	public const string PreviousDisabledButtonCssClass = "previousDisabledButton";
 123	public const string PreviewStatusButtonCssClass = "previewStatusButton";
 124    public const string PreviewStatusButtonCssNewClass = "previewStatusNewButton";
 125	public const string PrintButtonCssClass = "printButton";
 126	public const string PublishButtonCssClass = "publishButton";
 127
 128	public const string RefreshButtonCssClass = "refreshButton";
 129	public const string RemoveButtonCssClass = "removeButton";
 130	public const string ReOrderButtonCssClass = "reOrderButton";
 131	public const string ReplyToEmailButtonCssClass = "replyToEmailButton";
 132	public const string ResolveConflictButtonCssClass = "resolveConflictButton";
 133	public const string RestoreButtonCssClass = "restoreButton";
 134	public const string ReviewConflictButtonCssClass = "reviewConflictButton";
 135
 136	public const string SaveButtonCssClass = "saveButton";
 137	public const string SearchButtonCssClass = "searchButton";
 138	public const string SentEmailsButtonCssClass = "sentEmailsButton";
 139	public const string SubmitForApprovalButtonCssClass = "submitForApprovalButton";
 140	public const string SyncButtonCssClass = "syncButton";
 141
 142	public const string TranslationButtonCssClass = "translationButton";
 143
 144    public const string UndoCheckout = "undoCheckout";
 145	public const string UpButtonCssClass = "upButton";
 146	public const string UpdateQuicklinkButtonCssClass = "updateQuicklinkButton";
 147
 148	public const string ViewAnalyticsButtonCssClass = "viewAnalyticsButton";
 149	public const string ViewApprovalsButtonCssClass = "viewApprovalsButton";
 150	public const string ViewBookButtonCssClass = "viewBookButton";
 151	public const string ViewDifferenceButtonCssClass = "viewDifferenceButton";
 152	public const string ViewGroupMembersButtonCssClass = "viewGroupMembersButton";
 153	public const string ViewPermissionsButtonCssClass = "viewPermissionsButton";
 154	public const string ViewPropertiesButtonCssClass = "viewPropertiesButton";
 155	public const string ViewPublishedButtonCssClass = "viewPublishedButton";
 156	public const string ViewReportButtonCssClass = "viewReportButton";
 157	public const string ViewStagedButtonCssClass = "viewStagedButton";
 158	public const string ViewTaskButtonCssClass = "viewTaskButton";
 159	public const string ViewXslButtonCssClass = "viewXslButton";
 160
 161	public static string MergeCssClasses(string[] classNames)
 162	{
 163		var classString = "";
 164
 165		if (classNames != null && classNames.Length > 0)
 166		{
 167			var len = classNames.Length;
 168			int i;
 169
 170			classString = classNames[0];
 171
 172			for (i = 1; i < len; i++ )
 173			{
 174				classString += " " + classNames[i];
 175			}
 176		}
 177
 178		return classString;
 179	}
 180
 181    private System.String myTemp = "";
 182    private System.Int32 MyButtonName = 100;
 183    private System.Boolean DisplayTransText = false;
 184    private EkMessageHelper m_refMsg = null;
 185    private CommonApi m_refAPI = null;
 186    private int ContentLanguage = -1;
 187
 188    public StyleHelper()
 189    {
 190        m_refAPI = new CommonApi();
 191        string strLangID;
 192        strLangID = System.Web.HttpContext.Current.Request.QueryString["LangType"];
 193        if (strLangID != null && Information.IsNumeric(strLangID))
 194        {
 195            try
 196            {
 197                ContentLanguage = Convert.ToInt32(strLangID);
 198            }
 199            catch (Exception ex)
 200            {
 201                EkException.LogException(ex, System.Diagnostics.EventLogEntryType.Warning);
 202                EkException.WriteToEventLog((string)("Language string was: " + strLangID), System.Diagnostics.EventLogEntryType.Warning);
 203            }
 204            m_refAPI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
 205        }
 206        else
 207        {
 208            strLangID = m_refAPI.GetCookieValue("LastValidLanguageID");
 209            if (strLangID != null && Information.IsNumeric(strLangID))
 210            {
 211                ContentLanguage = Convert.ToInt32(strLangID);
 212            }
 213        }
 214        if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
 215        {
 216            m_refAPI.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
 217        }
 218        else
 219        {
 220            m_refAPI.ContentLanguage = ContentLanguage;
 221        }
 222        DisplayTransText = m_refAPI.DisplayTransText;
 223        m_refMsg = m_refAPI.EkMsgRef;
 224    }
 225    public System.Web.UI.WebControls.BoundField CreateBoundField(string DataField, string HeaderText, string CssClass, System.Web.UI.WebControls.HorizontalAlign HeaderHorizontalAlign, System.Web.UI.WebControls.HorizontalAlign ItemHorizontalAlign, System.Web.UI.WebControls.Unit HeaderWidth, System.Web.UI.WebControls.Unit ItemWidth, bool HtmlEncode, bool ItemWrap)
 226    {
 227        System.Web.UI.WebControls.BoundField colBound = new System.Web.UI.WebControls.BoundField();
 228        colBound.DataField = DataField;
 229        colBound.HeaderText = HeaderText;
 230        colBound.HeaderStyle.CssClass = CssClass;
 231        colBound.HeaderStyle.Width = HeaderWidth;
 232        colBound.ItemStyle.Width = ItemWidth;
 233        colBound.ItemStyle.HorizontalAlign = ItemHorizontalAlign;
 234        colBound.HeaderStyle.HorizontalAlign = HeaderHorizontalAlign;
 235        colBound.HtmlEncode = HtmlEncode;
 236        colBound.ItemStyle.Wrap = ItemWrap;
 237        return colBound;
 238    }
 239    public System.String HyperlinkWCaption(System.String HrefPath, System.String DisplayText, System.String HeaderText, System.String specialEvents)
 240    {
 241        StringBuilder result = null;
 242        try
 243        {
 244            result = new StringBuilder();
 245            result.Append("<a href=\"" + HrefPath + "\" onMouseOver=\"");
 246
 247            if (DisplayTransText)
 248            {
 249                if (HeaderText != "")
 250                {
 251                    //result.Append("ShowTransString(\'" + HeaderText.Replace("\'", "\\\'") + "\');");
 252                }
 253            }
 254            result.Append("\" onMouseOut=\"");
 255            if (DisplayTransText)
 256            {
 257                if (HeaderText != "")
 258                {
 259                    //result.Append("HideTransString();");
 260                }
 261            }
 262            result.Append("\">" + DisplayText + "</a>");
 263
 264            MyButtonName++;
 265        }
 266        catch (Exception)
 267        {
 268            result.Length = 0;
 269        }
 270        finally
 271        {
 272        }
 273        return (result.ToString());
 274    }
 275    public System.String GetButtonEvents(System.String ImageFile, System.String hrefPath, System.String altText, System.String specialEvents)
 276    {
 277        StringBuilder result = null;
 278        try
 279        {
 280            result = new StringBuilder();
 281            result.Append("<td ");
 282            result.Append("id=\"image_cell_" + MyButtonName + "\" ");
 283            result.Append("class=\"button\" title=\"" + altText + "\">");
 284            result.Append("<a id=\"image_link_" + MyButtonName + "\" href=\"" + hrefPath + "\" " + specialEvents + " ");
 285            result.Append("onMouseOver=\"RollOver(this);\" onMouseOut=\"RollOut(this);\" style=\"cursor: default;\">");
 286            result.Append("<img onClick=\"" + "SelectButton(this);" + "\" src=\"" + ImageFile + "\" id=\"image_" + MyButtonName + "\" class=\"button\">");
 287            result.Append("</a></td>");
 288            MyButtonName++;
 289        }
 290        catch (Exception)
 291        {
 292            result.Length = 0;
 293        }
 294        return (result.ToString());
 295    }
 296
 297    public System.String GetButtonEventsWCaption(System.String imageFile, System.String hrefPath, System.String altText, System.String HeaderText, System.String specialEvents)
 298    {
 299        return GetButtonEventsWCaption(imageFile, hrefPath, altText, HeaderText, specialEvents, null, false);
 300    }
 301
 302	public System.String GetButtonEventsWCaption(System.String imageFile, System.String hrefPath, System.String altText, System.String HeaderText, System.String specialEvents, System.String aTagClassName)
 303	{
 304		return GetButtonEventsWCaption(imageFile, hrefPath, altText, HeaderText, specialEvents, aTagClassName, false);
 305	}
 306
 307	public System.String GetButtonEventsWCaption(System.String imageFile, System.String hrefPath, System.String altText, System.String HeaderText, System.String specialEvents, System.String aTagClassName, bool isPrimary)
 308	{
 309		StringBuilder result = null;
 310
 311		try
 312		{
 313			result = new StringBuilder();
 314			result.Append("<td ");
 315			result.Append("id=\"image_cell_" + MyButtonName + "\" ");
 316
 317			if (isPrimary && aTagClassName != BackButtonCssClass && aTagClassName != CancelButtonCssClass)
 318			{
 319				result.Append("class=\"button\">");
 320			}
 321			else
 322			{
 323				result.Append("class=\"button\" title=\"" + HeaderText.Replace("\'", "\\\'") + "\">");
 324			}
 325
 326			result.Append("<a ");
 327
 328			string priorityCssClass = (isPrimary) ? PrimaryFunctionCssClass : SecondaryFunctionCssClass;
 329
 330			if (!String.IsNullOrEmpty(aTagClassName))
 331			{
 332				result.Append("class=\"" + MergeCssClasses(new string[2] { priorityCssClass, aTagClassName }) + "\" ");
 333			}
 334			else
 335			{
 336				result.Append("class=\"" + priorityCssClass + "\" ");
 337			}
 338
 339			result.Append("id=\"image_link_" + MyButtonName + "\" href=\"" + hrefPath + "\" " + specialEvents + " ");
 340			
 341			result.Append("onMouseOver=\"");
 342			if (DisplayTransText)
 343			{
 344				if (HeaderText != "")
 345				{
 346					//result.Append("ShowTransString(\'" + HeaderText.Replace("\'", "\\\'") + "\');");
 347				}
 348			}
 349			result.Append("RollOver(this);\" onMouseOut=\"");
 350			if (DisplayTransText)
 351			{
 352				if (HeaderText != "")
 353				{
 354					//result.Append("HideTransString();");
 355				}
 356			}
 357			result.Append("RollOut(this);\"");
 358			result.Append(" style=\"cursor: default;\">");
 359
 360			if (isPrimary)
 361			{
 362				if (aTagClassName == BackButtonCssClass || aTagClassName == CancelButtonCssClass)
 363				{
 364					// leave blank for icon.
 365				}
 366				else
 367				{
 368					result.Append(HeaderText);
 369				}
 370			}
 371			else
 372			{
 373				result.Append("<img onClick=\"" + "SelectButton(this);" + "\" src=\"" + imageFile + "\" id=\"image_" + MyButtonName + "\" class=\"button\">");
 374			}
 375			
 376			result.Append("</a></td>");
 377
 378			MyButtonName++;
 379		}
 380		catch (Exception)
 381		{
 382			result.Length = 0;
 383		}
 384		finally
 385		{
 386		}
 387		return (result.ToString());
 388	}
 389
 390    /// <summary>
 391    /// Converts an ASP.Net image button so it works in the CMS400 toolbar
 392    /// All your code is handled in the codebehind for the button click
 393    /// </summary>
 394    /// <param name="btn">button to update</param>
 395    /// <param name="altText">alt text for button for flyover help</param>
 396    /// <param name="HeaderText">text to put in toolbar header on mouseover of button</param>
 397    /// <remarks></remarks>
 398    public void MakeToolbarButton(ImageButton btn, string altText, string HeaderText)
 399    {
 400        btn.AlternateText = altText;
 401       // btn.Attributes.Add("onMouseOver", "ShowTransString(\'" + HeaderText + "\'); RollOver(this);");
 402       // btn.Attributes.Add("onMouseOut", "HideTransString(); RollOut(this);");
 403        btn.Attributes.Add("style", "cursor:default;");
 404        btn.Attributes.Add("style", "border-width:1px");
 405    }
 406
 407    public System.String GetTitleBar(System.String Title)
 408    {
 409        StringBuilder result = new StringBuilder();
 410        try
 411        {
 412            result.Append("<span id=\"WorkareaTitlebar\">" + Title + "</span>");
 413            result.Append("<span style=\"display:none\" id=\"_WorkareaTitlebar\"></span>");
 414        }
 415        catch (Exception)
 416        {
 417            result.Length = 0;
 418        }
 419        return (result.ToString());
 420    }
 421    public System.String GetShowAllActiveLanguage(System.Boolean showAllOpt, System.String bgColor, System.String OnChangeEvt, System.String SelLang)
 422    {
 423        return GetShowAllActiveLanguage(showAllOpt, bgColor, OnChangeEvt, SelLang, false);
 424    }
 425    public System.String GetShowAllActiveLanguage(System.Boolean showAllOpt, System.String bgColor, System.String OnChangeEvt, System.String SelLang, bool showOnlySiteEnabled)
 426    {
 427        return ("<td>" + ShowAllActiveLanguage(showAllOpt, bgColor, OnChangeEvt, SelLang, showOnlySiteEnabled) + "</td>");
 428    }
 429    public System.String ShowAllActiveLanguage(System.Boolean showAllOpt, System.String bgColor, System.String OnChangeEvt, System.String SelLang)
 430    {
 431        return ShowAllActiveLanguage(showAllOpt, bgColor, OnChangeEvt, SelLang, false);
 432    }
 433    public System.String ShowAllActiveLanguage(System.Boolean showAllOpt, System.String bgColor, System.String OnChangeEvt, System.String SelLang, bool showOnlySiteEnabled)
 434    {
 435        StringBuilder result = new StringBuilder();
 436        LanguageData[] language_data;
 437        SiteAPI m_refSiteApi = new SiteAPI();
 438        int LanguageId = m_refSiteApi.ContentLanguage;
 439        try
 440        {
 441            if (OnChangeEvt == "")
 442            {
 443                OnChangeEvt = "SelLanguage(this.value)";
 444            }
 445            if (SelLang.Trim() != "")
 446            {
 447                LanguageId = Convert.ToInt32(SelLang);
 448            }
 449            language_data = m_refSiteApi.GetAllActiveLanguages();
 450            result = new StringBuilder();
 451            if (m_refAPI.EnableMultilingual == 1)
 452            {
 453                result.Append("<select id=\"frm_langID\" name=\"frm_langID\" OnChange=\"" + OnChangeEvt + "\">" + "\r\n");
 454                if (showAllOpt)
 455                {
 456                    result.Append("<option value=\"" + Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES + "\"");
 457                    if (LanguageId == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
 458                    {
 459                        result.Append(" selected=\"selected\"");
 460                    }
 461                    result.Append(">");
 462                    result.Append("All");
 463                    result.Append("</option>");
 464                }
 465                if (!(language_data == null))
 466                {
 467                    for (int iLang = 0; iLang <= language_data.Length - 1; iLang++)
 468                    {
 469                        LanguageData with_1 = language_data[iLang];
 470                        if (with_1.Id != 0 && (with_1.SiteEnabled || showOnlySiteEnabled == false))
 471                        {
 472                            result.Append("<option value=\"" + with_1.Id + "\"");
 473                            if (LanguageId == with_1.Id)
 474                            {
 475                                result.Append(" selected=\"selected\"");
 476                            }
 477                            else
 478                            {
 479                            }
 480                            result.Append(">");
 481                            result.Append(with_1.LocalName);
 482                            result.Append("</option>");
 483                        }
 484                    }
 485                }
 486                result.Append("</select>");
 487            }
 488        }
 489        catch (Exception)
 490        {
 491            result.Length = 0;
 492        }
 493        return (result.ToString());
 494    }
 495    //Public Shared Function GetClientScript() As String
 496    public string GetClientScript()
 497    {
 498        StringBuilder result;
 499        try
 500        {
 501            CommonApi m_refAPI = new CommonApi();
 502            if ((!(System.Web.HttpContext.Current.Request.QueryString["LangType"] == null)) && (System.Web.HttpContext.Current.Request.QueryString["LangType"] != ""))
 503            {
 504                m_refAPI.ContentLanguage = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["LangType"]);
 505            }
 506
 507            System.Web.UI.Page page = HttpContext.Current.Handler as System.Web.UI.Page;
 508            Packages.Ektron.Workarea.Core.Register(page);
 509
 510            Ektron.Cms.API.JS.RegisterJS(page, m_refAPI.AppPath + "java/stylehelper.js", "EktronStyleHelperJS");
 511
 512            result = new StringBuilder();
 513            result.Append("<script type=\"text/javascript\">" + "\r\n");
 514            result.Append("<!--//--><![CDATA[//><!--" + "\r\n");
 515            result.Append(" " + "\r\n");
 516            result.Append("var g_relativeClassPath = \'" + m_refAPI.AppPath + "csslib/\';" + "\r\n");
 517            result.Append("g_relativeClassPath = g_relativeClassPath.toLowerCase();" + "\r\n");
 518            result.Append("UpdateWorkareaTitleToolbars();" + "\r\n");
 519            result.Append(" " + "\r\n");
 520            result.Append("function GetRelativeClassPath() {" + "\r\n");
 521            result.Append("    return(g_relativeClassPath);" + "\r\n");
 522            result.Append("}" + "\r\n");
 523            result.Append(" " + "\r\n");
 524            result.Append("function UpdateWorkareaTitleToolbars() {" + "\r\n");
 525            result.Append("    if (document.styleSheets.length > 0) {" + "\r\n");
 526            result.Append("        MakeClassPathRelative(\'*\', \'button\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 527            result.Append("        MakeClassPathRelative(\'*\', \'button-over\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 528            result.Append("        MakeClassPathRelative(\'*\', \'button-selected\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 529            result.Append("        MakeClassPathRelative(\'*\', \'button-selectedOver\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 530            result.Append("        MakeClassPathRelative(\'*\', \'ektronToolbar\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 531            result.Append("        MakeClassPathRelative(\'*\', \'ektronTitlebar\', \'backgroundImage\', \'" + m_refAPI.AppImgPath + "\', g_relativeClassPath)" + "\r\n");
 532            result.Append("    } else {" + "\r\n");
 533            result.Append("        setTimeout(\'UpdateWorkareaTitleToolbars()\', 500);" + "\r\n");
 534            result.Append("    }" + "\r\n");
 535            result.Append("}" + "\r\n");
 536
 537            /*result.Append("function ShowTransString(Text) {" + "\r\n");
 538            result.Append("var ObjId = \"WorkareaTitlebar\";" + "\r\n");
 539            result.Append("var ObjShow = document.getElementById(\'_\' + ObjId);" + "\r\n");
 540            result.Append("var ObjHide = document.getElementById(ObjId);" + "\r\n");
 541            result.Append("if ((typeof ObjShow != \"undefined\") && (ObjShow != null)) {" + "\r\n");
 542            result.Append("ObjShow.innerHTML = Text;" + "\r\n");
 543            result.Append("ObjShow.style.display = \"inline\";" + "\r\n");
 544            result.Append("if ((typeof ObjHide != \"undefined\") && (ObjHide != null)) {" + "\r\n");
 545            result.Append("ObjHide.style.display = \"none\";" + "\r\n");
 546            result.Append("}" + "\r\n");
 547            result.Append("}" + "\r\n");
 548
 549            result.Append("}");
 550            result.Append("function HideTransString() {" + "\r\n");
 551            result.Append("var ObjId = \"WorkareaTitlebar\";" + "\r\n");
 552            result.Append("var ObjShow = document.getElementById(ObjId);" + "\r\n");
 553            result.Append("var ObjHide = document.getElementById(\'_\' + ObjId);" + "\r\n");
 554
 555            result.Append("if ((typeof ObjShow != \"undefined\") && (ObjShow != null)) {" + "\r\n");
 556            result.Append("ObjShow.style.display = \"inline\";");
 557            result.Append("if ((typeof ObjHide != \"undefined\") && (ObjHide != null)) {" + "\r\n");
 558            result.Append("ObjHide.style.display = \"none\";" + "\r\n");
 559            result.Append("}" + "\r\n");
 560            result.Append("}" + "\r\n");
 561            result.Append("}" + "\r\n");*/
 562            result.Append("function GetCellObject(MyObj) {" + "\r\n");
 563            result.Append("var tmpName = \"\";" + "\r\n");
 564
 565            result.Append("tmpName = MyObj.id;" + "\r\n");
 566            result.Append("if (tmpName.indexOf(\"link_\") >= 0) {" + "\r\n");
 567            result.Append("tmpName = tmpName.replace(\"link_\", \"cell_\");" + "\r\n");
 568            result.Append("}");
 569            result.Append("else if (tmpName.indexOf(\"cell_\") >= 0) {" + "\r\n");
 570            result.Append("tmpName = tmpName;" + "\r\n");
 571            result.Append("}" + "\r\n");
 572            result.Append("else {" + "\r\n");
 573            result.Append("tmpName = tmpName.replace(\"image_\", \"image_cell_\");" + "\r\n");
 574            result.Append("}" + "\r\n");
 575            result.Append("MyObj = document.getElementById(tmpName);" + "\r\n");
 576            result.Append("return (MyObj);" + "\r\n");
 577            result.Append("}" + "\r\n");
 578
 579            result.Append("var g_OldBtnObject = null;" + "\r\n");
 580
 581            result.Append("function ClearPrevBtn() {" + "\r\n");
 582            result.Append("if (g_OldBtnObject){" + "\r\n");
 583            result.Append("  RollOut(g_OldBtnObject);" + "\r\n");
 584            result.Append("  g_OldBtnObject = null;" + "\r\n");
 585            result.Append("}" + "\r\n");
 586            result.Append("}" + "\r\n");
 587
 588            result.Append("function RollOver(MyObj) {" + "\r\n");
 589            result.Append("ClearPrevBtn();" + "\r\n");
 590            result.Append("g_OldBtnObject = MyObj;" + "\r\n");
 591            result.Append("MyObj = GetCellObject(MyObj);");
 592            result.Append("MyObj.className = \"button-over\";" + "\r\n");
 593            result.Append("}" + "\r\n");
 594
 595            result.Append("function RollOut(MyObj) {" + "\r\n");
 596            result.Append("if (g_OldBtnObject == MyObj){" + "\r\n");
 597            result.Append("g_OldBtnObject = null;" + "\r\n");
 598            result.Append("}" + "\r\n");
 599            result.Append("MyObj = GetCellObject(MyObj);" + "\r\n");
 600            result.Append("MyObj.className = \"button\";" + "\r\n");
 601            result.Append("}" + "\r\n");
 602
 603            result.Append("function SelectButton(MyObj) {" + "\r\n");
 604
 605            result.Append("}" + "\r\n");
 606
 607            result.Append("function UnSelectButtons() { " + "\r\n");
 608            result.Append("var iLoop = 100; " + "\r\n");
 609
 610            result.Append("while (document.getElementById(\"image_cell_\" + iLoop.toString()) != null) { " + "\r\n");
 611            result.Append("document.getElementById(\"image_cell_\" + iLoop.toString()).className = \"button\"; " + "\r\n");
 612            result.Append("iLoop++; " + "\r\n");
 613            result.Append("} " + "\r\n");
 614            result.Append("} " + "\r\n");
 615
 616            result.Append("function Trim (string) { " + "\r\n");
 617            result.Append("if (string.length > 0) { " + "\r\n");
 618            result.Append("string = RemoveLeadingSpaces (string); " + "\r\n");
 619            result.Append("} " + "\r\n");
 620            result.Append("if (string.length > 0) { " + "\r\n");
 621            result.Append("string = RemoveTrailingSpaces(string); " + "\r\n");
 622            result.Append("} " + "\r\n");
 623            result.Append("return string; " + "\r\n");
 624            result.Append("} " + "\r\n");
 625
 626            result.Append("function RemoveLeadingSpaces(string) {");
 627            result.Append("while(string.substring(0, 1) == \" \") { " + "\r\n");
 628            result.Append("string = string.substring(1, string.length); " + "\r\n");
 629            result.Append("} " + "\r\n");
 630            result.Append("return string; " + "\r\n");
 631            result.Append("} " + "\r\n");
 632
 633            result.Append("function RemoveTrailingSpaces(string) { " + "\r\n");
 634            result.Append("while(string.substring((string.length - 1), string.length) == \" \") { " + "\r\n");
 635            result.Append("string = string.substring(0, (string.length - 1)); " + "\r\n");
 636            result.Append("} " + "\r\n");
 637            result.Append("return string; " + "\r\n");
 638            result.Append("} " + "\r\n");
 639
 640            result.Append("function SelLanguage(inVal) { " + "\r\n");
 641            myTemp = (string)(System.Web.HttpContext.Current.Request.ServerVariables["PATH_INFO"].Substring(System.Convert.ToInt32(System.Web.HttpContext.Current.Request.ServerVariables["PATH_INFO"].LastIndexOf("/") + 1)));
 642            //myTemp = myTemp + "?" + Ektron.Cms.API.JS.Escape(Strings.Replace(System.Web.HttpContext.Current.Request.ServerVariables["QUERY_STRING"], "LangType", "", 1, -1, 0));
 643            myTemp = myTemp + "?" + Ektron.Cms.API.JS.Escape(EkFunctions.UrlEncode(System.Web.HttpContext.Current.Request.ServerVariables["QUERY_STRING"].ToString().Replace("LangType", "")));
 644            myTemp = myTemp.Replace("\'", "\"");
 645            myTemp = myTemp.Replace("\\x", "\\\\x");
 646            myTemp = myTemp.Replace("\\\\\\x", "\\\\x");
 647            myTemp = myTemp.Replace("\\u", "\\\\u");
 648            myTemp = myTemp.Replace("\\\\\\u", "\\\\u");
 649            myTemp = myTemp.Replace("&amp;", "&");
 650            myTemp = myTemp.Replace("SelectAll=1&", "");
 651
 652            result.Append("top.notifyLanguageSwitch(inVal, -1)" + "\r\n");
 653
 654            result.Append("document.location = decodeURIComponent(\'" + myTemp + "&LangType=\' + inVal) ; " + "\r\n");
 655            result.Append("} " + "\r\n");
 656            result.Append("//--><!]]>" + "\r\n");
 657            result.Append("</script> " + "\r\n");
 658        }
 659        catch (Exception)
 660        {
 661            result = new StringBuilder();
 662        }
 663        finally
 664        {
 665        }
 666        return (result.ToString());
 667    }
 668    public string GetAddAnchor(int Id)
 669    {
 670        string sResult = "";
 671        string sFormQuery = "";
 672        try
 673        {
 674            if (((!(System.Web.HttpContext.Current.Request.QueryString["ContType"] == null)) && (System.Web.HttpContext.Current.Request.QueryString["ContType"].ToString() == "2")) || ((!(Ektron.Cms.CommonApi.GetEcmCookie()["ContType"] == null)) && (Ektron.Cms.CommonApi.GetEcmCookie()["ContType"].ToString() == "2")))
 675            {
 676                sFormQuery = (string)("&folder_id=" + Id); //& "&callbackpage=content.aspx&parm1=action&value1=viewcontentbycategory&parm2=folder_id&value2=" & Id
 677            }
 678            sResult = (string)(GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/add.png", "#", m_refMsg.GetMessage("alt add content button text"), m_refMsg.GetMessage("btn add content"), "onclick=\"AddNewContent(\'LangType=" + ContentLanguage + "&type=add&createtask=1&id=" + Id + sFormQuery + "&" + GetBackParams() + "\');return false;\" "));
 679        }
 680        catch (Exception)
 681        {
 682            sResult = "";
 683        }
 684        return sResult;
 685    }
 686
 687    public string GetAddAnchorByContentType(long Id, int contType, bool AllowNonFormattedHTML)
 688    {
 689        string sResult = "";
 690        string sFormQuery = "";
 691        try
 692        {
 693            if (contType == 2)
 694            {
 695                sFormQuery = (string)("&folder_id=" + Id); //& "&callbackpage=content.aspx&parm1=action&value1=viewcontentbycategory&parm2=folder_id&value2=" & Id
 696            }
 697            sResult = (string)("AddNewContent(\'LangType=" + ContentLanguage + "&type=add&createtask=1&id=" + Id + "&folderid=" + Id + sFormQuery + "&" + GetBackParams());
 698            if (AllowNonFormattedHTML)
 699            {
 700                sResult += "&AllowHTML=1";
 701            }
 702            sResult += "\', " + contType + ");";
 703        }
 704        catch (Exception)
 705        {
 706            sResult = "";
 707        }
 708        return sResult;
 709    }
 710
 711    public string GetTypeOverrideAddAnchor(long Id, long xml_id, int contType)
 712    {
 713        string sResult = "AddNewContent(\'LangType=" + ContentLanguage + "&type=add&createtask=1&id=" + Id + "&xid=" + xml_id + "&" + GetBackParams() + "\'," + contType + "); ";
 714        return sResult;
 715    }
 716    public string GetAddOtherAnchor(object id)
 717    {
 718        string sResult = GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/add.png", "#", m_refMsg.GetMessage("alt add content button text"), m_refMsg.GetMessage("btn add content"), "OnClick=\"showMultiMenu(event)\" ");
 719        return sResult;
 720    }
 721    public string GetAddOtherMenuStyle()
 722    {
 723        string returnValue;
 724        string html = "" + "\r\n";
 725        html += "<STYLE>" + "\r\n";
 726        html += "	#xmladdMenu { " + "\r\n";
 727        html += "	position: absolute; " + "\r\n";
 728        html += "	visibility: hidden; " + "\r\n";
 729        html += "	width: 120px; " + "\r\n";
 730        html += "	background-color: lightgrey; " + "\r\n";
 731        html += "	layer-background-color: lightgrey; " + "\r\n";
 732        html += "	border: 2px outset white; " + "\r\n";
 733        html += "	} " + "\r\n";
 734        html += "	.A:Menu { " + "\r\n";
 735        html += "	color: black; " + "\r\n";
 736        html += "	text-decoration: none; " + "\r\n";
 737        html += "	cursor: default; " + "\r\n";
 738        html += "	width: 100% " + "\r\n";
 739        html += "	} " + "\r\n";
 740        html += "	.A:MenuOn { " + "\r\n";
 741        html += "	color: white; " + "\r\n";
 742        html += "	text-decoration: none; " + "\r\n";
 743        html += "	background-color: darkblue; " + "\r\n";
 744        html += "	cursor: default; " + "\r\n";
 745        html += "	width: 100% " + "\r\n";
 746        html += "	} " + "\r\n";
 747        html += "</STYLE> " + "\r\n";
 748        returnValue = html;
 749        return returnValue;
 750    }
 751    public string GetAddBlogPostAnchor(long Id)
 752    {
 753        string sResult = "";
 754        try
 755        {
 756            sResult = (string)(GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/add.png", "#", m_refMsg.GetMessage("alt add blogpost button text"), m_refMsg.GetMessage("btn add blogpost"), "OnClick=\"javascript:AddNewContent(\'LangType=" + ContentLanguage + "&type=add&createtask=1&id=" + Id + "&" + GetBackParams() + "\');return false;\" "));
 757        }
 758        catch (Exception)
 759        {
 760            sResult = "";
 761        }
 762        return sResult;
 763    }
 764    public string GetAddForumPostAnchor(long Id)
 765    {
 766        string sResult = "";
 767        try
 768        {
 769            sResult = (string)(GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/add.png", "#", m_refMsg.GetMessage("alt add forumpost button text"), m_refMsg.GetMessage("btn add forumpost"), "OnClick=\"javascript:AddNewContent(\'LangType=" + ContentLanguage + "&type=add&createtask=1&id=" + Id + "&" + GetBackParams() + "\');return false;\" "));
 770        }
 771        catch (Exception)
 772        {
 773            sResult = "";
 774        }
 775        return sResult;
 776    }
 777    public string GetAddMultiAnchor(long id, int ContType)
 778    {
 779        return (GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/add.png", "#", "Add Several Files", m_refMsg.GetMessage("btn add content"), "OnClick=\"javascript:AddNewContent(\'LangType=" + ContentLanguage + "&type=add&multi=" + ContType + "&createtask=1&id=" + id + "&" + GetBackParams() + "\',  " + Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes + ");return false;\" "));
 780    }
 781    private string GetBackParams()
 782    {
 783        StringBuilder backURL;
 784        object Value;
 785        backURL = new StringBuilder();
 786        backURL.Append("back_file=content.aspx");
 787        Value = System.Web.HttpContext.Current.Request.QueryString["action"];
 788        if (Strings.Len(Value) > 0)
 789        {
 790            backURL.Append("&back_action=" + Value);
 791        }
 792        Value = System.Web.HttpContext.Current.Request.QueryString["folder_id"];
 793        if (Strings.Len(Value) > 0)
 794        {
 795            backURL.Append("&back_folder_id=" + Value);
 796        }
 797        Value = System.Web.HttpContext.Current.Request.QueryString["id"];
 798        if (Strings.Len(Value) > 0)
 799        {
 800            backURL.Append("&back_id=" + Value);
 801        }
 802        Value = ContentLanguage;
 803        if (Strings.Len(Value) > 0)
 804        {
 805            backURL.Append("&back_LangType=" + ContentLanguage);
 806        }
 807        return (backURL.ToString());
 808    }
 809    public string StatusWithToolTip(string Status)
 810    {
 811        string ToolTip = "";
 812        StringBuilder result = null;
 813        try
 814        {
 815            result = new StringBuilder();
 816
 817            switch (Status.ToUpper())
 818            {
 819                case "A":
 820                    ToolTip = "The content has been through the workflow and published on the Web site.";
 821                    break;
 822                case "O":
 823                    ToolTip = "The content is currently being edited, and has not been checked in for publishing.";
 824                    break;
 825                case "I":
 826                    ToolTip = "The content has been checked in for other users to edit.";
 827                    break;
 828                case "S":
 829                    ToolTip = "The content block has been saved and submitted into the approval chain.";
 830                    break;
 831                case "M":
 832                    ToolTip = "This content has been requested to be deleted from Ektron CMS400.";
 833                    break;
 834                case "P":
 835                    ToolTip = "This content has been approved,but the Go Live date hasn’t occurred yet.";
 836                    break;
 837                case "T":
 838                    ToolTip = "This content has been submitted, but waiting for completion of associated tasks.";
 839                    break;
 840                case "D":
 841                    ToolTip = "This content has been mark for delete on the Go Live date.";
 842                    break;
 843            }
 844            result.Append("<a href=\"#Status\" onmouseover=\"ddrivetip(\'" + ToolTip + "\',\'ADC5EF\', 300);\" onmouseout=\"hideddrivetip();\" onclick=\"return false;\">" + Status + "</a>");
 845        }
 846        catch (Exception)
 847        {
 848        }
 849        finally
 850        {
 851        }
 852        return (result.ToString());
 853    }
 854    public string GetPermLayerTop()
 855    {
 856        string result = "";
 857        bool bNS6 = false;
 858        if ((Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["http_user_agent"]).ToUpper()).IndexOf("GECKO") + 1 > 0)
 859        {
 860            bNS6 = true;
 861        }
 862        else
 863        {
 864            bNS6 = false;
 865        }
 866        if (!(bNS6))
 867        {
 868            result = result + "<ILAYER name=\"permLayer\"><LAYER name=\"standard\" visibility=\"show\"><NOLAYER>";
 869        }
 870        result = result + "<div id=\"standard\" style=\"display: block;\">";
 871        if (!(bNS6))
 872        {
 873            result = result + "</NOLAYER>";
 874        }
 875        return (result);
 876    }
 877    public string GetPermLayerMid()
 878    {
 879        string result = "";
 880        bool bNS6 = false;
 881        if ((Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["http_user_agent"]).ToUpper()).IndexOf("GECKO") + 1 > 0)
 882        {
 883            bNS6 = true;
 884        }
 885        else
 886        {
 887            bNS6 = false;
 888        }
 889        if (!(bNS6))
 890        {
 891            result = result + "</LAYER><LAYER name=\"advanced\" visibility=\"hidden\"><NOLAYER>";
 892        }
 893        result = result + "</div><div id=\"advanced\" style=\"display: none;\">";
 894        if (!(bNS6))
 895        {
 896            result = result + "</NOLAYER>";
 897        }
 898        return (result);
 899    }
 900    public string GetPermLayerBottom()
 901    {
 902        bool bNS6 = false;
 903        string result = "";
 904        if ((Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["http_user_agent"]).ToUpper()).IndexOf("GECKO") + 1 > 0)
 905        {
 906            bNS6 = true;
 907        }
 908        else
 909        {
 910            bNS6 = false;
 911        }
 912        if (!(bNS6))
 913        {
 914            result = result + "</LAYER></ILAYER><NOLAYER>";
 915        }
 916        result = result + "</div>";
 917        if (!(bNS6))
 918        {
 919            result = result + "</NOLAYER>";
 920        }
 921        return (result);
 922    }
 923    public int PermissionFlag(bool PermFlag)
 924    {
 925        int result = 0;
 926        if (PermFlag)
 927        {
 928            result = 1;
 929        }
 930        return (result);
 931    }
 932    public string GetEnableAllPrompt()
 933    {
 934
 935        string enableAll;
 936        enableAll = "<div id=\"enablealldiv\" class=\"clearfix\">";
 937        enableAll += "<a href=\"#EnableAll\" class=\"button greenHover buttonLeft buttonCheckAll\" onclick=\"return SelectAllPerms();\" title=\"" + m_refMsg.GetMessage("enable all permissions") + "\">" + m_refMsg.GetMessage("generic Enable All") + "</a>";
 938        enableAll += "<a href=\"#DisableAll\" class=\"button redHover buttonLeft buttonClear\" onclick=\"return UnselectAllPerms();\" title=\"" + m_refMsg.GetMessage("generic Disable All") + "\">" + m_refMsg.GetMessage("generic Disable All") + "</a>";
 939        enableAll += "</div>";
 940
 941        return enableAll;
 942    }
 943    public string GetSwapNavPrompt()
 944    {
 945        bool bNS6 = false;
 946        string result = "";
 947        if ((Convert.ToString(System.Web.HttpContext.Current.Request.ServerVariables["http_user_agent"]).ToUpper()).IndexOf("GECKO") + 1 > 0)
 948        {
 949            bNS6 = true;
 950        }
 951        else
 952        {
 953            bNS6 = false;
 954        }
 955        if (!(bNS6))
 956        {
 957            result = result + "<ILAYER name=\"messLayer\"><LAYER name=\"advancedMess\" visibility=\"show\"><NOLAYER>";
 958        }
 959        result = result + "<div id=\"advancedMess\" style=\"display: block;\">";
 960        if (!(bNS6))
 961        {
 962            result = result + "</NOLAYER>";
 963        }
 964        result = result + "<a href=\"#\" onClick=\"SwapPermDisplay();return false;\" title=\"" + m_refMsg.GetMessage("alt display adv perms text") + "\" alt=\"" + m_refMsg.GetMessage("alt display adv perms text") + "\">" + m_refMsg.GetMessage("display advanced permissions msg") + "</a>";
 965        if (!(bNS6))
 966        {
 967            result = result + "<NOLAYER>";
 968        }
 969        result = result + "</div>";
 970        if (!(bNS6))
 971        {
 972            result = result + "</NOLAYER></LAYER><LAYER name=\"standardMess\" visibility=\"hidden\"><NOLAYER>";
 973        }
 974        result = result + "<div id=\"standardMess\" style=\"display: none;\">";
 975        if (!(bNS6))
 976        {
 977            result = result + "</NOLAYER>";
 978        }
 979        result = result + "<a href=\"#\" onClick=\"SwapPermDisplay();return false;\" title=\"" + m_refMsg.GetMessage("alt display std perms text") + "\" alt=\"" + m_refMsg.GetMessage("alt display std perms text") + "\">" + m_refMsg.GetMessage("display standard permissions msg") + "</a>";
 980        if (!(bNS6))
 981        {
 982            result = result + "<NOLAYER>";
 983        }
 984        result = result + "</div>";
 985        if (!(bNS6))
 986        {
 987            result = result + "</NOLAYER></LAYER></ILAYER>";
 988        }
 989        return (result);
 990    }
 991    public string GetMemberShipNavSwap(string action, string strType, object id, object membership)
 992    {
 993        string result = "";
 994        if ((string)membership == "true")
 995        {
 996            result = "<a href=\"content.aspx?LangType=" + ContentLanguage + "&action=" + action + "&type=" + strType + "&id=" + id.ToString() + "&membership=false\">" + m_refMsg.GetMessage("lbl view cms users") + "</a>";
 997        }
 998        else
 999        {
1000            result = "<a href=\"content.aspx?LangType=" + ContentLanguage + "&action=" + action + "&type=" + strType + "&id=" + id + "&membership=true\">" + m_refMsg.GetMessage("lbl view memberShip users") + "</a>";
1001        }
1002        return (result);
1003    }
1004	public string GetCatalogEditAnchor(long Id, int Type, bool bFromApproval)
1005	{
1006		return GetCatalogEditAnchor(Id, Type, bFromApproval, false);
1007	}
1008
1009    public string GetCatalogEditAnchor(long Id, int Type, bool bFromApproval, bool isPrimary)
1010    {
1011        string result = "";
1012        string SRC = "";
1013        string str;
1014        string backStr;
1015
1016        if (bFromApproval)
1017        {
1018            backStr = "back_file=approval.aspx";
1019        }
1020        else
1021        {
1022            backStr = "back_file=content.aspx";
1023        }
1024
1025        str = System.Web.HttpContext.Current.Request.QueryString["action"];
1026        if (str.Length > 0)
1027        {
1028            backStr = backStr + "&back_action=" + str;
1029        }
1030
1031        if (bFromApproval)
1032        {
1033            if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["page"]))
1034            {
1035                str = System.Web.HttpContext.Current.Request.QueryString["page"];
1036                if (str.Length > 0)
1037                {
1038                    backStr = backStr + "&back_page=" + str;
1039                }
1040            }
1041        }
1042
1043        if (!bFromApproval)
1044        {
1045            str = System.Web.HttpContext.Current.Request.QueryString["folder_id"];
1046            if (str.Length > 0)
1047            {
1048                backStr = backStr + "&back_folder_id=" + str;
1049            }
1050        }
1051
1052        str = System.Web.HttpContext.Current.Request.QueryString["id"];
1053        if (str.Length > 0)
1054        {
1055            backStr = backStr + "&back_id=" + str;
1056        }
1057
1058        if (!(System.Web.HttpContext.Current.Request.QueryString["callerpage"] == null))
1059        {
1060            str = AntiXss.UrlEncode(System.Web.HttpContext.Current.Request.QueryString["callerpage"]);
1061            if (str.Length > 0)
1062            {
1063                backStr = backStr + "&back_callerpage=" + str;
1064            }
1065        }
1066        if (!(System.Web.HttpContext.Current.Request.QueryString["origurl"] == null))
1067        {
1068            str = System.Web.HttpContext.Current.Request.QueryString["origurl"];
1069            if (str.Length > 0)
1070            {
1071                backStr = backStr + "&back_origurl=" + EkFunctions.UrlEncode(str);
1072            }
1073        }
1074        str = ContentLanguage.ToString();
1075        if (str.Length > 0)
1076        {
1077            backStr = backStr + "&back_LangType=" + str + "&rnd=" + System.Convert.ToInt32(Conversion.Int((10 * VBMath.Rnd()) + 1));
1078        }
1079
1080        SRC = (string)("commerce/catalogentry.aspx?close=false&LangType=" + ContentLanguage + "&id=" + Id + "&type=update&" + backStr);
1081        if (bFromApproval)
1082        {
1083            SRC += "&pullapproval=true";
1084        }
1085
1086        result = GetButtonEventsWCaption(m_refAPI.AppPath + "images/UI/Icons/contentEdit.png", "#", m_refMsg.GetMessage("alt edit button text"), m_refMsg.GetMessage("btn edit"), "OnClick=\"javascript:top.document.getElementById(\'ek_main\').src=\'" + SRC + "\';return false;\"" + ",\'EDIT\',790,580,1,1);return false;\"", EditButtonCssClass, isPrimary);
1087        return (result);
1088    }
1089
1090	public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink)
1091	{
1092		return GetPageBuilderEditAnchor(Id, languageId, quickLink, false);
1093	}
1094    public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary)
1095    {
1096        //make popup window with link to this pageids wireframe, and pass in the id and an edit flag
1097        ContentAPI capi = new ContentAPI();
1098        FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id));
1099
1100        string URL = "";
1101        Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon();
1102        URL = u.GetAliasForContent(Id);
1103
1104        if (URL == string.Empty || fd.IsDomainFolder)
1105        {
1106            URL = quickLink;
1107        }
1108
1109        if (URL.Contains("?"))
1110        {
1111            URL = URL + "&ektronPageBuilderEdit=true";
1112        }
1113        else
1114        {
1115            URL = URL + "?ektronPageBuilderEdit=true";
1116        }
1117        if (URL.IndexOf("LangType=") == -1)
1118        {
1119            URL = URL + "&LangType=" + languageId.ToString();
1120        }
1121        URL = this.m_refAPI.SitePath + URL;
1122        URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary);
1123        return URL;
1124    }
1125	
1126	public string GetPageBuilderEditAnchor(long Id, ContentData contentdata)
1127	{
1128		return GetPageBuilderEditAnchor(Id, contentdata, false);
1129	}
1130
1131    public string GetPageBuilderEditAnchor(long Id, ContentData contentdata, bool isPrimary)
1132    {
1133        //make popup window with link to this pageids wireframe, and pass in the id and an edit flag
1134
1135        string URL = "";
1136        if (contentdata.SubType == EkEnumeration.CMSContentSubtype.PageBuilderData || contentdata.SubType == EkEnumeration.CMSContentSubtype.PageBuilderMasterData)
1137        {
1138            if (contentdata.ContType == (int)EkEnumeration.CMSContentType.Content || (contentdata.ContType == (int)EkEnumeration.CMSContentType.Archive_Content && contentdata.EndDateAction != 1))
1139            {
1140                URL = GetPageBuilderEditAnchor(Id, contentdata.LanguageId, contentdata.Quicklink, isPrimary);
1141            }
1142        }
1143        return URL;
1144    }
1145
1146	public string GetEditAnchor(long Id, int Type, bool bFromApproval, EkEnumeration.CMSContentSubtype subType)
1147	{
1148		return GetEditAnchor(Id, Type, bFromApproval, subType, false);
1149	}
1150
1151    public string GetEditAnchor(long Id, int Type, bool bFromApproval, EkEnumeration.CMSContentSubtype subType, bool isPrimary)
1152    {
1153        string result = "";
1154        string SRC = "";
1155        string str;
1156        string backStr;
1157        if (Type == 3333)
1158        {
1159			return GetCatalogEditAnchor(Id, Type, bFromApproval, isPrimary

Large files files are truncated, but you can click here to view the full file