private void ViewSubscriptions() { string strEnabled = " "; int i = 0; int findindex; Array arrSubscribed = null; string strNotifyA = ""; string strNotifyI = ""; string strNotifyN = ""; long intInheritFrom; EmailFromData[] emailfrom_list; int y = 0; EmailMessageData[] defaultmessage_list; EmailMessageData[] unsubscribe_list; EmailMessageData[] optout_list; System.Text.StringBuilder sbOutput = new System.Text.StringBuilder(); SettingsData settings_list; intInheritFrom = m_refContentApi.GetFolderInheritedFrom(m_intFolderId); subscription_data_list = m_refContentApi.GetSubscriptionsForFolder(intInheritFrom); //AGofPA get subs for folder; set break inheritance flag false subscription_properties_list = m_refContentApi.GetSubscriptionPropertiesForContent(m_intId); //first try content if (subscription_properties_list == null) { subscription_properties_list = m_refContentApi.GetSubscriptionPropertiesForFolder(intInheritFrom); //then get folder subscribed_data_list = subscription_data_list; // get subs for folder } else //content is populated. { subscribed_data_list = m_refContentApi.GetSubscriptionsForContent(m_intId); // get subs for folder } emailfrom_list = m_refContentApi.GetAllEmailFrom(); defaultmessage_list = m_refContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.DefaultMessage); unsubscribe_list = m_refContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Unsubscribe); optout_list = m_refContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OptOut); settings_list = (new SiteAPI()).GetSiteVariables(-1); if ((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (subscription_data_list == null) || (settings_list.AsynchronousLocation == "")) { tdsubscriptiontext.Text += "<input type=\"hidden\" name=\"suppress_notification\" value=\"true\">"; tdsubscriptiontext.Text += "<br/>" + m_refMsg.GetMessage("lbl web alert settings") + ":<br/><br/>" + m_refMsg.GetMessage("lbl web alert not setup") + "<br/>"; if (emailfrom_list == null) { tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("lbl web alert emailfrom not setup") + "</font>"; } if (defaultmessage_list == null) { tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("lbl web alert def msg not setup") + "</font>"; } if (unsubscribe_list == null) { tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("lbl web alert unsub not setup") + "</font>"; } if (optout_list == null) { tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("lbl web alert optout not setup") + "</font>"; } if (subscription_data_list == null) { phWebAlerts.Visible = false; phWebAlerts2.Visible = false; tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("alt No subscriptions are enabled on the folder.") + "</font>"; } if (settings_list.AsynchronousLocation == "") { tdsubscriptiontext.Text += "<br/><font color=\"red\">" + m_refMsg.GetMessage("alt The location to the Asynchronous Data Processor is not specified.") + "</font>"; } return; } if (subscription_properties_list == null) { subscription_properties_list = new SubscriptionPropertiesData(); } strEnabled = " disabled=\"true\" "; switch (subscription_properties_list.NotificationType.GetHashCode()) { case 0: strNotifyA = " CHECKED=\"true\" "; strNotifyI = ""; strNotifyN = ""; break; case 1: strNotifyA = ""; strNotifyI = " CHECKED=\"true\" "; strNotifyN = ""; break; case 2: strNotifyA = ""; strNotifyI = ""; strNotifyN = " CHECKED=\"true\" "; break; } //always break inheritance because its content tdsubscriptiontext.Text += "<input id=\"break_sub_inherit_button\" type=\"hidden\" name=\"break_sub_inherit_button\" value=\"break_sub_inherit_button\">"; tdsubscriptiontext.Text += "<table class=\"ektronGrid\">"; tdsubscriptiontext.Text += " <tr>"; tdsubscriptiontext.Text += " <td class=\"label\">"; tdsubscriptiontext.Text += " " + m_refMsg.GetMessage("lbl web alert opt") + ":"; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " <td class=\"value\">"; tdsubscriptiontext.Text += " <input type=\"radio\" value=\"Always\" name=\"notify_option\" " + strNotifyA + " " + strEnabled + "> " + m_refMsg.GetMessage("lbl web alert notify always") + "<br />"; tdsubscriptiontext.Text += " <input type=\"radio\" value=\"Initial\" name=\"notify_option\"" + strNotifyI + " " + strEnabled + "> " + m_refMsg.GetMessage("lbl web alert notify initial") + "<br />"; tdsubscriptiontext.Text += " <input type=\"radio\" value=\"Never\" name=\"notify_option\"" + strNotifyN + " " + strEnabled + "> " + m_refMsg.GetMessage("lbl web alert notify never"); tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " </tr>"; tdsubscriptiontext.Text += " <tr>"; tdsubscriptiontext.Text += " <td class=\"label\">"; tdsubscriptiontext.Text += " " + m_refMsg.GetMessage("lbl web alert subject") + ":"; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " <td class=\"value\">"; if (subscription_properties_list.Subject != "") { tdsubscriptiontext.Text += " <input type=\"text\" maxlength=\"255\" size=\"65\" value=\"" + subscription_properties_list.Subject + "\" name=\"notify_subject\" " + strEnabled + "/>"; } else { tdsubscriptiontext.Text += " <input type=\"text\" maxlength=\"255\" size=\"65\" value=\"\" name=\"notify_subject\" " + strEnabled + "/>"; } tdsubscriptiontext.Text += ""; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " </tr>"; tdsubscriptiontext.Text += " <tr>"; tdsubscriptiontext.Text += " <td class=\"label\">"; tdsubscriptiontext.Text += " " + m_refMsg.GetMessage("lbl web alert emailfrom address") + ":"; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " <td class=\"value\">"; tdsubscriptiontext.Text += " <select name=\"notify_emailfrom\" " + strEnabled + ">:"; if ((emailfrom_list != null) && emailfrom_list.Length > 0) { for (y = 0; y <= emailfrom_list.Length - 1; y++) { if (emailfrom_list[y].Email == subscription_properties_list.EmailFrom) { tdsubscriptiontext.Text += "<option value=\"" + emailfrom_list[y].Id + "\" SELECTED>" + emailfrom_list[y].Email + "</option>"; } else { tdsubscriptiontext.Text += "<option value=\"" + emailfrom_list[y].Id + "\">" + emailfrom_list[y].Email + "</option>"; } } } tdsubscriptiontext.Text += " </select>"; tdsubscriptiontext.Text += ""; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " </tr>"; tdsubscriptiontext.Text += " <tr>"; tdsubscriptiontext.Text += " <td class=\"label\">"; tdsubscriptiontext.Text += " " + m_refMsg.GetMessage("lbl web alert contents") + ":"; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " <td class=\"value\">"; tdsubscriptiontext.Text += " <input id=\"use_optout_button\" type=\"checkbox\" checked=\"true\" name=\"use_optout_button\" disabled=\"true\">" + m_refMsg.GetMessage("lbl optout message"); tdsubscriptiontext.Text += " <select " + strEnabled + " name=\"notify_optoutid\">"; if ((optout_list != null) && optout_list.Length > 0) { for (y = 0; y <= optout_list.Length - 1; y++) { if (optout_list[y].Id == subscription_properties_list.OptOutID) { tdsubscriptiontext.Text += "<option value=\"" + optout_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"; } else { tdsubscriptiontext.Text += "<option value=\"" + optout_list[y].Id + "\">" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"; } } } tdsubscriptiontext.Text += " </select><br />"; if (subscription_properties_list.DefaultMessageID > 0) { tdsubscriptiontext.Text += " <input id=\"use_message_button\" type=\"checkbox\" checked=\"true\" name=\"use_message_button\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use default message"); } else { tdsubscriptiontext.Text += " <input id=\"use_message_button\" type=\"checkbox\" name=\"use_message_button\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use default message"); } tdsubscriptiontext.Text += " <select " + strEnabled + " name=\"notify_messageid\">"; if ((defaultmessage_list != null) && defaultmessage_list.Length > 0) { for (y = 0; y <= defaultmessage_list.Length - 1; y++) { if (defaultmessage_list[y].Id == subscription_properties_list.DefaultMessageID) { tdsubscriptiontext.Text += "<option value=\"" + defaultmessage_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"; } else { tdsubscriptiontext.Text += "<option value=\"" + defaultmessage_list[y].Id + "\">" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"; } } } tdsubscriptiontext.Text += " </select><br />"; if (subscription_properties_list.SummaryID > 0) { tdsubscriptiontext.Text += " <input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" checked=\"true\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use summary message") + "<br />"; } else { tdsubscriptiontext.Text += " <input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use summary message") + "<br />"; } if (subscription_properties_list.ContentID == -1) { tdsubscriptiontext.Text += " <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"true\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use content message"); tdsubscriptiontext.Text += " "; tdsubscriptiontext.Text += " <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"" + subscription_properties_list.ContentID.ToString() + "\"/><input type=\"hidden\" name=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" value=\"[[use current]]\" " + strEnabled + " size=\"65\"/><br/>"; } else if (subscription_properties_list.ContentID > 0) { tdsubscriptiontext.Text += " <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"true\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use content message"); tdsubscriptiontext.Text += " "; tdsubscriptiontext.Text += " <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"" + subscription_properties_list.ContentID.ToString() + "\"/><input type=\"hidden\" name=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" value=\"" + subscription_properties_list.UseContentTitle.ToString() + "\" " + strEnabled + " size=\"65\"/><br/><br/>"; } else { tdsubscriptiontext.Text += " <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" " + strEnabled + ">" + m_refMsg.GetMessage("lbl use content message"); tdsubscriptiontext.Text += " "; tdsubscriptiontext.Text += " <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"0\" /><input type=\"hidden\" name=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" onkeydown=\"return false\" value=\"\" " + strEnabled + " size=\"65\"/><br/>"; } if (subscription_properties_list.UseContentLink > 0) { tdsubscriptiontext.Text += " <input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" checked=\"true\" " + strEnabled + ">Use Content Link<br />"; } else { tdsubscriptiontext.Text += " <input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" " + strEnabled + ">Use Content Link<br />"; } tdsubscriptiontext.Text += " <input id=\"use_unsubscribe_button\" type=\"checkbox\" checked=\"true\" name=\"use_unsubscribe_button\" disabled=\"true\">" + m_refMsg.GetMessage("lbl unsubscribe message"); tdsubscriptiontext.Text += " <select " + strEnabled + " name=\"notify_unsubscribeid\">"; if ((unsubscribe_list != null) && unsubscribe_list.Length > 0) { for (y = 0; y <= unsubscribe_list.Length - 1; y++) { if (unsubscribe_list[y].Id == subscription_properties_list.UnsubscribeID) { tdsubscriptiontext.Text += "<option value=\"" + unsubscribe_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"; } else { tdsubscriptiontext.Text += "<option value=\"" + unsubscribe_list[y].Id + "\">" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"; } } } tdsubscriptiontext.Text += " </select><br />"; tdsubscriptiontext.Text += " </td>"; tdsubscriptiontext.Text += " </tr>"; tdsubscriptiontext.Text += " </table>"; tdsubscriptiontext.Text += "<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl avail web alert") + "</div>"; tdsubscriptiontext.Text += "<table class=\"ektronGrid\" cellspacing=\"1\" id=\"cfld_subscription_assignment\" id=\"cfld_folder_assignment\">"; if (!(subscription_data_list == null)) { tdsubscriptiontext.Text += "<tr class=\"title-header\"><td>" + m_refMsg.GetMessage("lbl assigned") + "</td><td align=\"left\">" + m_refMsg.GetMessage("lbl name") + "</td></tr>"; if (!(subscribed_data_list == null)) { arrSubscribed = Array.CreateInstance(typeof(long), subscribed_data_list.Length); for (i = 0; i <= subscribed_data_list.Length - 1; i++) { arrSubscribed.SetValue(subscribed_data_list[i].Id, i); } if (arrSubscribed != null) { if (arrSubscribed.Length > 0) { Array.Sort(arrSubscribed); } } } i = 0; for (i = 0; i <= subscription_data_list.Length - 1; i++) { findindex = -1; if ((subscribed_data_list != null) && (arrSubscribed != null)) { findindex = Array.BinarySearch(arrSubscribed, subscription_data_list[i].Id); } tdsubscriptiontext.Text += "<tr>"; if (findindex < 0) { tdsubscriptiontext.Text += "<td nowrap=\"true\" align=\"center\"><input type=\"checkbox\" name=\"Assigned_" + subscription_data_list[i].Id + "\" id=\"Assigned_" + subscription_data_list[i].Id + "\" " + strEnabled + "></td></td>"; } else { tdsubscriptiontext.Text += "<td nowrap=\"true\" align=\"center\"><input type=\"checkbox\" name=\"Assigned_" + subscription_data_list[i].Id + "\" id=\"Assigned_" + subscription_data_list[i].Id + "\" checked=\"true\" " + strEnabled + "></td></td>"; } tdsubscriptiontext.Text += "<td nowrap=\"true\" align=\"Left\">" + subscription_data_list[i].Name + "</td>"; tdsubscriptiontext.Text += "</tr>"; } } else { tdsubscriptiontext.Text += "<tr><td>Nothing available.</td></tr>"; } tdsubscriptiontext.Text += "</table><input type=\"hidden\" name=\"content_sub_assignments\" value=\"\">"; }
private void Process_DoFolderUpdate() { bool bInheritanceIsDif; bInheritanceIsDif = false; int isub = 0; string init_xmlconfig = Request.Form["init_xmlconfig"]; string init_frm_xmlinheritance = Request.Form["init_frm_xmlinheritance"]; Ektron.Cms.Content.EkXmlIndexing XmlInd; FolderData folder_data = null; Ektron.Cms.Content.EkContent m_refContent; SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData(); Collection page_subscription_data = new Collection(); Collection page_sub_temp = new Collection(); Array arrSubscriptions; int i = 0; BlogRollItem[] abriRoll; string sCatTemp = ""; List<string> siteAliasList = new List<string>(); string[] arSiteAliasList; Ektron.Cms.SiteAliasApi _refSiteAliasApi; bool subscriptionRestore = false; m_refContent = _ContentApi.EkContentRef; if (_FolderId == -1) { _FolderId = _Id; //i.e Request.Form(folder_id.UniqueID) } _FolderData = _ContentApi.GetFolderById(_Id, true, true); _FolderType = _FolderData.FolderType; if (Convert.ToString(_FolderId) != "") { if (_FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Catalog) { if (!string.IsNullOrEmpty(Request.Form["web_alert_inherit_checkbox"])) { sub_prop_data.BreakInheritance = false; subscriptionRestore = true; } else { sub_prop_data.BreakInheritance = true; if (!string.IsNullOrEmpty(Request.Form["web_alert_restore_inherit_checkbox"])) { subscriptionRestore = true; } } if (Request.Form["notify_option"] == ("Always")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always; } else if (Request.Form["notify_option"] == ("Initial")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial; } else if (Request.Form["notify_option"] == ("Never")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never; } sub_prop_data.SuspendNextNotification = false; sub_prop_data.SendNextNotification = false; sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]); if (!string.IsNullOrEmpty((Request.Form["use_message_button"]))) { sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]); } else { sub_prop_data.DefaultMessageID = 0; } if (!string.IsNullOrEmpty(Request.Form["use_summary_button"])) { sub_prop_data.SummaryID = 1; } else { sub_prop_data.SummaryID = 0; } if (!string.IsNullOrEmpty(Request.Form["use_content_button"])) { sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]); } else { sub_prop_data.ContentID = 0; } sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]); if (!string.IsNullOrEmpty(Request.Form["notify_url"])) { sub_prop_data.URL = Request.Form["notify_url"]; } else { sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"]; } if (!string.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } else { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } if (!string.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.WebLocation = Request.Form["notify_weblocation"]; } else { sub_prop_data.WebLocation = "subscriptions"; } if (!string.IsNullOrEmpty(Request.Form["notify_subject"])) { sub_prop_data.Subject = Request.Form["notify_subject"]; } else { sub_prop_data.Subject = ""; } if (!string.IsNullOrEmpty(Request.Form["notify_emailfrom"])) { sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"]; } else { sub_prop_data.EmailFrom = ""; } sub_prop_data.UseContentTitle = ""; if (!string.IsNullOrEmpty(Request.Form["use_contentlink_button"])) { sub_prop_data.UseContentLink = 1; } else { sub_prop_data.UseContentLink = 0; } if (!string.IsNullOrEmpty(Request.Form["content_sub_assignments"])) { arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0); if (arrSubscriptions.Length > 0) { for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++) { if (arrSubscriptions.GetValue(isub).ToString() != ",") // ignore empty value when web alerts are inherited { page_sub_temp = new Collection(); page_sub_temp.Add(long.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null); page_subscription_data.Add(page_sub_temp, null, null, null); } } } } else { page_subscription_data = null; } page_sub_temp = null; } _PageData = new Collection(); _PageData.Add(Request.Form["foldername"].Trim(".".ToCharArray()), "FolderName", null, null); if (!string.IsNullOrEmpty(Request.Form["isblog"])) { _PageData.Add(Request.Form[tagline.UniqueID], "FolderDescription", null, null); } else { _PageData.Add(Request.Form[folderdescription.UniqueID], "FolderDescription", null, null); } _PageData.Add(Request.Form[folder_id.UniqueID], "FolderID", null, null); if (string.IsNullOrEmpty(Request.Form["TemplateTypeBreak"])) { _PageData.Add(Request.Form["templatefilename"], "TemplateFileName", null, null); //Defect # 54021 - Add failed. Duplicate key value supplied. //string templateName = (string)(Request.Form["templatefilename"].Split("(".ToCharArray())[0].TrimEnd()); //TemplateData[] template_data; //template_data = _ContentApi.GetAllTemplates("TemplateFileName"); //int j = 0; //for (j = 0; j <= template_data.Length - 1; j++) //{ // if (!(Request.Form["tinput_" + template_data[j].Id] == null) && template_data[j].FileName == templateName) // { // _PageData.Add(template_data[i].SubType, "TemplateSubType", null, null); // } //} // Defect # 56113 // Also added new hidden field to ascx + changes to TemplateConfigSave() in content.aspx if (!String.IsNullOrEmpty(Request.Form["defaultTemplateID"])) { TemplateModel templateModel = new TemplateModel(); TemplateData template_data = templateModel.FindByID(long.Parse(Request.Form["defaultTemplateID"].ToString())); _PageData.Add(template_data.SubType, "TemplateSubType", null, null); } } else { _PageData.Add("", "TemplateFileName", null, null); } //_PageData.Add(Request.Form("templatefilename"), "TemplateFileName") _PageData.Add(Request.Form["stylesheet"], "StyleSheet", null, null); if (_FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { if (Strings.LCase(Request.Form["TypeBreak"]) == "on") { if (init_frm_xmlinheritance == "0") { bInheritanceIsDif = true; } _PageData.Add(true, "XmlInherited", null, null); } else { if (init_frm_xmlinheritance == "1") { bInheritanceIsDif = true; } _PageData.Add(false, "XmlInherited", null, null); } _PageData.Add(Request.Form["xmlconfig"], "XmlConfiguration", null, null); } else { bInheritanceIsDif = false; _PageData.Add(false, "XmlInherited", null, null); _PageData.Add(Ektron.Cms.Content.Calendar.WebCalendar.WebEventSmartformId.ToString(), "XmlConfiguration", null, null); } // handle multitemplates if there are any i = 1; Collection altinfo = new Collection(); //While (Request.Form("namealt" + CStr(i)) <> "") // Dim namealt As String = Request.Form("namealt" + CStr(i)) // Dim xmlconfigalt As String = Request.Form("xmlconfigalt" + CStr(i)) // If (xmlconfigalt = "ignore") Then xmlconfigalt = -1 // Dim templatealt As String = Request.Form("templatealt" + CStr(i)) // If (templatealt = "ignore") Then templatealt = -1 // If ((xmlconfigalt > -1) Or (templatealt > -1)) Then // ' add this multitemplate only if a template or config is selected // Dim multitemplate As New Collection // multitemplate.Add(m_intFolderId, "FolderID") // multitemplate.Add(xmlconfigalt, "CollectionID") // multitemplate.Add(templatealt, "TemplateFileID") // multitemplate.Add("", "CSSFile") // multitemplate.Add(namealt, "Name") // altinfo.Add(multitemplate) // End If // i = i + 1 //End While //m_refContentApi.UpdateFolderContentTemplates(m_intFolderId, altinfo) bool isPublishedAsPdf = System.Convert.ToBoolean((Request.Form["publishAsPdf"] == "on") ? true : false); _PageData.Add(isPublishedAsPdf, "PublishPdfActive", null, null); // handle dynamic replication properties if (folder_data == null) { folder_data = _ContentApi.GetFolderById(_FolderId, true, true); } if (!string.IsNullOrEmpty(Request.Form["EnableReplication"]) || folder_data.IsCommunityFolder) { _PageData.Add(1, "EnableReplication", null, null); } else { _PageData.Add(0, "EnableReplication", null, null); } // add domain properties if they're there if ((!string.IsNullOrEmpty(Request.Form["IsDomainFolder"])) && (!string.IsNullOrEmpty(Request.Form["DomainProduction"]))) { _PageData.Add(true, "IsDomainFolder", null, null); string staging = Request.Form["DomainStaging"]; string production = Request.Form["DomainProduction"]; if (staging == null) { staging = ""; } if (production == null) { production = ""; } if (staging.EndsWith("/")) { staging = staging.Substring(0, staging.Length - 1); } if (production.EndsWith("/")) { production = production.Substring(0, production.Length - 1); } if (staging == "") { staging = production; } _PageData.Add(staging, "DomainStaging", null, null); _PageData.Add(production, "DomainProduction", null, null); } else { _PageData.Add(false, "IsDomainFolder", null, null); } if (!string.IsNullOrEmpty(Request.Form["isblog"])) //isblog { _PageData.Add(true, "isblog", null, null); _PageData.Add(Request.Form["blog_visibility"], "blog_visibility", null, null); _PageData.Add(Request.Form["blogtitle"], "blogtitle", null, null); if (!string.IsNullOrEmpty(Request.Form["postsvisible"])) { _PageData.Add(Request.Form["postsvisible"], "postsvisible", null, null); } else { _PageData.Add(-1, "postsvisible", null, null); } if (!string.IsNullOrEmpty(Request.Form["enable_comments"])) { _PageData.Add(true, "enablecomments", null, null); } else { _PageData.Add(false, "enablecomments", null, null); } if (!string.IsNullOrEmpty(Request.Form["moderate_comments"])) { _PageData.Add(true, "moderatecomments", null, null); } else { _PageData.Add(false, "moderatecomments", null, null); } if (!string.IsNullOrEmpty(Request.Form["require_authentication"])) { _PageData.Add(true, "requireauthentication", null, null); } else { _PageData.Add(false, "requireauthentication", null, null); } _PageData.Add(Request.Form["notify_url"], "notifyurl", null, null); if (!string.IsNullOrEmpty(Request.Form["categorylength"])) { for (i = 0; i <= (Convert.ToInt64(Request.Form["categorylength"]) - 1); i++) { if (Request.Form["category" + i.ToString()] != "") { if (i == (Convert.ToInt64(Request.Form["categorylength"]) - 1)) { sCatTemp += Strings.Replace(Request.Form["category" + i.ToString()], ";", "~@~@~", 1, -1, 0); } else { sCatTemp += (string)(Strings.Replace(Request.Form["category" + i.ToString()], ";", "~@~@~", 1, -1, 0) + ";"); } } } } _PageData.Add(sCatTemp, "blogcategories", null, null); if (!string.IsNullOrEmpty(Request.Form["rolllength"])) { abriRoll = new BlogRollItem[1]; for (i = 0; i <= (Convert.ToInt64(Request.Form["rolllength"]) - 1); i++) { Array.Resize(ref abriRoll, i + 1); if (!string.IsNullOrEmpty(Request.Form["editfolder_linkname" + i.ToString()]) && !string.IsNullOrEmpty(Request.Form["editfolder_url" + i.ToString()])) { //add only if we have something with a name/url abriRoll[i] = new BlogRollItem(); abriRoll[i].LinkName = Request.Form["editfolder_linkname" + i.ToString()]; abriRoll[i].URL = Request.Form["editfolder_url" + i.ToString()]; if (!string.IsNullOrEmpty(Request.Form["editfolder_short" + i.ToString()])) { abriRoll[i].ShortDescription = Request.Form["editfolder_short" + i.ToString()]; } else { abriRoll[i].ShortDescription = ""; } if (!string.IsNullOrEmpty(Request.Form["editfolder_rel" + i.ToString()])) { abriRoll[i].Relationship = Request.Form["editfolder_rel" + i.ToString()]; } else { abriRoll[i].Relationship = ""; } } else { abriRoll[i] = null; } } _PageData.Add(abriRoll, "blogroll", null, null); } else { _PageData.Add(null, "blogroll", null, null); } } if ((!string.IsNullOrEmpty(Request.Form["hdnInheritSitemap"])) && (Request.Form["hdnInheritSitemap"].ToString().ToLower() == "true")) { _PageData.Add(true, "SitemapPathInherit", null, null); } else { _PageData.Add(false, "SitemapPathInherit", null, null); } _PageData.Add(Utilities.DeserializeSitemapPath(Request.Form, this._ContentLanguage), "SitemapPath", null, null); if ((!string.IsNullOrEmpty(Request.Form["break_inherit_button"])) && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritMetadata", null, null); //break inherit button is check. } else { _PageData.Add(0, "InheritMetadata", null, null); } _PageData.Add(Request.Form["inherit_meta_from"], "InheritMetadataFrom", null, null); if ((!string.IsNullOrEmpty(Request.Form["TaxonomyTypeBreak"])) && Request.Form["TaxonomyTypeBreak"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritTaxonomy", null, null); if ((!string.IsNullOrEmpty(Request.Form["CategoryRequired"])) && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(Request.Form[parent_category_required.UniqueID], "CategoryRequired", null, null); } } else { _PageData.Add(0, "InheritTaxonomy", null, null); if ((!string.IsNullOrEmpty(Request.Form["CategoryRequired"])) && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(0, "CategoryRequired", null, null); } } string IdRequests = ""; if ((Request.Form["taxlist"] != null) && Request.Form["taxlist"] != "") { IdRequests = Request.Form["taxlist"]; } _PageData.Add(IdRequests, "TaxonomyList", null, null); _PageData.Add(Request.Form[inherit_taxonomy_from.UniqueID], "InheritTaxonomyFrom", null, null); //--------------------IscontentSearchable----------------------------- if (Request.Form["chkInheritIscontentSearchable"] != null && Request.Form["chkInheritIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(Request.Form[current_IscontentSearchable.UniqueID], "IscontentSearchable", null, null); } } else { _PageData.Add(0, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(0, "IscontentSearchable", null, null); } } _PageData.Add(Request.Form[inherit_IscontentSearchable_from.UniqueID], "IsContentSearchableInheritedFrom", null, null); //--------------------IsContentSearchable End ------------------------- //-------------------DisplaySettings-------------------- int totalTabs = 0; if (Request.Form["chkInheritIsDisplaySettings"] != null && Request.Form["chkInheritIsDisplaySettings"].ToString().ToLower() == "on") { _PageData.Add(1, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(Request.Form[current_IsDisplaySettings.UniqueID], "DisplaySettings", null, null); } } else { _PageData.Add(0, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(1, "DisplaySettings", null, null); } } _PageData.Add(Request.Form[inherit_IsDisplaySettings_from.UniqueID], "DisplaySettingsInheritedFrom", null, null); //-------------------DisplaySettingsEnd------------------ if (Request.Form["chkInheritAliases"] != null && Request.Form["chkInheritAliases"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(Request.Form[current_alias_required.UniqueID], "AliasRequired", null, null); } } else { _PageData.Add(0, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(0, "AliasRequired", null, null); } } _PageData.Add(Request.Form[inherit_alias_from.UniqueID], "InheritAliasFrom", null, null); // Update - add flagging items: ProcessFlaggingPostBack(_PageData); m_refContent.UpdateFolderPropertiesv2_0(_PageData); if (folder_data.FolderType == 2) //OrElse folder_data.Id = 0 Avoiding root to be site aliased { arSiteAliasList = Request.Form["savedSiteAlias"].TrimStart(" ".ToCharArray()).TrimStart(",".ToCharArray()).Split(",".ToCharArray()); foreach (string aliasStr in arSiteAliasList) { if (aliasStr != string.Empty) { siteAliasList.Add(aliasStr); } } _refSiteAliasApi = new Ektron.Cms.SiteAliasApi(); _refSiteAliasApi.Save(folder_data.Id, siteAliasList); } if ((string.IsNullOrEmpty(Request.Form["suppress_notification"])) && (_FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Catalog)) { m_refContent.UpdateSubscriptionPropertiesForFolder(_FolderId, sub_prop_data); m_refContent.UpdateSubscriptionsForFolder(_FolderId, page_subscription_data); } if (subscriptionRestore) { m_refContent.DeleteSubscriptionsForContentinFolder(_FolderId); } if ((init_xmlconfig != Request.Form["xmlconfig"] || bInheritanceIsDif) && _FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Calendar) { XmlInd = _ContentApi.EkXmlIndexingRef; if (Request.Form["xmlconfig"] != "0" && Request.Form["xmlconfig"] != "") { XmlInd.ReIndexAllDoc(Convert.ToInt64(Request.Form["xmlconfig"])); } else // inheritance has been turned on { if (Strings.LCase(Request.Form["frm_xmlinheritance"]) == "on") { folder_data = _ContentApi.GetFolderById(_FolderId, false, true); if (!(folder_data.XmlConfiguration == null)) { for (int x = 0; x <= (folder_data.XmlConfiguration.Length - 1); x++) { XmlInd.ReIndexAllDoc(folder_data.XmlConfiguration[x].Id); } //reverting 27535 - do not udpate xml_index table with new xml index search } else { XmlInd.RemoveAllIndexDoc(_FolderId); } //reverting 27535 - do not udpate xml_index table with new xml index search } else { XmlInd.RemoveAllIndexDoc(_FolderId); } } } if (string.IsNullOrEmpty(Request.Form["break_inherit_button"])) { _CustomFieldsApi.ProcessCustomFields(_FolderId); } else if ((Request.Form["break_inherit_button"] != null) && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { if (folder_data.MetaInherited == 0) { _CustomFieldsApi.ProcessCustomFields(_FolderId); } } //If (Request.Form("break_inherit_button") IsNot Nothing AndAlso Request.Form("break_inherit_button").ToString().ToLower() = "on") Then // 'break inherit button is checked. // _CustomFieldsApi.ProcessCustomFields(_FolderId) //ElseIf folder_data.MetaInherited = 0 Then // _CustomFieldsApi.ProcessCustomFields(_FolderId) //ElseIf Request.Form("break_inherit_button") Is Nothing Then // _CustomFieldsApi.ProcessCustomFields(_FolderId) //End If } if (Request.Form["oldfoldername"] == Request.Form["foldername"]) { Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + Request.Form[folder_id.UniqueID]), false); } else { Response.Redirect("content.aspx?TreeUpdated=1&LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + Request.Form[folder_id.UniqueID] + "&reloadtrees=Forms,Content,Library", false); } if (folder_data.FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.Catalog) { ProcessProductTemplatesPostBack(); } else { ProcessContentTemplatesPostBack(); } }
private void DisplaySubscriptionInfo() { string strEnabled = " "; int i = 0; int findindex; Array arrSubscribed = null; string strNotifyA = ""; string strNotifyI = ""; string strNotifyN = ""; long intInheritFrom; EmailFromData[] emailfrom_list; int y = 0; EmailMessageData[] defaultmessage_list; EmailMessageData[] unsubscribe_list; EmailMessageData[] optout_list; SettingsData settings_list; SiteAPI m_refSiteAPI = new SiteAPI(); _SubscriptionData = _ContentApi.GetAllActiveSubscriptions(); //then get folder emailfrom_list = _ContentApi.GetAllEmailFrom(); defaultmessage_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.DefaultMessage); unsubscribe_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Unsubscribe); optout_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OptOut); settings_list = m_refSiteAPI.GetSiteVariables(-1); intInheritFrom = _ContentApi.GetFolderInheritedFrom(_Id); if (intInheritFrom != _Id) //do we get settings from self { _GlobalSubInherit = true; } else { _GlobalSubInherit = false; } _SubscribedData = _ContentApi.GetSubscriptionsForFolder(intInheritFrom); _SubscriptionPropertiesData = _ContentApi.GetSubscriptionPropertiesForFolder(intInheritFrom); if ((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (_SubscriptionData == null) || (settings_list.AsynchronousLocation == "")) { lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"suppress_notification\" value=\"true\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert not setup"); lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (emailfrom_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert emailfrom not setup") + "</font><br/>"; } if (defaultmessage_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert def msg not setup") + "</font><br/>"; } if (unsubscribe_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert unsub not setup") + "</font><br/>"; } if (optout_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert optout not setup") + "</font><br/>"; } if (_SubscriptionData == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("alt No subscriptions are enabled on the folder.") + "</font><br/>"; } if (settings_list.AsynchronousLocation == "") { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("alt The location to the Asynchronous Data Processor is not specified.") + "</font>"; } return; } if (_SubscriptionPropertiesData == null) { _SubscriptionPropertiesData = new SubscriptionPropertiesData(); } strEnabled = " disabled=\"disabled\" "; switch (_SubscriptionPropertiesData.NotificationType.GetHashCode()) { case 0: strNotifyA = " checked=\"checked\" "; strNotifyI = ""; strNotifyN = ""; break; case 1: strNotifyA = ""; strNotifyI = " checked=\"checked\" "; strNotifyN = ""; break; case 2: strNotifyA = ""; strNotifyI = ""; strNotifyN = " checked=\"checked\" "; break; } if (_Id == 0) // root folder { lit_vf_subscription_properties.Text += "<input id=\"webalert_inherit_button\" type=\"hidden\" name=\"webalert_inherit_button\" value=\"webalert_inherit_button\" checked=\"checked\">"; } else if (!_GlobalSubInherit) // not inheriting { lit_vf_subscription_properties.Text += "<input id=\"webalert_inherit_button\" type=\"checkbox\" name=\"webalert_inherit_button\" value=\"webalert_inherit_button\" disabled=\"disabled\">" + _MessageHelper.GetMessage("lbl inherit parent configuration"); lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; } else // non root { lit_vf_subscription_properties.Text += "<input id=\"webalert_inherit_button\" type=\"checkbox\" name=\"webalert_inherit_button\" value=\"webalert_inherit_button\" checked=\"checked\" disabled=\"disabled\" >" + _MessageHelper.GetMessage("lbl inherit parent configuration"); lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; } lit_vf_subscription_properties.Text += "<table class=\"ektronGrid\">"; lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert opt") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Always\" name=\"notify_option\" " + strNotifyA + " " + strEnabled + ">" + _MessageHelper.GetMessage("lbl web alert notify always"); lit_vf_subscription_properties.Text += "<br />"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Initial\" name=\"notify_option\"" + strNotifyI + " " + strEnabled + ">" + _MessageHelper.GetMessage("lbl web alert notify initial"); lit_vf_subscription_properties.Text += "<br />"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Never\" name=\"notify_option\"" + strNotifyN + " " + strEnabled + ">" + _MessageHelper.GetMessage("lbl web alert notify never"); lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert subject") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; if (_SubscriptionPropertiesData.Subject != "") { lit_vf_subscription_properties.Text += "<input type=\"text\" maxlength=\"255\" size=\"65\" value=\"" + _SubscriptionPropertiesData.Subject + "\" name=\"notify_subject\" " + strEnabled + ">"; } else { lit_vf_subscription_properties.Text += "<input type=\"text\" maxlength=\"255\" size=\"65\" value=\"\" name=\"notify_subject\" " + strEnabled + ">"; } lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; //lit_vf_subscription_properties.Text &= "Notification Base URL:" //If subscription_properties_list.URL <> "" Then // lit_vf_subscription_properties.Text &= "http://<input type=""text"" maxlength=""255"" size=""65"" name=""notify_url"" " & strEnabled & " value=""" & subscription_properties_list.URL & """>" //Else // lit_vf_subscription_properties.Text &= "http://<input type=""text"" maxlength=""255"" size=""65"" name=""notify_url"" " & strEnabled & " value=""" & Request.ServerVariables("HTTP_HOST") & """>" //End If lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert emailfrom address") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; lit_vf_subscription_properties.Text += "<select name=\"notify_emailfrom\" " + strEnabled + ">:"; if ((emailfrom_list != null) && emailfrom_list.Length > 0) { for (y = 0; y <= emailfrom_list.Length - 1; y++) { if (emailfrom_list[y].Email == _SubscriptionPropertiesData.EmailFrom) { lit_vf_subscription_properties.Text += "<option value=\"" + emailfrom_list[y].Email + "\" SELECTED>" + emailfrom_list[y].Email + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + emailfrom_list[y].Email + "\">" + emailfrom_list[y].Email + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; //lit_vf_subscription_properties.Text &= "Notification File Location:" //If subscription_properties_list.WebLocation <> "" Then //lit_vf_subscription_properties.Text &= m_refContentApi.SitePath & "<input type=""text"" maxlength=""255"" size=""65"" value=""" & subscription_properties_list.WebLocation & """ name=""notify_weblocation"" " & strEnabled & ">/" //Else // lit_vf_subscription_properties.Text &= m_refContentApi.SitePath & "<input type=""text"" maxlength=""255"" size=""65"" value=""subscriptions"" name=""notify_weblocation"" " & strEnabled & ">/" //End If lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert contents") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; lit_vf_subscription_properties.Text += "<input id=\"use_optout_button\" type=\"checkbox\" checked=\"checked\" name=\"use_optout_button\" disabled=\"disabled\">" + _MessageHelper.GetMessage("lbl optout message") + " "; lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_optoutid\">"; if ((optout_list != null) && optout_list.Length > 0) { for (y = 0; y <= optout_list.Length - 1; y++) { if (optout_list[y].Id == _SubscriptionPropertiesData.OptOutID) { lit_vf_subscription_properties.Text += "<option value=\"" + optout_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + optout_list[y].Id + "\">" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (_SubscriptionPropertiesData.DefaultMessageID > 0) { lit_vf_subscription_properties.Text += ("<input id=\"use_message_button\" type=\"checkbox\" checked=\"checked\" name=\"use_message_button\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use default message")) + " "; } else { lit_vf_subscription_properties.Text += ("<input id=\"use_message_button\" type=\"checkbox\" name=\"use_message_button\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use default message")) + " "; } lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_messageid\">"; if ((defaultmessage_list != null) && defaultmessage_list.Length > 0) { for (y = 0; y <= defaultmessage_list.Length - 1; y++) { if (defaultmessage_list[y].Id == _SubscriptionPropertiesData.DefaultMessageID) { lit_vf_subscription_properties.Text += "<option value=\"" + defaultmessage_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + defaultmessage_list[y].Id + "\">" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (_SubscriptionPropertiesData.SummaryID > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" checked=\"checked\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use summary message"); } else { lit_vf_subscription_properties.Text += "<input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use summary message"); } lit_vf_subscription_properties.Text += "<br />"; if (_SubscriptionPropertiesData.ContentID == -1) { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"checked\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use content message") + " "; lit_vf_subscription_properties.Text += "<input type=\"text\" name=\"titlename\" value=\"[[use current]]\" " + strEnabled + " size=\"65\" />"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"-1\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } else if (_SubscriptionPropertiesData.ContentID > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"checked\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use content message") + " "; lit_vf_subscription_properties.Text += "<input type=\"text\" name=\"titlename\" value=\"" + _SubscriptionPropertiesData.UseContentTitle.ToString() + "\" " + strEnabled + " size=\"65\" />"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"" + _SubscriptionPropertiesData.ContentID.ToString() + "\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } else { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" " + strEnabled + ">" + _MessageHelper.GetMessage("lbl use content message"); lit_vf_subscription_properties.Text += "<input type=\"text\" name=\"titlename\" onkeydown=\"return false\" value=\"\" " + strEnabled + " size=\"65\" />"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" value=\"0\" />"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } lit_vf_subscription_properties.Text += "<br />"; if (_SubscriptionPropertiesData.UseContentLink > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" checked=\"checked\" " + strEnabled + ">Use Content Link"; } else { lit_vf_subscription_properties.Text += "<input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" " + strEnabled + ">Use Content Link"; } lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; lit_vf_subscription_properties.Text += "<input id=\"use_unsubscribe_button\" type=\"checkbox\" checked=\"checked\" name=\"use_unsubscribe_button\" disabled=\"disabled\">" + _MessageHelper.GetMessage("lbl unsubscribe message") + " "; lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_unsubscribeid\">"; if ((unsubscribe_list != null) && unsubscribe_list.Length > 0) { for (y = 0; y <= unsubscribe_list.Length - 1; y++) { if (unsubscribe_list[y].Id == _SubscriptionPropertiesData.UnsubscribeID) { lit_vf_subscription_properties.Text += "<option value=\"" + unsubscribe_list[y].Id + "\" SELECTED>" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + unsubscribe_list[y].Id + "\">" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; lit_vf_subscription_properties.Text += "</table>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; lit_vf_subscription_properties.Text += "<div class=\"ektronHeader\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl avail web alert"); lit_vf_subscription_properties.Text += "</div>"; if (!(_SubscriptionData == null)) { lit_vf_subscription_properties.Text += "<table id=\"cfld_subscription_assignment\" class=\"ektronGrid\" width=\"100%\">"; lit_vf_subscription_properties.Text += "<tbody>"; lit_vf_subscription_properties.Text += "<tr class=\"title-header\">"; lit_vf_subscription_properties.Text += "<th width=\"10%\">" + _MessageHelper.GetMessage("lbl assigned") + "</th>"; lit_vf_subscription_properties.Text += "<th>" + _MessageHelper.GetMessage("lbl name") + "</th>"; lit_vf_subscription_properties.Text += "</tr>"; if (!(_SubscribedData == null)) { arrSubscribed = Array.CreateInstance(typeof(long), _SubscribedData.Length); for (i = 0; i <= _SubscribedData.Length - 1; i++) { arrSubscribed.SetValue(_SubscribedData[i].Id, i); } if (arrSubscribed != null) { if (arrSubscribed.Length > 0) { Array.Sort(arrSubscribed); } } } i = 0; for (i = 0; i <= _SubscriptionData.Length - 1; i++) { findindex = -1; if ((_SubscribedData != null) && (arrSubscribed != null)) { findindex = Array.BinarySearch(arrSubscribed, _SubscriptionData[i].Id); } lit_vf_subscription_properties.Text += "<tr>"; if (findindex < 0) { lit_vf_subscription_properties.Text += "<td width=\"10%\" class=\"center\"><input type=\"checkbox\" name=\"Assigned_" + _SubscriptionData[i].Id + "\" id=\"Assigned_" + _SubscriptionData[i].Id + "\" " + strEnabled + "></td>"; } else { lit_vf_subscription_properties.Text += "<td class=\"center\"><input type=\"checkbox\" name=\"Assigned_" + _SubscriptionData[i].Id + "\" id=\"Assigned_" + _SubscriptionData[i].Id + "\" checked=\"checked\" " + strEnabled + "></td>"; } lit_vf_subscription_properties.Text += "<td>" + _SubscriptionData[i].Name + "</td>"; lit_vf_subscription_properties.Text += "</tr>"; } lit_vf_subscription_properties.Text += "</tbody></table>"; } else { lit_vf_subscription_properties.Text += "Nothing available."; } lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"content_sub_assignments\" id=\"content_sub_assignments\" value=\"\">"; DrawContentTemplatesTable(); }
private void ProcessPage(string filename, string assetId, bool fileChanged, List<AssetFileData> assetIdFileNameList) { System.Text.StringBuilder result = new System.Text.StringBuilder(); string[] Files; string[] AssetIds; string[] MimeTypes; string[] Extensions; int i = 0; int lMultiType = 0; Ektron.Cms.Common.AssetData[] asset_list; Ektron.Cms.Common.ContentResponseData[] AddMultiResult; Collection cMetadataTypes = new Collection(); Collection cCont = new Collection(); Collection cContRet = new Collection(); string editaction = Request.Form["editaction"]; int iContLoop = 1; string strSearchText = ""; string go_live = ""; string end_date = ""; string end_date_action = ""; string[] acMetaInfo = new string[4]; long MetaCount = 0; Collection page_subscription_data = new Collection(); Collection page_sub_temp = new Collection(); Array arrSubscriptions; SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData(); int isub = 0; string contentCount = ""; long intContentId; Ektron.Cms.API.Metadata metaDataAPI = new Ektron.Cms.API.Metadata(); CustomAttributeList MetaFields = new CustomAttributeList(); if (assetIdFileNameList != null) { Files = new string[assetIdFileNameList.Count - 1 + 1]; AssetIds = new string[assetIdFileNameList.Count - 1 + 1]; MimeTypes = new string[assetIdFileNameList.Count - 1 + 1]; Extensions = new string[assetIdFileNameList.Count - 1 + 1]; for (int index = 0; index <= assetIdFileNameList.Count - 1; index++) { Files[index] = Path.GetFileName((string)(assetIdFileNameList[index].FileName)); AssetIds[index] = (string)(assetIdFileNameList[index].AssetId); MimeTypes[index] = ConfigManager.GetMimeTypeForExt(ConfigManager.GetExtensionFromName(Files[index])); Extensions[index] = Path.GetExtension(Files[index]); } } else { Files = new string[] { Path.GetFileName(filename) }; AssetIds = new string[] { assetId }; MimeTypes = new string[] { ConfigManager.GetMimeTypeForExt(ConfigManager.GetExtensionFromName(filename)) }; Extensions = new string[] { Path.GetExtension(filename) }; } if (AppUI.UserId == 0) { throw (new Exception("Invalid User")); } lMultiType = GetAddMultiType(); string TaxonomyTreeIdList = ""; if ((Request.QueryString["taxoverride"] != null) && Convert.ToInt64(Request.QueryString["taxoverride"]) != 0) { TaxonomyTreeIdList = Request.QueryString["taxoverride"]; } if (Request.Form["taxonomyselectedtree"] != null) { TaxonomyTreeIdList = Request.Form["taxonomyselectedtree"]; if (TaxonomyTreeIdList.Trim().EndsWith(",")) { TaxonomyTreeIdList = TaxonomyTreeIdList.Substring(0, TaxonomyTreeIdList.Length - 1); } } cCont.Add(TaxonomyTreeIdList, "Taxonomy", null, null); asset_list = new Ektron.Cms.Common.AssetData[Files.Length - 1 + 1]; if ((actionType != "add") && (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0")) { cCont.Add(AssetIds[0], m_AssetInfoKeys[0], null, null); cCont.Add("", m_AssetInfoKeys[1], null, null); cCont.Add(Files[0], m_AssetInfoKeys[2], null, null); cCont.Add(MimeTypes[0], m_AssetInfoKeys[3], null, null); cCont.Add(Extensions[0], m_AssetInfoKeys[4], null, null); } else { if (Path.GetFileName(filename) != "" || Files.Length > 0) { for (i = 0; i <= Files.Length - 1; i++) { asset_list[i] = new Ektron.Cms.Common.AssetData(); asset_list[i].Id = AssetIds[i]; asset_list[i].FileName = Files[i]; if (ConfigManager.GetMimeTypeForExt(Path.GetExtension(filename)) == "") { asset_list[i].MimeType = ""; } else { asset_list[i].MimeType = MimeTypes[i]; } asset_list[i].FileExtension = Extensions[i]; asset_list[i].Type = lMultiType; asset_list[i].Language = ContentLanguage; } } cCont.Add(AssetIds, "AssetIds", null, null); } if (editaction == null) { editaction = "publish"; } cCont.Add(editaction, "Mode", null, null); if ((actionType == "add") || (Request.Form["content_id"] == "-1" || Request.Form["content_id"] == "0")) { cCont.Add(true, "BatchProcess", null, null); cCont.Add(asset_list, "AssetInfo", null, null); } cCont.Add(ContentLanguage, "ContentLanguage", null, null); cCont.Add(Request.Form["content_folder"], "FolderID", null, null); cCont.Add(Request.Form["mycollection"], "MyCollection", null, null); if (Request.Form["content_html"] == null) { cCont.Add("", "ContentHtml", null, null); } else { cCont.Add(Request.Form["content_html"], "ContentHtml", null, null); } if (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0") { if (Convert.ToInt32(Request.Form["content_type"]) == 104) { cCont.Add("", "MediaText", null, null); } if (Request.Form["content_type"] != null) { cCont.Add(Request.Form["content_type"], "ContentType", null, null); } else { cCont.Add(lMultiType, "ContentType", null, null); } } else { cCont.Add(Request.Form["content_type"], "ContentType", null, null); } if (Convert.ToInt32(Request.Form["content_type"]) == 104) { if (Request.Form["content_html"] != null) { if (Request.Form["content_html"] != "") { cCont.Remove("MediaText"); cCont.Add(Request.Form["content_html"].Replace("&", "&"), "MediaText", null, null); cCont.Remove("ContentHtml"); cCont.Add(Request.Form["content_html"], "ContentHtml", null, null); } else { if (EkFunctions.DoesKeyExist(cCont, "MediaText")) { cCont.Remove("MediaText"); } cCont.Add("", "MediaText", null, null); } } else { cCont.Remove("MediaText"); cCont.Add("", "MediaText", null, null); } } string strContentTitle = ""; if (!String.IsNullOrEmpty(Request.Form["content_title"])) { strContentTitle = Request.Form["content_title"]; } else if (contentCount == null) { strContentTitle = Path.GetFileName(Files[0]); } string strImage = ""; if (!String.IsNullOrEmpty(Request.Form["content_image"])) { strImage = Request.Form["content_image"]; } else { strImage = ""; } cCont.Add(strImage, "Image", null, null); cCont.Add(Request.Form["LockedContentLink"], "LockedContentLink", null, null); cCont.Add(strContentTitle, "ContentTitle", null, null); cCont.Add(Request.Form["content_comment"], "Comment", null, null); if (!String.IsNullOrEmpty(Request.Form["content_id"]) && Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0") { cCont.Add(Request.Form["content_id"], "ContentID", null, null); } else { cCont.Add(0, "ContentID", null, null); } if (!String.IsNullOrEmpty(Request.Form["frm_validcounter"])) { MetaCount = System.Convert.ToInt32(Request.Form["frm_validcounter"]); for (i = 1; i <= MetaCount; i++) { acMetaInfo[1] = Request.Form["frm_meta_type_id_" + i]; if (Request.Form["content_id"] != "-1" && Request.Form["content_id"] != "0") { acMetaInfo[2] = Request.Form["content_id"]; } else { acMetaInfo[2] = ""; // adding content, so no content ID } acMetaInfo[3] = Request.Form["frm_text_" + i]; cMetadataTypes.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new string[4]; } } //Image Gallery metadata acMetaInfo = UpdateMetadataContent(); if (acMetaInfo != null) { cMetadataTypes.Add(acMetaInfo, System.Convert.ToString(cMetadataTypes.Count + 1), null, null); } cCont.Add(Request.Form["createtask"], "CreateTask", null, null); cCont.Add(Request.QueryString["addto"], "AddToCollectionType", null, null); if (!String.IsNullOrEmpty(Request.QueryString["mycollection"])) { cCont.Add(Request.QueryString["mycollection"], "MyCollection", null, null); } else if (!String.IsNullOrEmpty(Request.Form["mycollection"])) { cCont.Add(Request.Form["mycollection"], "MyCollection", null, null); } cCont.Add(cMetadataTypes, "ContentMetadata", null, null); if (!String.IsNullOrEmpty(Request.Form["ekImagegalleryDescription"])) { cCont.Add(Request.Form["ekImagegalleryDescription"], "ContentTeaser", null, null); } else { if (Request.Form["content_teaser"] != null) { cCont.Add(Request.Form["content_teaser"], "ContentTeaser", null, null); } else { cCont.Add("", "ContentTeaser", null, null); } } while (Strings.Len(Request.Form["searchtext" + iContLoop]) > 0) { strSearchText = strSearchText + Request.Form["searchtext" + iContLoop]; iContLoop = System.Convert.ToInt32(iContLoop + 1); } cCont.Add(strSearchText, "SearchText", null, null); if (Request.Form["go_live"] != "") { try { go_live = DateTime.Parse(Strings.Trim(Request.Form["go_live"])).ToString(); } catch (Exception) { // ignore exceptions } } if (Request.Form["end_date"] != "") { try { end_date = DateTime.Parse(Strings.Trim(Request.Form["end_date"])).ToString(); } catch (Exception) { //ignore exceptions } end_date_action = Request.Form["end_date_action_radio"]; } cCont.Add(go_live, "GoLive", null, null); cCont.Add(end_date, "EndDate", null, null); cCont.Add(end_date_action, "EndDateAction", null, null); // dropupload should always add the quicklink if (!((Strings.Len(Request.Form["suppressnotification"])) > 0)) { sub_prop_data.BreakInheritance = true; if (!String.IsNullOrEmpty(Request.Form["send_notification_button"])) { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { sub_prop_data.SendNextNotification = false; } if (Request.Form["notify_option"] == ("Always")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always; } else if (Request.Form["notify_option"] == ("Initial")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial; if (!(actionType == "update")) // if new, then set flag to email out { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { if (!String.IsNullOrEmpty((Request.Form["send_notification_button"]))) { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { sub_prop_data.SendNextNotification = false; } } } else if (Request.Form["notify_option"] == ("Never")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never; } if (!String.IsNullOrEmpty(Request.Form["suspend_notification_button"])) { sub_prop_data.SuspendNextNotification = true; sub_prop_data.SendNextNotification = false; } else { sub_prop_data.SuspendNextNotification = false; } sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]); if (!String.IsNullOrEmpty(Request.Form["use_message_button"])) { sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]); } else { sub_prop_data.DefaultMessageID = 0; } if (!String.IsNullOrEmpty(Request.Form["use_summary_button"])) { sub_prop_data.SummaryID = 1; } else { sub_prop_data.SummaryID = 0; } if (!String.IsNullOrEmpty(Request.Form["use_content_button"])) { sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]); } else { sub_prop_data.ContentID = 0; } sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]); if (!String.IsNullOrEmpty(Request.Form["notify_url"])) { sub_prop_data.URL = Request.Form["notify_url"]; } else { sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"]; } if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions"); } else { sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions"); } if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.WebLocation = Request.Form["notify_weblocation"]; } else { sub_prop_data.WebLocation = "subscriptions"; } if (!String.IsNullOrEmpty(Request.Form["notify_subject"])) { sub_prop_data.Subject = Request.Form["notify_subject"]; } else { sub_prop_data.Subject = ""; } if (!String.IsNullOrEmpty(Request.Form["notify_emailfrom"])) { sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"]; } else { sub_prop_data.EmailFrom = ""; } sub_prop_data.UseContentTitle = ""; if (!String.IsNullOrEmpty(Request.Form["use_contentlink_button"])) { sub_prop_data.UseContentLink = 1; } else { sub_prop_data.UseContentLink = 0; } if (!String.IsNullOrEmpty(Request.Form["content_sub_assignments"])) { arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0); if (arrSubscriptions.Length > 0) { for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++) { page_sub_temp = new Collection(); page_sub_temp.Add(long.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null); page_subscription_data.Add(page_sub_temp, null, null, null); } } } else { page_subscription_data = null; } page_sub_temp = null; if (!((Request.Form["content_id"] != "-1") && (Request.Form["content_id"] != "0") && (actionType != "add"))) { if (!((contentCount == null) && (actionType != "multiple,add"))) { cCont.Add(sub_prop_data, "SubscriptionProperties", null, null); cCont.Add(page_subscription_data, "Subscriptions", null, null); } } } if ((Request.Form["AddQlink"] == "AddQlink") || (editaction == "")) { cCont.Add(true, "AddToQlink", null, null); } else { //in case Drag and drop AddQlink is nothing if (Request.Form["AddQlink"] == null) { cCont.Add(true, "AddToQlink", null, null); } else if (Request.Form["AddQlink"] == "") { cCont.Add(true, "AddToQlink", null, null); } else if (Request.Form["AddQlink"] == "1") { cCont.Add(true, "AddToQlink", null, null); } else { cCont.Add(false, "AddToQlink", null, null); } } if (Request.Form["IsSearchable"] == "IsSearchable") { cCont.Add(true, "IsSearchable", null, null); } else { //in case Drag and drop IsSearchable is nothing if (Request.Form["IsSearchable"] == null) { cCont.Add(false, "IsSearchable", null, null); } } if (Request.Form["templateSelect"] != "") { cCont.Add(Request.Form["templateSelect"], "MultiTemplateID", null, null); } long manualAliasId; manualAliasId = System.Convert.ToInt64(Request.Form["frm_manalias_id"]); m_prevManualAliasName = Request.Form["prev_frm_manalias_name"]; m_prevManualAliasExt = Request.Form["prev_frm_manalias_ext"]; m_currManualAliasName = Request.Form["frm_manalias"]; m_currManualAliasExt = Request.Form["frm_manaliasExt"]; cCont.Add(manualAliasId, "UrlAliasId", null, null); cCont.Add(m_currManualAliasName, "NewUrlAliasName", null, null); cCont.Add(m_currManualAliasExt, "NewUrlAliasExt", null, null); cCont.Add(m_prevManualAliasName, "OldUrlAliasName", null, null); cCont.Add(m_prevManualAliasExt, "OldUrlAliasExt", null, null); if (Request.Form["Method"] == "updatepublish") { m_refContent.CheckContentOutv2_0(Convert.ToInt64(Request.Form["ContentId"])); } cCont.Add(fileChanged, "FileChanged", null, null); if ((Request.Form["content_id"] != "-1") && (Request.Form["content_id"] != "0") && (actionType != "add") && Request.Form["translate"] != "true") { intContentId = Convert.ToInt64(Request.Form["content_id"]); try { m_refContent.CheckContentOutv2_0(intContentId); m_refContent.SaveContentv2_0(cCont); if (!((Request.Form["suppress_notification"]) != "")) { m_refContent.UpdateSubscriptionPropertiesForContent(intContentId, sub_prop_data); m_refContent.UpdateSubscriptionsForContent(intContentId, page_subscription_data); } // process tag info ProcessTags(intContentId, ContentLanguage); if (editaction == "checkin") { m_refContent.CheckIn(intContentId, ""); } if (editaction == "publish") { m_refContent.CheckIn(intContentId, ""); m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["FolderID"]), ""); } if (Request.Form["Toolbar"] == "True") { if (cCont["AssetFilename"].ToString().IndexOf(".dot") > 1) { m_refContent.UpdateDocumentMetadata(cCont["AssetID"].ToString(), intContentId, -1, ""); } } if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true") { if (Request.QueryString["close"] == "true") { Response.Redirect("close.aspx?reload=true", false); } else { Response.Redirect("close.aspx", false); } } else { //if save was clicked redirect to edit screen else content.aspx if (editaction == "save") { string queryStr = ""; long taxonomyId; if ((Request.Form["TaxonomyOverrideId"] != null) && (long.TryParse(Request.Form["TaxonomyOverrideId"], out taxonomyId)) && (taxonomyId > 0)) { queryStr = (string)("&TaxonomyId=" + Request.Form["TaxonomyOverrideId"]); } if ((!(Request.QueryString["pullapproval"] == null)) && (Request.QueryString["pullapproval"].Length > 0)) { queryStr += (string)("&pullapproval=" + Request.QueryString["pullapproval"]); } Response.Redirect((string)("edit.aspx?close=false&LangType=" + ContentLanguage.ToString() + "&id=" + intContentId + "&type=update&back_file=content.aspx&back_action=View&back_folder_id=" + Request.Form["content_folder"] + "&back_id=" + intContentId + "&back_callerpage=content.aspx&back_origurl=action%3dViewContentByCategory%26id%3d" + Request.Form["content_folder"] + "&back_LangType=" + ContentLanguage + queryStr), false); } else { Response.Redirect((string)("content.aspx?id=" + Request.Form["content_id"] + "&action=viewstaged&LangType=" + ContentLanguage), false); } } } catch (Exception ex) { Utilities.ShowError(ex.Message); } } else { if (((contentCount == null) && (actionType != "multiple,add")) || Request.Form["translate"] == "true") { try { if (Request.Form["Method"] == "copy") { cCont.Add(true, "DontCreateAsset", null, null); cCont.Remove("ContentID"); cCont.Add(Request.Form["ContentId"], "ContentID", null, null); } AddMultiResult = m_refContent.AddMultiContent(cCont); intContentId = AddMultiResult[0].ContentId; //m_refContent.AddNewContentv2_0(cCont); if (!((Request.Form["suppress_notification"]) != "")) { m_refContent.UpdateSubscriptionPropertiesForContent(intContentId, sub_prop_data); m_refContent.UpdateSubscriptionsForContent(intContentId, page_subscription_data); } // process tag info ProcessTags(intContentId, ContentLanguage); /* if (editaction == "checkin") { m_refContent.CheckIn(intContentId, ""); } if (editaction == "publish") { m_refContent.CheckIn(intContentId, ""); m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["FolderID"]), ""); }*/ if (Request.Form["Toolbar"] == "True") { if (cCont["AssetFilename"].ToString().IndexOf(".dot") > 1) { m_refContent.UpdateDocumentMetadata(cCont["AssetID"].ToString(), intContentId, -1, ""); } } } catch (Exception ex) { Utilities.ShowError(ex.Message); } if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true") { if (Request.QueryString["close"] == "true") { Response.Redirect("close.aspx?reload=true", false); } else { Response.Redirect("close.aspx", false); } } else { Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false); } } else { bool isUrlAliasRequired = false; FolderData fdTmp = this.m_refContApi.EkContentRef.GetFolderById(long.Parse(Request.Form["content_folder"])); searc = fdTmp.IscontentSearchable; Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi(); if (m_urlAliasSettings.IsManualAliasEnabled) { if (fdTmp.AliasRequired) { isUrlAliasRequired = true; } } AddMultiResult = m_refContent.AddMultiContent(cCont); for (i = 0; i <= AddMultiResult.Length - 1; i++) { if (AddMultiResult[i].ErrorMessage != null && AddMultiResult[i].ErrorMessage.Length > 0) { //make sure an error code is returned if there is an error message! result.Append(AddMultiResult[i].ErrorMessage); Utilities.ShowError(result.ToString()); return; } else { ContentData cdTmp = this.m_refContent.GetContentById(AddMultiResult[i].ContentId); //------------ContentSearchable---------------------- if(Request.UrlReferrer.Segments.Count(x=>x.ToLower()=="edit.aspx")==0) // run the next line only if the url is not coming from edit.aspx IsContentSearchableSection(AddMultiResult[i].ContentId); //--------------ContentSearchable End------------- bool isImage = ConfigManager.IsImageAsset(cdTmp.AssetData.FileExtension); if (!isImage && isUrlAliasRequired && ( isCallerDmsDragDropCtl || Request.Form["FromMenuMultiDMS"]!=null) ) { if (cdTmp.Status == "A")//only need to process published content { m_refContent.CheckContentOutv2_0(AddMultiResult[i].ContentId); m_refContent.CheckIn(AddMultiResult[i].ContentId, ""); } } if (Request.Form["Toolbar"] == "True") { if (Files[i].IndexOf(".dot") > 1) { m_refContent.UpdateDocumentMetadata(AssetIds[i], System.Convert.ToInt64(cCont["FolderID"]), -1, AddMultiResult[i].AssetVersion); } } // process tag info ProcessTags(AddMultiResult[i].ContentId, ContentLanguage); } } //If some invalid file types did not get uploaded if ((actionType == "multiple,add") && (isCallerDmsDragDropCtl == false) && (Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"] != null) && (Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString().Length > 0)) { if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true") { if (Request.QueryString["close"] == "true") { Response.Redirect("close.aspx?reload=true", false); } else { Response.Redirect("close.aspx", false); } } else { Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false); } } else { if (isCallerDmsDragDropCtl == true && Request.Form["requireMetaTaxonomy"].ToString().ToLower() == "true") { string _taxString = string.Empty; string _idString = string.Empty; string _contentId = string.Empty; foreach (Ektron.Cms.Common.ContentResponseData multiData in AddMultiResult) { if (_idString.Length == 0) { _contentId = multiData.ContentId.ToString(); } _idString += multiData.ContentId + ","; } Boolean metadataOrTaxonomyRequired = false; if (!string.IsNullOrEmpty(Request.Form["requireMetaTaxonomy"]) && Request.Form["requireMetaTaxonomy"].ToLower().ToString() == "true") { metadataOrTaxonomyRequired = true; } if (metadataOrTaxonomyRequired) { if ((Request.Form["taxonomyselectedtree"] != null) && Request.Form["taxonomyselectedtree"].ToString().Length > 1) { _taxString = (string)("&taxonomyId=" + Request.Form["taxonomyselectedtree"].ToString()); } Response.Redirect((string)("DMSMetadata.aspx?contentId=" + _contentId + "&idString=" + _idString + "&close=true&displayUrlAlias=false&folderId=" + Request.Form["content_folder"] + _taxString), false); } } if (AddMultiResult != null && AddMultiResult.Length == 1) { if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true") { if (Request.QueryString["close"] == "true") { Response.Redirect("close.aspx?reload=true", false); } else { Response.Redirect("close.aspx", false); } } else { //if save was clicked redirect to edit screen else content.aspx if (editaction == "save") { string queryStr = ""; long taxonomyId; if ((Request.Form["TaxonomyOverrideId"] != null) && (long.TryParse(Request.Form["TaxonomyOverrideId"], out taxonomyId)) && (taxonomyId > 0)) { queryStr = (string)("&TaxonomyId=" + Request.Form["TaxonomyOverrideId"]); } if ((!(Request.QueryString["pullapproval"] == null)) && (Request.QueryString["pullapproval"].Length > 0)) { queryStr += (string)("&pullapproval=" + Request.QueryString["pullapproval"]); } Response.Redirect((string)("edit.aspx?close=false&LangType=" + ContentLanguage.ToString() + "&id=" + AddMultiResult[0].ContentId + "&type=update&back_file=content.aspx&back_action=View&back_folder_id=" + Request.Form["content_folder"] + "&back_id=" + AddMultiResult[0].ContentId + "&back_callerpage=content.aspx&back_origurl=action%3dViewContentByCategory%26id%3d" + Request.Form["content_folder"] + "&back_LangType=" + ContentLanguage + queryStr), false); } else { //If coming from DragDropCtl.aspx, close thickbox if (isCallerDmsDragDropCtl == true) { //if any rejected files, display error message before closing thickbox if ((Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"] != null) && Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString() != "") { this.jsInvalidFiles.Text = m_refMsg.GetMessage("lbl error message for multiupload") + " " + Session[Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"].ToString().Replace("\\", "\\\\").Replace("\'", "\\\'"); this.jsInvalidFiles.Text += "\\n" + m_refMsg.GetMessage("js:cannot add file with add and plus"); this.uxAlertInvalidFileType.Visible = true; Session.Remove(Convert.ToString(userId) + Convert.ToString(loginToken) + "RejectedFiles"); } this.uxCloseThickBox.Visible = true; } else { Response.Redirect((string)("content.aspx?id=" + AddMultiResult[0].ContentId + "&action=viewstaged&LangType=" + ContentLanguage), false); } } } } else { if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true") { if (Request.QueryString["close"] == "true") { Response.Redirect("close.aspx?reload=true", false); } else { Response.Redirect("close.aspx", false); } } else { if (isCallerDmsDragDropCtl == true) { this.uxCloseThickBox.Visible = true; } else { Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + ContentLanguage), false); } } } } } } }
private void DisplaySubscriptionInfo() { string strEnabled = " "; int i = 0; int findindex; Array arrSubscribed; string strNotifyA = ""; string strNotifyI = ""; string strNotifyN = ""; string strNotifyBase = ""; long intInheritFrom; EmailFromData[] emailfrom_list; int y = 0; EmailMessageData[] optout_list; EmailMessageData[] defaultmessage_list; EmailMessageData[] unsubscribe_list; SettingsData settings_list; SiteAPI m_refSiteAPI = new SiteAPI(); bool restoreAvailable = true; _SubscriptionDataList = _ContentApi.GetAllActiveSubscriptions(); //then get folder emailfrom_list = _ContentApi.GetAllEmailFrom(); optout_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OptOut); unsubscribe_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Unsubscribe); defaultmessage_list = _ContentApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.DefaultMessage); settings_list = m_refSiteAPI.GetSiteVariables(-1); lit_vf_subscription_properties.Text += Environment.NewLine + "<script type=\"text/javascript\">" + Environment.NewLine; lit_vf_subscription_properties.Text += "function SetMessageContenttoDefault() {" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'use_content_button\').checked = true;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'frm_content_id\').value = -1; " + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'titlename\').value = \'[[use current]]\'; " + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function PreviewWebAlert() {" + Environment.NewLine; lit_vf_subscription_properties.Text += " var contentid, defmsgid, optid, summaryid, unsubid, conttype, usecontlink;" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (document.getElementById(\'use_content_button\').checked == true) {;" + Environment.NewLine; lit_vf_subscription_properties.Text += " contentid = document.getElementById(\'frm_content_id\').value;" + Environment.NewLine; lit_vf_subscription_properties.Text += " } else {" + Environment.NewLine; lit_vf_subscription_properties.Text += " contentid = 0;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (document.getElementById(\'use_message_button\').checked == true) {;" + Environment.NewLine; lit_vf_subscription_properties.Text += " defmsgid = document.getElementById(\'notify_messageid\').value;" + Environment.NewLine; lit_vf_subscription_properties.Text += " } else {" + Environment.NewLine; lit_vf_subscription_properties.Text += " defmsgid = 0;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " optid = document.getElementById(\'notify_optoutid\').value;" + Environment.NewLine; lit_vf_subscription_properties.Text += " summaryid = document.getElementById(\'use_summary_button\').checked; " + Environment.NewLine; lit_vf_subscription_properties.Text += " unsubid = document.getElementById(\'notify_unsubscribeid\').value;" + Environment.NewLine; lit_vf_subscription_properties.Text += " conttype = 0;" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (document.getElementById(\'use_contentlink_button\').checked == true) {;" + Environment.NewLine; lit_vf_subscription_properties.Text += " usecontlink = 1;" + Environment.NewLine; lit_vf_subscription_properties.Text += " } else {" + Environment.NewLine; lit_vf_subscription_properties.Text += " usecontlink = 0;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " window.open(\'previewwebalert.aspx?content=-1&defmsg=\' + defmsgid + \'&optoutid=\' + optid + \'&summaryid=\' + summaryid + \'&usecontentid=\' + contentid + \'&unsubscribeid=\' + unsubid + \'&content_type=\' + conttype + \'&uselink=\' + usecontlink,\'\',\'menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes\'); " + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function CheckBaseNotifyValue(objValue){" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (objValue == document.getElementById(\'base_notify_option\').value)" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'web_alert_restore_inherit_checkbox\').checked = false;" + Environment.NewLine; lit_vf_subscription_properties.Text += " else" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'web_alert_restore_inherit_checkbox\').checked = true;" + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function breakWebAlertInheritance(obj){" + Environment.NewLine; lit_vf_subscription_properties.Text += " if(!obj.checked){" + Environment.NewLine; lit_vf_subscription_properties.Text += " if(confirm(\"" + _MessageHelper.GetMessage("js: confirm break inheritance") + "\")){" + Environment.NewLine; lit_vf_subscription_properties.Text += " enableSubCheckboxes(true);" + Environment.NewLine; lit_vf_subscription_properties.Text += " } else {" + Environment.NewLine; lit_vf_subscription_properties.Text += " obj.checked = !obj.checked;" + Environment.NewLine; lit_vf_subscription_properties.Text += " return false;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " } else {" + Environment.NewLine; lit_vf_subscription_properties.Text += " enableSubCheckboxes(true);" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function enableSubCheckboxes(enableFlag) {" + Environment.NewLine; lit_vf_subscription_properties.Text += " var idx, masterBtn, tableObj, qtyElements, displayUseContentBtns;" + Environment.NewLine; lit_vf_subscription_properties.Text += " tableObj = document.getElementById(\'therows\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " tableObj = tableObj.getElementsByTagName(\'input\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " masterBtn = document.getElementById(\'web_alert_inherit_checkbox\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (enableFlag && validateObject(masterBtn)){" + Environment.NewLine; lit_vf_subscription_properties.Text += " enableFlag = !masterBtn.checked;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " displayUseContentBtns = enableFlag ? \'inline\' : \'none\';" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (validateObject(tableObj)){" + Environment.NewLine; lit_vf_subscription_properties.Text += " qtyElements = tableObj.length;" + Environment.NewLine; lit_vf_subscription_properties.Text += " for(idx = 0; idx < qtyElements; idx++ ) {" + Environment.NewLine; lit_vf_subscription_properties.Text += " if (tableObj[idx].type == \'checkbox\'){" + Environment.NewLine; lit_vf_subscription_properties.Text += " tableObj[idx].disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.forms.frmContent.web_alert_restore_inherit_checkbox.checked = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.forms.frmContent.web_alert_restore_inherit_checkbox.disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.forms.frmContent.notify_option[0].disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.forms.frmContent.notify_option[1].disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.forms.frmContent.notify_option[2].disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'use_message_button\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'use_summary_button\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'use_content_button\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'use_contentlink_button\').disabled = !enableFlag;" + Environment.NewLine; //lit_vf_subscription_properties.Text += (" document.getElementById('notify_url').disabled = !enableFlag;" & Environment.NewLine) lit_vf_subscription_properties.Text += " document.getElementById(\'notify_emailfrom\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'notify_optoutid\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'notify_messageid\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'notify_unsubscribeid\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " document.getElementById(\'notify_subject\').disabled = !enableFlag;" + Environment.NewLine; lit_vf_subscription_properties.Text += " $ektron(\'.selectContent\').css(\'display\', displayUseContentBtns);" + Environment.NewLine; lit_vf_subscription_properties.Text += " $ektron(\'.useCurrent\').css(\'display\', displayUseContentBtns);" + Environment.NewLine; //lit_vf_subscription_properties.Text += (" document.getElementById('notify_weblocation').disabled = !enableFlag;" & Environment.NewLine) lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function validateObject(obj) {" + Environment.NewLine; lit_vf_subscription_properties.Text += " return ((obj != null) &&" + Environment.NewLine; lit_vf_subscription_properties.Text += " ((typeof(obj)).toLowerCase() != \'undefined\') &&" + Environment.NewLine; lit_vf_subscription_properties.Text += " ((typeof(obj)).toLowerCase() != \'null\'))" + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "function valAndSaveCSubAssignments() {" + Environment.NewLine; if ((!(_SubscriptionDataList == null)) && (!((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (settings_list.AsynchronousLocation == "")))) { lit_vf_subscription_properties.Text += " var idx, masterBtn, tableObj, enableFlag, qtyElements, retStr;" + Environment.NewLine; lit_vf_subscription_properties.Text += " var hidnFld = document.getElementById(\'content_sub_assignments\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " hidnFld.value=\'\';" + Environment.NewLine; lit_vf_subscription_properties.Text += " tableObj = tableObj = document.getElementById(\'therows\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " tableObj = tableObj.getElementsByTagName(\'input\');" + Environment.NewLine; lit_vf_subscription_properties.Text += " enableFlag = true;" + Environment.NewLine; lit_vf_subscription_properties.Text += " retStr = \'\';" + Environment.NewLine; lit_vf_subscription_properties.Text += " if ((validateObject(tableObj)) && enableFlag){" + Environment.NewLine; lit_vf_subscription_properties.Text += " qtyElements = tableObj.length;" + Environment.NewLine; lit_vf_subscription_properties.Text += " for(idx = 0; idx < qtyElements; idx++ ) {" + Environment.NewLine; lit_vf_subscription_properties.Text += " if ((tableObj[idx].type == \'checkbox\') && tableObj[idx].checked){" + Environment.NewLine; lit_vf_subscription_properties.Text += " retStr = retStr + tableObj[idx].name + \' \';" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " }" + Environment.NewLine; lit_vf_subscription_properties.Text += " hidnFld.value = retStr;" + Environment.NewLine; } lit_vf_subscription_properties.Text += " return true; // (Note: return false to prevent form submission)" + Environment.NewLine; lit_vf_subscription_properties.Text += "}" + Environment.NewLine; lit_vf_subscription_properties.Text += "</script>" + Environment.NewLine; if ((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (_SubscriptionDataList == null) || (settings_list.AsynchronousLocation == "")) { lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"suppress_notification\" value=\"true\"/>"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert not setup"); lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (emailfrom_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert emailfrom not setup") + "</font><br/>"; } if (defaultmessage_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert def msg not setup") + "</font><br/>"; } if (unsubscribe_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert unsub not setup") + "</font><br/>"; } if (optout_list == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("lbl web alert optout not setup") + "</font><br/>"; } if (_SubscriptionDataList == null) { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("alt No subscriptions are enabled on the folder.") + "</font><br/>"; } if (settings_list.AsynchronousLocation == "") { lit_vf_subscription_properties.Text += "<font class=\"ektronErrorText\">" + _MessageHelper.GetMessage("alt The location to the Asynchronous Data Processor is not specified.") + "</font>"; } return; } intInheritFrom = _ContentApi.GetFolderInheritedFrom(_Id); if (intInheritFrom != _Id) //do we get settings from self { _GlobalSubInherit = true; } else { _GlobalSubInherit = false; } _SubscribedDataList = _ContentApi.GetSubscriptionsForFolder(intInheritFrom); _SubscriptionPropertiesList = _ContentApi.GetSubscriptionPropertiesForFolder(intInheritFrom); if (_SubscriptionPropertiesList == null) { _SubscriptionPropertiesList = new SubscriptionPropertiesData(); } if (_GlobalSubInherit == true) { if (_Id == 0) { strEnabled = " "; } else { strEnabled = " disabled=\"disabled\" "; } } else { strEnabled = " "; } switch (_SubscriptionPropertiesList.NotificationType.GetHashCode()) { case 0: strNotifyA = " checked=\"checked\" "; strNotifyI = ""; strNotifyN = ""; strNotifyBase = "Always"; break; case 1: strNotifyA = ""; strNotifyI = " checked=\"checked\" "; strNotifyN = ""; strNotifyBase = "Initial"; break; case 2: strNotifyA = ""; strNotifyI = ""; strNotifyN = " checked=\"checked\" "; strNotifyBase = "Never"; break; } if (_Id == 0) // root folder or not inheriting { lit_vf_subscription_properties.Text += "<input id=\"web_alert_inherit_checkbox\" type=\"hidden\" name=\"web_alert_inherit_checkbox\" value=\"web_alert_inherit_checkbox\"/>"; } else if (!_GlobalSubInherit) { lit_vf_subscription_properties.Text += "<input id=\"web_alert_inherit_checkbox\" onclick=\"breakWebAlertInheritance(this);\" type=\"checkbox\" name=\"web_alert_inherit_checkbox\" value=\"web_alert_inherit_checkbox\"/>" + _MessageHelper.GetMessage("lbl inherit parent configuration") + ""; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; } else // non root { lit_vf_subscription_properties.Text += "<input id=\"web_alert_inherit_checkbox\" onclick=\"breakWebAlertInheritance(this);\" type=\"checkbox\" name=\"web_alert_inherit_checkbox\" value=\"web_alert_inherit_checkbox\" checked=\"checked\"/>" + _MessageHelper.GetMessage("lbl inherit parent configuration") + ""; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; restoreAvailable = false; } lit_vf_subscription_properties.Text += " <input id=\"web_alert_restore_inherit_checkbox\" type=\"checkbox\" name=\"web_alert_restore_inherit_checkbox\" value=\"web_alert_restore_inherit_checkbox\" " + (!restoreAvailable ? "disabled=\"disabled\"" : "") + "/>" + _MessageHelper.GetMessage("alt restore web alert") + ""; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; lit_vf_subscription_properties.Text += "<table class=\"ektronGrid\">"; lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert opt") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\"><input type=\"hidden\" id=\"base_notify_option\" name=\"base_notify_option\" value=\"" + strNotifyBase + "\"/>"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Always\" name=\"notify_option\" " + strNotifyA + " " + strEnabled + " onclick=\"CheckBaseNotifyValue(this.value);\" />" + _MessageHelper.GetMessage("lbl web alert notify always"); lit_vf_subscription_properties.Text += "<br />"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Initial\" name=\"notify_option\"" + strNotifyI + " " + strEnabled + " onclick=\"CheckBaseNotifyValue(this.value);\" />" + _MessageHelper.GetMessage("lbl web alert notify initial"); lit_vf_subscription_properties.Text += "<br />"; lit_vf_subscription_properties.Text += "<input type=\"radio\" value=\"Never\" name=\"notify_option\"" + strNotifyN + " " + strEnabled + " onclick=\"CheckBaseNotifyValue(this.value);\" />" + _MessageHelper.GetMessage("lbl web alert notify never"); lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert subject") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; if (_SubscriptionPropertiesList.Subject != "") { lit_vf_subscription_properties.Text += "<input type=\"text\" maxlength=\"255\" size=\"65\" value=\"" + _SubscriptionPropertiesList.Subject + "\" name=\"notify_subject\" id=\"notify_subject\" " + strEnabled + " onkeypress=\"return CheckKeyValue(event, \'34,13\');\"/>"; } else { lit_vf_subscription_properties.Text += "<input type=\"text\" maxlength=\"255\" size=\"65\" value=\"\" name=\"notify_subject\" id=\"notify_subject\" " + strEnabled + " onkeypress=\"return CheckKeyValue(event, \'34,13\');\"/>"; } lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; //lit_vf_subscription_properties.Text &= "Notification Base URL:" //If subscription_properties_list.URL <> "" Then // lit_vf_subscription_properties.Text &= "http://<input type=""text"" maxlength=""255"" size=""65"" name=""notify_url"" id=""notify_url"" " & strEnabled & " value=""" & subscription_properties_list.URL & """/>/<br /><br />" //Else // lit_vf_subscription_properties.Text &= "http://<input type=""text"" maxlength=""255"" size=""65"" name=""notify_url"" id=""notify_url"" " & strEnabled & " value=""" & Request.ServerVariables("HTTP_HOST") & """/>/<br /><br />" //End If lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert emailfrom address") + ":"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; lit_vf_subscription_properties.Text += "<select name=\"notify_emailfrom\" id=\"notify_emailfrom\" " + strEnabled + ">:"; if ((emailfrom_list != null) && emailfrom_list.Length > 0) { for (y = 0; y <= emailfrom_list.Length - 1; y++) { if (emailfrom_list[y].Email == _SubscriptionPropertiesList.EmailFrom) { lit_vf_subscription_properties.Text += "<option value=\"" + emailfrom_list[y].Email + "\" SELECTED>" + emailfrom_list[y].Email + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + emailfrom_list[y].Email + "\">" + emailfrom_list[y].Email + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; //lit_vf_subscription_properties.Text &= "Notification File Location:" //If subscription_properties_list.WebLocation <> "" Then //lit_vf_subscription_properties.Text &= m_refContentApi.SitePath & "<input type=""text"" maxlength=""255"" size=""65"" value=""" & subscription_properties_list.WebLocation & """ name=""notify_weblocation"" id=""notify_weblocation"" " & strEnabled & "/>/<br /><br />" //Else // lit_vf_subscription_properties.Text &= m_refContentApi.SitePath & "<input type=""text"" maxlength=""255"" size=""65"" value=""subscriptions"" name=""notify_weblocation"" " & strEnabled & "/>/<br /><br />" //End If lit_vf_subscription_properties.Text += "<tr>"; lit_vf_subscription_properties.Text += "<td class=\"label\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl web alert contents") + ":"; //lit_vf_subscription_properties.Text &= "<br />" lit_vf_subscription_properties.Text += "<img src=\"" + _ContentApi.AppPath + "images/UI/Icons/preview.png\" alt=\"Preview Web Alert Message\" title=\"Preview Web Alert Message\" onclick=\" PreviewWebAlert(); return false;\" />"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "<td class=\"value\">"; lit_vf_subscription_properties.Text += "<input id=\"use_optout_button\" type=\"checkbox\" checked=\"checked\" name=\"use_optout_button\" disabled=\"disabled\"/>" + _MessageHelper.GetMessage("lbl optout message") + " "; lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_optoutid\" id=\"notify_optoutid\">"; if ((optout_list != null) && optout_list.Length > 0) { for (y = 0; y <= optout_list.Length - 1; y++) { if (optout_list[y].Id == _SubscriptionPropertiesList.OptOutID) { lit_vf_subscription_properties.Text += "<option value=\"" + optout_list[y].Id + "\" SELECTED>" + optout_list[y].Title + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + optout_list[y].Id + "\">" + optout_list[y].Title + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (_SubscriptionPropertiesList.DefaultMessageID > 0) { lit_vf_subscription_properties.Text += ("<input id=\"use_message_button\" type=\"checkbox\" checked=\"checked\" name=\"use_message_button\" " + strEnabled + " />" + _MessageHelper.GetMessage("lbl use default message")) + " "; } else { lit_vf_subscription_properties.Text += ("<input id=\"use_message_button\" type=\"checkbox\" name=\"use_message_button\" " + strEnabled + " />" + _MessageHelper.GetMessage("lbl use default message")) + " "; } lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_messageid\" id=\"notify_messageid\">"; if ((defaultmessage_list != null) && defaultmessage_list.Length > 0) { for (y = 0; y <= defaultmessage_list.Length - 1; y++) { if (defaultmessage_list[y].Id == _SubscriptionPropertiesList.DefaultMessageID) { lit_vf_subscription_properties.Text += "<option value=\"" + defaultmessage_list[y].Id + "\" SELECTED>" + defaultmessage_list[y].Title + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + defaultmessage_list[y].Id + "\">" + defaultmessage_list[y].Title + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; if (_SubscriptionPropertiesList.SummaryID > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" checked=\"checked\" " + strEnabled + "/>" + _MessageHelper.GetMessage("lbl use summary message"); } else { lit_vf_subscription_properties.Text += "<input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" " + strEnabled + "/>" + _MessageHelper.GetMessage("lbl use summary message"); } lit_vf_subscription_properties.Text += "<br />"; if (_SubscriptionPropertiesList.ContentID == -1) { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"checked\" " + strEnabled + "/>" + _MessageHelper.GetMessage("lbl use content message") + " "; lit_vf_subscription_properties.Text += "<input type=\"text\" id=\"titlename\" name=\"titlename\" value=\"[[use current]]\" " + strEnabled + " size=\"65\" disabled=\"disabled\"/>"; lit_vf_subscription_properties.Text += "<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\" QuickLinkSelectBase(" + _Id.ToString() + ",\'frmContent\',\'titlename\',0,0,0,0) ;return false;\"/>" + _MessageHelper.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\" SetMessageContenttoDefault();return false;\">Use Current</a>"; lit_vf_subscription_properties.Text += " "; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" id=\"frm_content_id\" name=\"frm_content_id\" value=\"-1\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } else if (_SubscriptionPropertiesList.ContentID > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"checked\" " + strEnabled + "/>" + _MessageHelper.GetMessage("lbl use content message") + " "; lit_vf_subscription_properties.Text += "<input type=\"text\" id=\"titlename\" name=\"titlename\" value=\"" + _SubscriptionPropertiesList.UseContentTitle.ToString() + "\" " + strEnabled + " size=\"65\" disabled=\"disabled\"/>"; lit_vf_subscription_properties.Text += "<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\" QuickLinkSelectBase(" + _Id.ToString() + ",\'frmContent\',\'titlename\',0,0,0,0) ;return false;\">" + _MessageHelper.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\" SetMessageContenttoDefault();return false;\">Use Current</a>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" id=\"frm_content_id\" name=\"frm_content_id\" value=\"" + _SubscriptionPropertiesList.ContentID.ToString() + "\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } else { lit_vf_subscription_properties.Text += "<input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" " + strEnabled + "/>" + _MessageHelper.GetMessage("lbl use content message") + " "; lit_vf_subscription_properties.Text += "<input type=\"text\" id=\"titlename\" name=\"titlename\" onkeydown=\"return false\" value=\"\" " + strEnabled + " size=\"65\" disabled=\"disabled\"/>"; lit_vf_subscription_properties.Text += "<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\"QuickLinkSelectBase(" + _Id.ToString() + ",\'frmContent\',\'titlename\',0,0,0,0) ;return false;\">" + _MessageHelper.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\"SetMessageContenttoDefault();return false;\">Use Current</a>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" maxlength=\"20\" id=\"frm_content_id\" name=\"frm_content_id\" value=\"0\" />"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_content_langid\"/>"; lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"frm_qlink\"/>"; } lit_vf_subscription_properties.Text += "<br />"; if (_SubscriptionPropertiesList.UseContentLink > 0) { lit_vf_subscription_properties.Text += "<input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" checked=\"checked\" " + strEnabled + "/>Use Content Link"; } else { lit_vf_subscription_properties.Text += "<input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" " + strEnabled + "/>Use Content Link"; } lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; lit_vf_subscription_properties.Text += "<input id=\"use_unsubscribe_button\" type=\"checkbox\" checked=\"checked\" name=\"use_unsubscribe_button\" disabled=\"disabled\"/>" + _MessageHelper.GetMessage("lbl unsubscribe message") + " "; lit_vf_subscription_properties.Text += "<select " + strEnabled + " name=\"notify_unsubscribeid\" id=\"notify_unsubscribeid\">"; if ((unsubscribe_list != null) && unsubscribe_list.Length > 0) { for (y = 0; y <= unsubscribe_list.Length - 1; y++) { if (unsubscribe_list[y].Id == _SubscriptionPropertiesList.UnsubscribeID) { lit_vf_subscription_properties.Text += "<option value=\"" + unsubscribe_list[y].Id + "\" selected>" + unsubscribe_list[y].Title + "</option>"; } else { lit_vf_subscription_properties.Text += "<option value=\"" + unsubscribe_list[y].Id + "\">" + unsubscribe_list[y].Title + "</option>"; } } } lit_vf_subscription_properties.Text += "</select>"; lit_vf_subscription_properties.Text += "</td>"; lit_vf_subscription_properties.Text += "</tr>"; lit_vf_subscription_properties.Text += "</table>"; lit_vf_subscription_properties.Text += "<div class=\"ektronTopSpace\"></div>"; lit_vf_subscription_properties.Text += "<div class=\"ektronHeader\">"; lit_vf_subscription_properties.Text += _MessageHelper.GetMessage("lbl avail web alert"); lit_vf_subscription_properties.Text += "</div>"; if (!(_SubscriptionDataList == null)) { lit_vf_subscription_properties.Text += "<table class=\"ektronGrid\" id=\"cfld_subscription_assignment\" width=\"100%\">"; lit_vf_subscription_properties.Text += "<tbody id=\"therows\">"; lit_vf_subscription_properties.Text += "<tr class=\"title-header\">"; lit_vf_subscription_properties.Text += "<th width=\"50\">" + _MessageHelper.GetMessage("lbl assigned") + "</th>"; lit_vf_subscription_properties.Text += "<th>" + _MessageHelper.GetMessage("lbl name") + "</th>"; lit_vf_subscription_properties.Text += "</tr>"; if (!(_SubscribedDataList == null)) { arrSubscribed = Array.CreateInstance(typeof(long), _SubscribedDataList.Length); for (i = 0; i <= _SubscribedDataList.Length - 1; i++) { arrSubscribed.SetValue(_SubscribedDataList[i].Id, i); } if (arrSubscribed != null) { if (arrSubscribed.Length > 0) { Array.Sort(arrSubscribed); } } } else { arrSubscribed = null; } i = 0; for (i = 0; i <= _SubscriptionDataList.Length - 1; i++) { findindex = -1; if ((_SubscribedDataList != null) && (arrSubscribed != null)) { findindex = Array.BinarySearch(arrSubscribed, _SubscriptionDataList[i].Id); } lit_vf_subscription_properties.Text += "<tr>"; if (findindex < 0) { lit_vf_subscription_properties.Text += "<td class=\"center\" width=\"10%\"><input type=\"checkbox\" name=\"WebAlert_" + _SubscriptionDataList[i].Id + "\" id=\"WebAlert_" + _SubscriptionDataList[i].Id + "\" " + strEnabled + "/></td>"; } else { lit_vf_subscription_properties.Text += "<td class=\"center\" width=\"10%\"><input type=\"checkbox\" name=\"WebAlert_" + _SubscriptionDataList[i].Id + "\" id=\"WebAlert_" + _SubscriptionDataList[i].Id + "\" checked=\"checked\" " + strEnabled + "/></td>"; } lit_vf_subscription_properties.Text += "<td>" + _SubscriptionDataList[i].Name + "</td>"; lit_vf_subscription_properties.Text += "</tr>"; } lit_vf_subscription_properties.Text += "</tbody></table>"; } else { lit_vf_subscription_properties.Text += "Nothing available."; } lit_vf_subscription_properties.Text += "<input type=\"hidden\" name=\"content_sub_assignments\" id=\"content_sub_assignments\" value=\"\"/>"; }
private bool Process_DoAddFolder() { string tmpPath; Collection libSettings; string FolderPath; Ektron.Cms.Content.EkContent m_refContent; SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData(); Collection page_subscription_data = new Collection(); Collection page_sub_temp = new Collection(); Array arrSubscriptions; int isub = 0; List<string> siteAliasList = new List<string>(); string[] arSiteAliasList; Ektron.Cms.SiteAliasApi _refSiteAliasApi; m_refContent = _ContentApi.EkContentRef; _PageData = new Collection(); _PageData.Add(Request.Form["foldername"].Trim(".".ToCharArray()), "FolderName", null, null); _PageData.Add(Request.Form["folderdescription"], "FolderDescription", null, null); _PageData.Add(_Id, "ParentID", null, null); //pagedata.Add(Request.Form("ParentID"), "ParentID") if (string.IsNullOrEmpty(Request.Form["TemplateTypeBreak"])) { _PageData.Add(Request.Form["templatefilename"], "TemplateFileName", null, null); //Defect # 54021 - Add failed. Duplicate key value supplied. //string templateName = (string)(Request.Form["templatefilename"].Split("(".ToCharArray())[0].TrimEnd()); //TemplateData[] template_data; //template_data = _ContentApi.GetAllTemplates("TemplateFileName"); //int j = 0; //for (j = 0; j <= template_data.Length - 1; j++) //{ // if (!(Request.Form["tinput_" + template_data[j].Id] == null) && template_data[j].FileName == templateName) // { // _PageData.Add(template_data[i].SubType, "TemplateSubType", null, null); // } //} if (Request.Form["templatefilename"].Split("(".ToCharArray()).Length > 1) { _PageData.Add(EkEnumeration.TemplateSubType.Wireframes, "TemplateSubType", null, null); } else { _PageData.Add(EkEnumeration.TemplateSubType.Default, "TemplateSubType", null, null); } } else { _PageData.Add("", "TemplateFileName", null, null); } _PageData.Add(Request.Form["stylesheet"], "StyleSheet", null, null); if ((Request.Form["hdnInheritSitemap"] != null) && (Request.Form["hdnInheritSitemap"].ToString().ToLower() == "true")) { _PageData.Add(true, "SitemapPathInherit", null, null); } else { _PageData.Add(false, "SitemapPathInherit", null, null); } _PageData.Add(Utilities.DeserializeSitemapPath(Request.Form, this._ContentLanguage), "SitemapPath", null, null); Ektron.Cms.Library.EkLibrary objLib; objLib = _ContentApi.EkLibraryRef; libSettings = objLib.GetLibrarySettingsv2_0(); tmpPath = Convert.ToString(libSettings["ImageDirectory"]); _PageData.Add(Server.MapPath(tmpPath), "AbsImageDirectory", null, null); tmpPath = Convert.ToString(libSettings["FileDirectory"]); _PageData.Add(Server.MapPath(tmpPath), "AbsFileDirectory", null, null); if (Request.Form["webalert_inherit_button"] != null && Request.Form["webalert_inherit_button"].ToString().Length > 0) { sub_prop_data.BreakInheritance = false; } else { sub_prop_data.BreakInheritance = true; } if (Request.Form["notify_option"] != null) { if (Request.Form["notify_option"] == "Always") { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always; } else if (Request.Form["notify_option"] == "Initial") { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial; } else if (Request.Form["notify_option"] == "Never") { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never; } } sub_prop_data.SuspendNextNotification = false; sub_prop_data.SendNextNotification = false; sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]); if (Request.Form["use_message_button"] != null && Request.Form["use_message_button"].ToString().Length > 0) { sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]); } else { sub_prop_data.DefaultMessageID = 0; } if (Request.Form["use_summary_button"] != null && Request.Form["use_summary_button"].ToString().Length > 0) { sub_prop_data.SummaryID = 1; } else { sub_prop_data.SummaryID = 0; } if (Request.Form["use_content_button"] != null && Request.Form["use_content_button"].ToString().Length > 0) { sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]); } else { sub_prop_data.ContentID = 0; } sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]); if (Request.Form["notify_url"] != null && Request.Form["notify_url"] != "") { sub_prop_data.URL = Request.Form["notify_url"]; } else { sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"]; } if (Request.Form["notify_weblocation"] != null && Request.Form["notify_weblocation"] != "") { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } else { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } if (Request.Form["notify_weblocation"] != null && Request.Form["notify_weblocation"] != "") { sub_prop_data.WebLocation = Request.Form["notify_weblocation"]; } else { sub_prop_data.WebLocation = "subscriptions"; } if (Request.Form["notify_subject"] != null && Request.Form["notify_subject"] != "") { sub_prop_data.Subject = Request.Form["notify_subject"]; } else { sub_prop_data.Subject = ""; } if (Request.Form["notify_emailfrom"] != null && Request.Form["notify_emailfrom"] != "") { sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"]; } else { sub_prop_data.EmailFrom = ""; } sub_prop_data.UseContentTitle = ""; if (Request.Form["use_contentlink_button"] != null && Request.Form["use_contentlink_button"].ToString().Length > 0) { sub_prop_data.UseContentLink = 1; } else { sub_prop_data.UseContentLink = 0; } if (Request.Form["content_sub_assignments"] != null && Request.Form["content_sub_assignments"].ToString().Length > 0) { arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0); if (arrSubscriptions.Length > 0) { for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++) { page_sub_temp = new Collection(); page_sub_temp.Add(long.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null); page_subscription_data.Add(page_sub_temp, null, null, null); } } } else { page_subscription_data = null; } page_sub_temp = null; Utilities.AddLBpaths(_PageData); if (Request.Form["TypeBreak"] != null && Request.Form["TypeBreak"].ToString().ToLower() == "on") // old field name was frm_xmlinheritance in V7.x { _PageData.Add(true, "XmlInherited", null, null); } else { _PageData.Add(false, "XmlInherited", null, null); } _PageData.Add(Request.Form["xmlconfig"], "XmlConfiguration", null, null); bool isPublishedAsPdf = System.Convert.ToBoolean((Request.Form["publishAsPdf"] == "on") ? true : false); _PageData.Add(isPublishedAsPdf, "PublishPdfActive", null, null); _PageData.Add(false, "PublishHtmlActive", null, null); // handle dynamic replication properties if (Request.Form["EnableReplication"] != "" || Request.QueryString["type"] == "communityfolder") { _PageData.Add(Request.Form["EnableReplication"], "EnableReplication", null, null); } else { _PageData.Add(0, "EnableReplication", null, null); } if (string.IsNullOrEmpty(Request.Form["suppress_notification"])) { _PageData.Add(sub_prop_data, "SubscriptionProperties", null, null); _PageData.Add(page_subscription_data, "Subscriptions", null, null); } if (Request.Form["break_inherit_button"] != null && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { _PageData.Add(0, "break_inherit_button", null, null); //inherit button is checked => Metadata is inherited from parent. } else { _PageData.Add(1, "break_inherit_button", null, null); //break inheritance, do NOT inherit from parent } _PageData.Add(Request.Form["folder_cfld_assignments"], "folder_cfld_assignments", null, null); // add domain properties if they're there if ((Request.Form["IsDomainFolder"] != null && Request.Form["IsDomainFolder"] != "") && (Request.Form["DomainProduction"] != null && Request.Form["DomainProduction"] != "") && LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.MultiSite) && !LicenseManager.IsSiteLimitReached(_ContentApi.RequestInformationRef)) { _PageData.Add(true, "IsDomainFolder", null, null); string staging = Request.Form["DomainStaging"]; string production = Request.Form["DomainProduction"]; if (staging == null) { staging = ""; } if (staging.EndsWith("/")) { staging = staging.Substring(0, staging.Length - 1); } if (production.EndsWith("/")) { production = production.Substring(0, production.Length - 1); } if (staging == "") { staging = production; } _PageData.Add(staging, "DomainStaging", null, null); _PageData.Add(production, "DomainProduction", null, null); } else { _PageData.Add(false, "IsDomainFolder", null, null); } if (Request.Form["break_inherit_button"] != null && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritMetadata", null, null); //break inherit button is check. } else { _PageData.Add(0, "InheritMetadata", null, null); } _PageData.Add(Request.Form["inherit_meta_from"], "InheritMetadataFrom", null, null); if ((Request.QueryString["type"] != null) && (Request.QueryString["type"] == "communityfolder")) { _PageData.Add(true, "IsCommunityFolder", null, null); } if (Request.Form["TaxonomyTypeBreak"] != null && Request.Form["TaxonomyTypeBreak"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritTaxonomy", null, null); if (Request.Form["CategoryRequired"] != null && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(Request.Form[current_category_required.UniqueID], "CategoryRequired", null, null); } } else { _PageData.Add(0, "InheritTaxonomy", null, null); if ((Request.Form["CategoryRequired"] != null) && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(0, "CategoryRequired", null, null); } } string IdRequests = ""; if (Request.Form["taxlist"] != null && Request.Form["taxlist"] != "") { IdRequests = Request.Form["taxlist"]; } _PageData.Add(IdRequests, "TaxonomyList", null, null); if (Request.Form["chkInheritAliases"] != null && Request.Form["chkInheritAliases"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(Request.Form[current_alias_required.UniqueID], "AliasRequired", null, null); } } else { _PageData.Add(0, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(0, "AliasRequired", null, null); } } _PageData.Add(Request.Form[inherit_alias_from.UniqueID], "InheritAliasFrom", null, null); //-----------------IscontentSearchable----------------------- if (Request.Form["chkInheritIscontentSearchable"] != null && Request.Form["chkInheritIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(Request.Form[current_IscontentSearchable.UniqueID], "IscontentSearchable", null, null); } } else { _PageData.Add(0, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(0, "IscontentSearchable", null, null); } } _PageData.Add(Request.Form[inherit_IscontentSearchable_from.UniqueID], "IsContentSearchableInheritedFrom", null, null); //-----------------IsContentSearchable End------------------- //-------------------DisplaySettings-------------------- int totalTabs = 0; if (Request.Form["chkInheritIsDisplaySettings"] != null && Request.Form["chkInheritIsDisplaySettings"].ToString().ToLower() == "on") { _PageData.Add(1, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(Request.Form[current_IsDisplaySettings.UniqueID], "DisplaySettings", null, null); } } else { _PageData.Add(0, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on" )||( Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on" )|| (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(1, "DisplaySettings", null, null); } } _PageData.Add(Request.Form[inherit_IsDisplaySettings_from.UniqueID], "DisplaySettingsInheritedFrom", null, null); //-------------------DisplaySettingsEnd------------------ _PageData.Add(Request.Form[inherit_taxonomy_from.UniqueID], "InheritTaxonomyFrom", null, null); // Update - add flagging items: ProcessFlaggingPostBack(_PageData); if (m_refContent.DoesFolderExistsWithName((string)_PageData["FolderName"], (long)_PageData["ParentID"])) { ShowError(MessageHelper.GetMessage("com: subfolder already exists")); return false; } else { m_refContent.AddContentFolderv2_0(ref _PageData); } //_CustomFieldsApi.ProcessCustomFields(_PageData("FolderID")) FolderPath = m_refContent.GetFolderPath(Convert.ToInt64(_PageData["ParentID"])); if ((FolderPath.Substring(FolderPath.Length - 1, 1) == "\\")) { FolderPath = FolderPath.Substring(FolderPath.Length - (FolderPath.Length - 1)); } FolderPath = FolderPath.Replace("\\", "\\\\"); string close; close = Request.QueryString["close"]; if (close == "true") { Response.Redirect("close.aspx", false); } else if (Request.Form[frm_callingpage.UniqueID] == "cmsform.aspx") { Response.Redirect((string)("cmsform.aspx?LangType=" + _ContentLanguage + "&action=ViewAllFormsByFolderID&folder_id=" + _Id + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false); } else { Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewContentByCategory&id=" + _Id + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false); } // find the folder_id we just created now... _FolderId = _ContentApi.EkContentRef.GetFolderID((string)(_ContentApi.EkContentRef.GetFolderPath(Convert.ToInt64(_PageData["ParentID"])) + "\\" + Request.Form["foldername"].Trim(".".ToCharArray()))); if (_Type == "site") { arSiteAliasList = Request.Form["savedSiteAlias"].TrimStart(" ".ToCharArray()).TrimStart(",".ToCharArray()).Split(",".ToCharArray()); foreach (string aliasStr in arSiteAliasList) { if (aliasStr != string.Empty) { siteAliasList.Add(aliasStr); } } _refSiteAliasApi = new Ektron.Cms.SiteAliasApi(); _refSiteAliasApi.Save(_FolderId, siteAliasList); } return true; }
private void Process_DoAddCatalog() { string tmpPath; Collection libSettings; string FolderPath; Ektron.Cms.Content.EkContent m_refContent; SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData(); Collection page_subscription_data = new Collection(); Collection page_sub_temp = new Collection(); Array arrSubscriptions; int isub = 0; m_refContent = _ContentApi.EkContentRef; _PageData = new Collection(); _PageData.Add(true, "IsCatalog", null, null); _PageData.Add(Request.Form["foldername"].Trim(".".ToCharArray()), "FolderName", null, null); _PageData.Add(Request.Form["folderdescription"], "FolderDescription", null, null); _PageData.Add(_Id, "ParentID", null, null); //pagedata.Add(Request.Form("ParentID"), "ParentID") if (string.IsNullOrEmpty(Request.Form["TemplateTypeBreak"])) { _PageData.Add(Request.Form["templatefilename"], "TemplateFileName", null, null); } else { _PageData.Add("", "TemplateFileName", null, null); } _PageData.Add(Request.Form["stylesheet"], "StyleSheet", null, null); if ((Request.Form["hdnInheritSitemap"] != null) && (Request.Form["hdnInheritSitemap"].ToString().ToLower() == "true")) { _PageData.Add(true, "SitemapPathInherit", null, null); } else { _PageData.Add(false, "SitemapPathInherit", null, null); } _PageData.Add(Utilities.DeserializeSitemapPath(Request.Form, this._ContentLanguage), "SitemapPath", null, null); Ektron.Cms.Library.EkLibrary objLib; objLib = _ContentApi.EkLibraryRef; libSettings = objLib.GetLibrarySettingsv2_0(); tmpPath = Convert.ToString(libSettings["ImageDirectory"]); _PageData.Add(Server.MapPath(tmpPath), "AbsImageDirectory", null, null); tmpPath = Convert.ToString(libSettings["FileDirectory"]); _PageData.Add(Server.MapPath(tmpPath), "AbsFileDirectory", null, null); if (!string.IsNullOrEmpty(Request.Form["webalert_inherit_button"])) { sub_prop_data.BreakInheritance = false; } else { sub_prop_data.BreakInheritance = true; } if (Request.Form["notify_option"] == ("Always")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always; } else if (Request.Form["notify_option"] == ("Initial")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial; } else if (Request.Form["notify_option"] == ("Never")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never; } sub_prop_data.SuspendNextNotification = false; sub_prop_data.SendNextNotification = false; sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]); if (!string.IsNullOrEmpty(Request.Form["use_message_button"])) { sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]); } else { sub_prop_data.DefaultMessageID = 0; } if (!string.IsNullOrEmpty(Request.Form["use_summary_button"])) { sub_prop_data.SummaryID = 1; } else { sub_prop_data.SummaryID = 0; } if (!string.IsNullOrEmpty(Request.Form["use_content_button"])) { sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]); } else { sub_prop_data.ContentID = 0; } sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]); if (!string.IsNullOrEmpty(Request.Form["notify_url"])) { sub_prop_data.URL = Request.Form["notify_url"]; } else { sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"]; } if (!string.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } else { sub_prop_data.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions"); } if (!string.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.WebLocation = Request.Form["notify_weblocation"]; } else { sub_prop_data.WebLocation = "subscriptions"; } if (!string.IsNullOrEmpty(Request.Form["notify_subject"])) { sub_prop_data.Subject = Request.Form["notify_subject"]; } else { sub_prop_data.Subject = ""; } if (!string.IsNullOrEmpty(Request.Form["notify_emailfrom"])) { sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"]; } else { sub_prop_data.EmailFrom = ""; } sub_prop_data.UseContentTitle = ""; if (!string.IsNullOrEmpty(Request.Form["use_contentlink_button"])) { sub_prop_data.UseContentLink = 1; } else { sub_prop_data.UseContentLink = 0; } if (!string.IsNullOrEmpty(Request.Form["content_sub_assignments"])) { arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0); if (arrSubscriptions.Length > 0) { for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++) { page_sub_temp = new Collection(); page_sub_temp.Add(int.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null); page_subscription_data.Add(page_sub_temp, null, null, null); } } } else { page_subscription_data = null; } page_sub_temp = null; Utilities.AddLBpaths(_PageData); if (Strings.LCase(Request.Form["TypeBreak"]) == "on") { _PageData.Add(true, "XmlInherited", null, null); } else { _PageData.Add(false, "XmlInherited", null, null); } _PageData.Add(Request.Form["xmlconfig"], "XmlConfiguration", null, null); if (Request.Form["PublishActive"] != null) { if (Request.Form["PublishActive"] == "PublishPdfActive") { _PageData.Add(true, "PublishPdfActive", null, null); _PageData.Add(false, "PublishHtmlActive", null, null); //ElseIf (Request.Form("PublishActive") = "PublishHtmlActive") Then // pagedata.Add(False, "PublishPdfActive") // pagedata.Add(True, "PublishHtmlActive") } } else { _PageData.Add(false, "PublishPdfActive", null, null); _PageData.Add(false, "PublishHtmlActive", null, null); } // handle dynamic replication properties if (Request.Form["EnableReplication"] != null || Request.QueryString["type"] == "communityfolder") { _PageData.Add(Request.Form["EnableReplication"], "EnableReplication", null, null); } else { _PageData.Add(0, "EnableReplication", null, null); } if (string.IsNullOrEmpty(Request.Form["suppress_notification"])) { _PageData.Add(sub_prop_data, "SubscriptionProperties", null, null); _PageData.Add(page_subscription_data, "Subscriptions", null, null); } if ((Request.Form["break_inherit_button"] != null) && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { _PageData.Add(0, "break_inherit_button", null, null); //inherit button is checked => Metadata is inherited from parent. } else { _PageData.Add(1, "break_inherit_button", null, null); //break inheritance, do NOT inherit from parent } _PageData.Add(Request.Form["folder_cfld_assignments"], "folder_cfld_assignments", null, null); // add domain properties if they're there if ((!string.IsNullOrEmpty(Request.Form["IsDomainFolder"])) && (!string.IsNullOrEmpty(Request.Form["DomainProduction"]))) { _PageData.Add(true, "IsDomainFolder", null, null); string staging = Request.Form["DomainStaging"]; string production = Request.Form["DomainProduction"]; if (staging == null) { staging = ""; } if (staging.EndsWith("/")) { staging = staging.Substring(0, staging.Length - 1); } if (production.EndsWith("/")) { production = production.Substring(0, production.Length - 1); } if (staging == "") { staging = production; } _PageData.Add(staging, "DomainStaging", null, null); _PageData.Add(production, "DomainProduction", null, null); } else { _PageData.Add(false, "IsDomainFolder", null, null); } if ((Request.Form["break_inherit_button"] != null) && Request.Form["break_inherit_button"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritMetadata", null, null); //break inherit button is check. } else { _PageData.Add(0, "InheritMetadata", null, null); } _PageData.Add(Request.Form["inherit_meta_from"], "InheritMetadataFrom", null, null); if ((!(Request.QueryString["type"] == null)) && (Request.QueryString["type"] == "communityfolder")) { _PageData.Add(true, "IsCommunityFolder", null, null); _PageData.Remove("XmlInherited"); _PageData.Add(false, "XmlInherited", null, null); _PageData.Remove("XmlConfiguration"); _PageData.Add(null, "XmlConfiguration", null, null); } if ((Request.Form["TaxonomyTypeBreak"] != null) && Request.Form["TaxonomyTypeBreak"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritTaxonomy", null, null); if ((Request.Form["CategoryRequired"] != null) && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(Request.Form[current_category_required.UniqueID], "CategoryRequired", null, null); } } else { _PageData.Add(0, "InheritTaxonomy", null, null); if ((Request.Form["CategoryRequired"] != null) && Request.Form["CategoryRequired"].ToString().ToLower() == "on") { _PageData.Add(1, "CategoryRequired", null, null); } else { _PageData.Add(0, "CategoryRequired", null, null); } } string IdRequests = ""; if ((Request.Form["taxlist"] != null) && Request.Form["taxlist"] != null) { IdRequests = Request.Form["taxlist"]; } _PageData.Add(IdRequests, "TaxonomyList", null, null); _PageData.Add(Request.Form[inherit_taxonomy_from.UniqueID], "InheritTaxonomyFrom", null, null); //-------------------ContentSearchable------------ if (Request.Form["chkInheritIscontentSearchable"] != null && Request.Form["chkInheritIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(Request.Form[current_IscontentSearchable.UniqueID], "IscontentSearchable", null, null); } } else { _PageData.Add(0, "IsContentSearchableInherited", null, null); if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on") { _PageData.Add(1, "IscontentSearchable", null, null); } else { _PageData.Add(0, "IscontentSearchable", null, null); } } _PageData.Add(Request.Form[inherit_IscontentSearchable_from.UniqueID], "IsContentSearchableInheritedFrom", null, null); //-------------------ContentSearchableEnd------------------ //-------------------DisplaySettings-------------------- int totalTabs = 0; if (Request.Form["chkInheritIsDisplaySettings"] != null && Request.Form["chkInheritIsDisplaySettings"].ToString().ToLower() == "on") { _PageData.Add(1, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(Request.Form[current_IsDisplaySettings.UniqueID], "DisplaySettings", null, null); } } else { _PageData.Add(0, "IsDisplaySettingsInherited", null, null); if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")) { if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary; } if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData; } if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing; } if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule; } if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment; } if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates; } if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on") { totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy; } _PageData.Add(totalTabs, "DisplaySettings", null, null); } else { _PageData.Add(1, "DisplaySettings", null, null); } } _PageData.Add(Request.Form[inherit_IsDisplaySettings_from.UniqueID], "DisplaySettingsInheritedFrom", null, null); //-------------------DisplaySettingsEnd------------------ // Update - add flagging items: ProcessFlaggingPostBack(_PageData); if (Request.Form["chkInheritAliases"] != null && Request.Form["chkInheritAliases"].ToString().ToLower() == "on") { _PageData.Add(1, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(Request.Form[current_alias_required.UniqueID], "AliasRequired", null, null); } } else { _PageData.Add(0, "InheritAlias", null, null); if (Request.Form["chkForceAliasing"] != null && Request.Form["chkForceAliasing"].ToString().ToLower() == "on") { _PageData.Add(1, "AliasRequired", null, null); } else { _PageData.Add(0, "AliasRequired", null, null); } } _PageData.Add(Request.Form[inherit_alias_from.UniqueID], "InheritAliasFrom", null, null); m_refContent.AddContentFolderv2_0(ref _PageData); //_CustomFieldsApi.ProcessCustomFields(_PageData("FolderID")) FolderPath = m_refContent.GetFolderPath(Convert.ToInt64(_PageData["ParentID"])); if ((FolderPath.Substring(FolderPath.Length - 1, 1) == "\\")) { FolderPath = FolderPath.Substring(FolderPath.Length - (FolderPath.Length - 1)); } FolderPath = FolderPath.Replace("\\", "\\\\"); string close; close = Request.QueryString["close"]; if (close == "true") { Response.Redirect("close.aspx", false); } else if (Request.Form[frm_callingpage.UniqueID] == "cmsform.aspx") { Response.Redirect((string)("cmsform.aspx?LangType=" + _ContentLanguage + "&action=ViewAllFormsByFolderID&folder_id=" + _Id + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false); } else { Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewContentByCategory&id=" + _Id + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false); } // find the folder_id we just created now... _FolderId = _ContentApi.EkContentRef.GetFolderID((string)(_ContentApi.EkContentRef.GetFolderPath(Convert.ToInt64(_PageData["ParentID"])) + "\\" + Request.Form["foldername"].Trim(".".ToCharArray()))); }
private void Display_EditControls() { int intContentLanguage = 1033; PermissionData security_lib_data; int i = 0; bool bEphoxSupport = false; string aliasContentType = string.Empty; folder_data = null; try { netscape.Value = ""; language_data = m_refSiteApi.GetLanguageById(m_intContentLanguage); ImagePath = language_data.ImagePath; BrowserCode = language_data.BrowserCode; for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++) { asset_info.Add(Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i], ""); } Page.ClientScript.RegisterHiddenField("TaxonomyOverrideId", Convert.ToString(TaxonomyOverrideId)); if (IsMac && m_SelectedEditControl != "ContentDesigner" && m_strType == "update") { //We do not support XML content and Form. Check if the content is XML or form and if it is then don't proceed further. ContentData cData; cData = m_refContApi.GetContentById(m_intItemId, 0); if ((cData.Type == 2) || ((cData.XmlConfiguration != null) && (cData.XmlConfiguration.PackageXslt.Length > 0))) { bEphoxSupport = false; } else { bEphoxSupport = true; } if (!bEphoxSupport) { //Show not supported message throw (new Exception("Forms and XML Editing is not supported on MAC.")); } } if ((Request.QueryString["pullapproval"] == "true") && (m_strType == "update")) { ret = m_refContent.TakeOwnership(m_intItemId); } var2 = m_refContent.GetEditorVariablev2_0(m_intItemId, m_strType); //TODO:Verify info param via var1 removed security_data = m_refContApi.LoadPermissions(m_intItemId, "content", 0); endDateActionSel = GetEndDateActionStrings(); endDateActionSize = Convert.ToInt32(endDateActionSel["SelectionSize"]); if (security_data != null) { IsAdmin = security_data.IsAdmin; } active_subscription_list = m_refContApi.GetAllActiveSubscriptions(); settings_data = m_refSiteApi.GetSiteVariables(CurrentUserID); if (m_strType == "update") { content_edit_data = m_refContApi.GetContentForEditing(m_intItemId); UserRights = m_refContApi.LoadPermissions(m_intItemId, "content", ContentAPI.PermissionResultType.Content); lContentType = content_edit_data.Type; lContentSubType = content_edit_data.SubType; if (content_edit_data.Type == 2 || 4 == content_edit_data.Type) { bIsFormDesign = true; m_intContentType = 2; } if (!(content_edit_data == null)) { security_lib_data = m_refContApi.LoadPermissions(content_edit_data.FolderId, "folder", 0); UploadPrivs = security_lib_data.CanAddToFileLib || security_lib_data.CanAddToImageLib; m_strContentTitle = Server.HtmlDecode(content_edit_data.Title); m_strAssetFileName = content_edit_data.AssetData.FileName; m_strContentHtml = content_edit_data.Html; content_teaser = content_edit_data.Teaser; meta_data = content_edit_data.MetaData; content_comment = Server.HtmlDecode(content_edit_data.Comment); content_stylesheet = content_edit_data.StyleSheet; m_intContentFolder = content_edit_data.FolderId; m_intTaxFolderId = content_edit_data.FolderId; intContentLanguage = content_edit_data.LanguageId; go_live = content_edit_data.GoLive; end_date = content_edit_data.EndDate; end_date_action = content_edit_data.EndDateAction.ToString(); intInheritFrom = m_refContent.GetFolderInheritedFrom(m_intContentFolder); subscription_data_list = m_refContApi.GetSubscriptionsForFolder(intInheritFrom); subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForContent(m_refContentId); //first try content if (subscription_properties_list == null) { subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForFolder(intInheritFrom); //then get folder subscribed_data_list = subscription_data_list; } else //content is populated. { subscribed_data_list = m_refContApi.GetSubscriptionsForContent(m_refContentId); // get subs for folder } if (!(meta_data == null)) { MetaDataNumber = meta_data.Length; } PreviousState = content_edit_data.CurrentStatus; iMaxContLength = content_edit_data.MaxContentSize; iMaxSummLength = content_edit_data.MaxSummarySize; path = content_edit_data.Path; m_intManualAliasId = content_edit_data.ManualAliasId; folder_data = m_refContApi.GetFolderById(m_intContentFolder); if ((path.Substring(path.Length - 1, 1) == "\\")) { path = path.Substring(path.Length -(path.Length - 1)); } //Check to see if this belongs to XML configuration if (lContentType != 2) { xmlconfig_data = content_edit_data.XmlConfiguration; if (!(xmlconfig_data == null)) { editorPackage = xmlconfig_data.PackageXslt; MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + content_edit_data.XmlConfiguration.Id.ToString() + "\">"; if (editorPackage.Length > 0) { bVer4Editor = true; // this means that we will be using the new Package Design for the content } } } if (m_strContentTitle != "") { MetaComplete = UserRights.CanMetadataComplete; //Changed from 1 to true } asset_info["AssetID"] = content_edit_data.AssetData.Id; asset_info["AssetVersion"] = content_edit_data.AssetData.Version; asset_info["MimeType"] = content_edit_data.AssetData.MimeType; asset_info["FileExtension"] = content_edit_data.AssetData.FileExtension; } validTypes.Value = Convert.ToString(asset_info["FileExtension"]); } else { UserRights = m_refContApi.LoadPermissions(m_intItemId, "folder", ContentAPI.PermissionResultType.Folder); folder_data = m_refContApi.GetFolderById(m_intItemId); MetaComplete = UserRights.CanMetadataComplete; if (m_intXmlConfigId > -1) { xmlconfig_data = m_refContApi.GetXmlConfiguration(m_intXmlConfigId); MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + m_intXmlConfigId.ToString() + "\">"; } else { if ((folder_data.XmlConfiguration != null) && (folder_data.XmlConfiguration.Length > 0) && (Request.QueryString["AllowHTML"] != "1")) { xmlconfig_data = folder_data.XmlConfiguration[0]; } else { xmlconfig_data = null; } } if (!(xmlconfig_data == null)) { editorPackage = xmlconfig_data.PackageXslt; if (editorPackage.Length > 0) { bVer4Editor = true; } } content_stylesheet = m_refContApi.GetStyleSheetByFolderID(m_intItemId); security_lib_data = m_refContApi.LoadPermissions(m_intItemId, "folder", 0); UploadPrivs = security_lib_data.CanAddToFileLib || security_lib_data.CanAddToImageLib; string TmpId = Request.QueryString["content_id"]; if (!String.IsNullOrEmpty(TmpId)) { //translating asset if (Request.QueryString["type"] == "add") { if (!String.IsNullOrEmpty(Request.QueryString["back_LangType"])) { m_refContApi.ContentLanguage = Convert.ToInt32(Request.QueryString["back_LangType"]); } else { m_refContApi.ContentLanguage = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]); } } content_data = m_refContApi.GetContentById(Convert.ToInt64(TmpId), 0); if (content_data != null) { if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { isOfficeDoc.Value = "true"; } if (m_intXmlConfigId == -1) { if (content_data.XmlConfiguration != null) { m_intXmlConfigId = content_data.XmlConfiguration.Id; xmlconfig_data = content_data.XmlConfiguration; editorPackage = xmlconfig_data.PackageXslt; if (editorPackage.Length > 0) { bVer4Editor = true; } MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + m_intXmlConfigId.ToString() + "\">"; } } m_strContentTitle = Server.HtmlDecode(content_data.Title); m_strAssetFileName = content_data.AssetData.FileName; m_strContentHtml = content_data.Html; content_teaser = content_data.Teaser; content_comment = Server.HtmlDecode(content_data.Comment); go_live = content_data.GoLive; end_date = content_data.EndDate; end_date_action = content_data.EndDateAction.ToString(); lContentType = content_data.Type; lContentSubType = content_data.SubType; if (m_strType == "add") { if (Utilities.IsAssetType(lContentType)) { m_strContentTitle = Server.HtmlDecode(content_data.Title); validTypes.Value = content_data.AssetData.FileExtension; } } else { asset_info["AssetID"] = content_data.AssetData.Id; asset_info["AssetVersion"] = content_data.AssetData.Version; asset_info["AssetFilename"] = content_data.AssetData.FileName; asset_info["MimeType"] = content_data.AssetData.MimeType; asset_info["FileExtension"] = content_data.AssetData.FileExtension; asset_info["MimeName"] = content_data.AssetData.MimeName; asset_info["ImageUrl"] = content_data.AssetData.ImageUrl; if (Convert.ToString(asset_info["MimeType"]) == "application/x-shockwave-flash") { asset_info["MediaAsset"] = true; } else { asset_info["MediaAsset"] = false; } validTypes.Value = Convert.ToString(asset_info["FileExtension"]); //Next } } } else { //Adding new file List<string> fileTypeCol = new List<string>(DocumentManagerData.Instance.FileTypes.Split(",".ToCharArray())); string allTypes = ""; foreach (string type in fileTypeCol) { if (allTypes.Length > 0) { allTypes += (string)("," + type.Trim().Replace("*.", "")); } else { allTypes += type.Trim().Replace("*.", ""); } } validTypes.Value = allTypes; } m_intContentFolder = m_intItemId; intInheritFrom = m_refContent.GetFolderInheritedFrom(m_intContentFolder); subscription_data_list = m_refContApi.GetSubscriptionsForFolder(intInheritFrom); //AGofPA get subs for folder; set break inheritance flag false subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForFolder(intInheritFrom); //get folder properties subscribed_data_list = subscription_data_list; //get subs for folder intContentLanguage = m_intContentLanguage; m_refContApi.ContentLanguage = m_intContentLanguage; meta_data = m_refContApi.GetMetaDataTypes("id"); path = m_refContApi.GetPathByFolderID(m_intContentFolder); if ((path.Substring(path.Length - 1, 1) == "\\")) { path = path.Substring(path.Length - (path.Length - 1)); } iMaxContLength = int.Parse(settings_data.MaxContentSize); iMaxSummLength = int.Parse(settings_data.MaxSummarySize); } if (folder_data.FolderType == 1) { m_bIsBlog = true; blog_data = m_refContApi.BlogObject(folder_data); if (m_strType == "update") { blog_post_data = m_refContApi.GetBlogPostData(m_intItemId); } else if (m_strType == "add" && m_refContentId > 0) // add new lang { blog_post_data = m_refContApi.EkContentRef.GetBlogPostDataOnly(m_refContentId, back_LangType); } else { blog_post_data = m_refContApi.GetBlankBlogPostData(); } } if (xmlconfig_data != null) { Collection collXmlConfigData = (Collection)xmlconfig_data.LogicalPathComplete; if (bVer4Editor == false) //only do this if we are using the old method { urlxml = "?Edit_xslt="; if (xmlconfig_data.EditXslt.Length > 0) { urlxml = urlxml + EkFunctions.UrlEncode(Convert.ToString(collXmlConfigData["EditXslt"])); if (m_strContentHtml.Trim().Length == 0) { m_strContentHtml = "<root> </root>"; } } urlxml = urlxml + "&Save_xslt="; if (xmlconfig_data.SaveXslt.Length > 0) { save_xslt_file = Convert.ToString(collXmlConfigData["SaveXslt"]); urlxml = urlxml + EkFunctions.UrlEncode(save_xslt_file); } urlxml = urlxml + "&Schema="; if (xmlconfig_data.XmlSchema.Length > 0) { m_strSchemaFile = Convert.ToString(collXmlConfigData["XmlSchema"]); urlxml = urlxml + EkFunctions.UrlEncode(m_strSchemaFile); } xml_config = AppeWebPath + "cms_xmlconfig.aspx" + urlxml; if (xmlconfig_data.XmlAdvConfig.Length > 0) { xml_config = Convert.ToString(collXmlConfigData["XmlAdvConfig"] + urlxml); } m_strSchemaFile = Convert.ToString(collXmlConfigData["XmlSchema"]); m_strNamespaceFile = Convert.ToString(collXmlConfigData["XmlNameSpace"]); } } //DHTML RENDERING //ASSET CONFIG for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++) { AssetHidden.Text += "<input type=\"hidden\" name=\"asset_" + Strings.LCase(Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]) + "\" value=\"" + EkFunctions.HtmlEncode(asset_info[Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]].ToString()) + "\">"; } content_type.Value = Convert.ToString(lContentType); content_subtype.Value = Convert.ToString(lContentSubType); if (m_SelectedEditControl != "ContentDesigner") { jsEditorScripts.Text = Utilities.EditorScripts(var2, AppeWebPath, BrowserCode); } AutoNav.Text = path.Replace("\\", "\\\\"); invalidFormatMsg.Text = m_refMsg.GetMessage("js: invalid date format error msg"); invalidYearMsg.Text = m_refMsg.GetMessage("js: invalid year error msg"); invalidMonthMsg.Text = m_refMsg.GetMessage("js: invalid month error msg"); invalidDayMsg.Text = m_refMsg.GetMessage("js: invalid day error msg"); invalidTimeMsg.Text = m_refMsg.GetMessage("js: invalid time error msg"); if (MetaComplete) { ecmMetaComplete.Text = "1"; } else { ecmMetaComplete.Text = "0"; } ecmMonths.Text = ""; jsNullContent.Text = m_refMsg.GetMessage("null content warning msg"); jsEDWarning.Text = m_refMsg.GetMessage("js: earlier end date warning"); jsMetaCompleteWarning.Text = m_refMsg.GetMessage("js: alert cannot submit meta incomplete") + "\\n" + m_refMsg.GetMessage("js: alert save or checkin or complete meta"); jsSetActionFunction.Text = SetActionClientScript(folder_data.PublishHtmlActive, (xmlconfig_data != null && 1 == lContentType)); jsSitePath.Text = m_refContApi.SitePath; jsEditProLocale.Text = AppeWebPath + "locale" + AppLocaleString + "b.xml"; ValidateContentPanel.Text = " var errReason = 0;" + "\r\n"; ValidateContentPanel.Text += "var errReasonT = 0;" + "\r\n"; ValidateContentPanel.Text += "var errAccess = false;" + "\r\n"; ValidateContentPanel.Text += "var errMessage = \"\";" + "\r\n"; ValidateContentPanel.Text += "var sInvalidContent = \"Continue saving invalid document?\";" + "\r\n"; if (m_SelectedEditControl != "ContentDesigner") { ValidateContentPanel.Text += "if (eWebEditProMessages) {" + "\r\n"; ValidateContentPanel.Text += " sInvalidContent = eWebEditProMessages.invalidContent;" + "\r\n"; ValidateContentPanel.Text += "}" + "\r\n"; } ValidateContentPanel.Text += "var errContent = \"" + m_refMsg.GetMessage("js: alert invalid data") + "\";" + "\r\n"; ValidateContentPanel.Text += "var objValidateInstance = null;" + "\r\n"; if (m_SelectedEditControl != "ContentDesigner") { ValidateContentPanel.Text += "objValidateInstance = eWebEditPro.instances[\"content_html\"];" + "\r\n"; ValidateContentPanel.Text += "if (objValidateInstance){" + "\r\n"; ValidateContentPanel.Text += " if (!eWebEditPro.instances[\"content_html\"].validateContent()) {" + "\r\n"; ValidateContentPanel.Text += " errReason = objValidateInstance.event.reason;" + "\r\n"; ValidateContentPanel.Text += " if (-1001 == errReason || -1002 == errReason || 1003 == errReason || -1003 == errReason) {" + "\r\n"; ValidateContentPanel.Text += " errAccess = true;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += "}" + "\r\n"; } else { ValidateContentPanel.Text += " if (\"object\" == typeof Ektron && Ektron.ContentDesigner && Ektron.ContentDesigner.instances) {" + "\r\n"; ValidateContentPanel.Text += " var objContentEditor = Ektron.ContentDesigner.instances[\"content_html\"];" + "\r\n"; ValidateContentPanel.Text += " if (objContentEditor && \"function\" == typeof objContentEditor.validateContent) {" + "\r\n"; ValidateContentPanel.Text += " errMessage = objContentEditor.validateContent();" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " if (errMessage != null && errMessage != \"\") {" + "\r\n"; ValidateContentPanel.Text += " if (\"object\" == typeof errMessage && \"undefined\" == typeof errMessage.code) {" + "\r\n"; ValidateContentPanel.Text += " alert(errMessage.join(\"\\n\\n\\n\"));" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else if (\"object\" == typeof errMessage && \"string\" == typeof errMessage.msg) {" + "\r\n"; ValidateContentPanel.Text += " errReason = errMessage.code;" + "\r\n"; ValidateContentPanel.Text += " errAccess = true;" + "\r\n"; ValidateContentPanel.Text += " alert(\"Content is invalid.\" + \"\\n\\n\" + errMessage.msg);" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else if (\"string\" == typeof errMessage && errMessage.length > 0) {" + "\r\n"; ValidateContentPanel.Text += " alert(errMessage);" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; } ValidateContentPanel.Text += "var objTeaserInstance = null;" + "\r\n"; if (m_SelectedEditControl != "ContentDesigner") { ValidateContentPanel.Text += "objTeaserInstance = eWebEditPro.instances[\"content_teaser\"];" + "\r\n"; ValidateContentPanel.Text += "if (objTeaserInstance){" + "\r\n"; ValidateContentPanel.Text += " if (!objTeaserInstance.validateContent()) {" + "\r\n"; ValidateContentPanel.Text += " errReasonT = objTeaserInstance.event.reason;" + "\r\n"; ValidateContentPanel.Text += " if (-1001 == errReasonT || -1002 == errReasonT || 1003 == errReasonT || -1003 == errReasonT) {" + "\r\n"; ValidateContentPanel.Text += " errAccess = true;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += "}" + "\r\n"; } else { ValidateContentPanel.Text += " if (\"object\" == typeof Ektron && Ektron.ContentDesigner && Ektron.ContentDesigner.instances && (\"\" == errMessage || null == errMessage)) {" + "\r\n"; ValidateContentPanel.Text += " var teaserName = \"content_teaser\";" + "\r\n"; ValidateContentPanel.Text += " if (document.forms[0].response) {" + "\r\n"; ValidateContentPanel.Text += " var iTeaser = 0;" + "\r\n"; ValidateContentPanel.Text += " for (var i = 0; i < document.forms[0].response.length; i++) {" + "\r\n"; ValidateContentPanel.Text += " if (document.forms[0].response[i].checked) {" + "\r\n"; ValidateContentPanel.Text += " iTeaser = i;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " switch (iTeaser) {" + "\r\n"; ValidateContentPanel.Text += " case 2: " + "\r\n"; ValidateContentPanel.Text += " teaserName = \"forms_transfer\";" + "\r\n"; ValidateContentPanel.Text += " break;" + "\r\n"; ValidateContentPanel.Text += " case 1:" + "\r\n"; ValidateContentPanel.Text += " teaserName = \"forms_redirect\";" + "\r\n"; ValidateContentPanel.Text += " break;" + "\r\n"; ValidateContentPanel.Text += " case 0:" + "\r\n"; ValidateContentPanel.Text += " default:" + "\r\n"; ValidateContentPanel.Text += " teaserName = \"content_teaser\";" + "\r\n"; ValidateContentPanel.Text += " break;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " var objTeaserEditor = Ektron.ContentDesigner.instances[teaserName];" + "\r\n"; ValidateContentPanel.Text += " if (objTeaserEditor && \"function\" == typeof objTeaserEditor.validateContent){" + "\r\n"; ValidateContentPanel.Text += " errMessage = objTeaserEditor.validateContent();" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " if (errMessage != null && errMessage != \"\") {" + "\r\n"; ValidateContentPanel.Text += " if (\"object\" == typeof errMessage && \"undefined\" == typeof errMessage.code) {" + "\r\n"; ValidateContentPanel.Text += " alert(errMessage.join(\"\\n\\n\\n\"));" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else if (\"object\" == typeof errMessage && \"string\" == typeof errMessage.msg) {" + "\r\n"; ValidateContentPanel.Text += " errReason = errMessage.code;" + "\r\n"; ValidateContentPanel.Text += " errAccess = true;" + "\r\n"; ValidateContentPanel.Text += " alert(\"Content is invalid.\" + \"\\n\\n\" + errMessage.msg);" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else if (\"string\" == typeof errMessage && errMessage.length > 0) {" + "\r\n"; ValidateContentPanel.Text += " alert(errMessage);" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; } ValidateContentPanel.Text += "if (errReason != 0 || errReasonT != 0) {" + "\r\n"; ValidateContentPanel.Text += " if (errReasonT != 0 && typeof objTeaserInstance != \"undefined\" && objTeaserInstance) {" + "\r\n"; ValidateContentPanel.Text += " errMessage = objTeaserInstance.event.message + \"\";" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " if (errReason != 0 && typeof objValidateInstance != \"undefined\" && objValidateInstance) {" + "\r\n"; ValidateContentPanel.Text += " errMessage = objValidateInstance.event.message + \"\";" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " if (false == errAccess) {" + "\r\n"; ValidateContentPanel.Text += " alert(errContent + \"\\n\" + errMessage);" + "\r\n"; ValidateContentPanel.Text += " $ektron(document).trigger(\"wizardPanelShown\");" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else {" + "\r\n"; if ("2" == settings_data.Accessibility) { ValidateContentPanel.Text += " if (typeof Button != \"undefined\") {" + "\r\n"; ValidateContentPanel.Text += " if (\"publish\" == Button.toLowerCase() || \"submit\" == Button.toLowerCase()) {" + "\r\n"; ValidateContentPanel.Text += " alert(errContent);" + "\r\n"; ValidateContentPanel.Text += " $ektron(document).trigger(\"wizardPanelShown\");" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " else { " + "\r\n"; ValidateContentPanel.Text += " if (confirm(errContent + \"\\n\" + sInvalidContent)) {" + "\r\n"; ValidateContentPanel.Text += " return true;" + "\r\n"; ValidateContentPanel.Text += " } " + "\r\n"; ValidateContentPanel.Text += " else {" + "\r\n"; ValidateContentPanel.Text += " $ektron(document).trigger(\"wizardPanelShown\");" + "\r\n"; ValidateContentPanel.Text += " return false;" + "\r\n"; ValidateContentPanel.Text += " } " + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += " }" + "\r\n"; } else if ("1" == settings_data.Accessibility) { ValidateContentPanel.Text += " if (confirm(errContent + \"\\n\" + sInvalidContent)) {" + "\r\n"; ValidateContentPanel.Text += " return true;" + "\r\n"; ValidateContentPanel.Text += " } " + "\r\n"; ValidateContentPanel.Text += " else {$ektron(document).trigger(\"wizardPanelShown\"); return false;} " + "\r\n"; } ValidateContentPanel.Text += " }" + "\r\n"; ValidateContentPanel.Text += "}" + "\r\n"; //Change the action page FormAction = (string)("edit.aspx?close=" + Request.QueryString["close"] + "&LangType=" + m_intContentLanguage + "&content_id=" + m_refContentId + (this.TaxonomyOverrideId > 0 ? ("&TaxonomyId=" + this.TaxonomyOverrideId.ToString()) : "") + (this.TaxonomySelectId > 0 ? ("&SelTaxonomyId=" + this.TaxonomySelectId.ToString()) : "") + "&back_file=" + back_file + "&back_action=" + back_action + "&back_folder_id=" + back_folder_id + "&back_id=" + back_id + "&back_form_id=" + back_form_id + "&control=" + controlName + "&buttonid=" + buttonId.Value + "&back_LangType=" + back_LangType + back_callerpage + back_origurl); if (Request.QueryString["pullapproval"] != null) { FormAction += (string)("&pullapproval=" + Request.QueryString["pullapproval"]); } PostBackPage.Text = "<script>document.forms[0].action = \"" + FormAction + "\";"; if (Utilities.IsAssetType(lContentType)) { PostBackPage.Text += "document.forms[0].enctype = \"multipart/form-data\";"; } PostBackPage.Text += "</script>"; LoadingImg.Text = m_refMsg.GetMessage("one moment msg"); content_title.Value = Server.HtmlDecode(m_strContentTitle); if (content_title.Attributes["class"] == null) { content_title.Attributes.Add("class", ""); } if (lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) { content_title.Attributes["class"] = "masterlayout"; if (!(m_strType == "update")) { content_title.Disabled = true; } phAlias.Visible = false; EditAliasHtml.Visible = false; } else { content_title.Attributes.Remove("class"); } if (EnableMultilingual == 1) { lblLangName.Text = "[" + language_data.Name + "]"; } StringBuilder sbFolderBreadcrumb = new StringBuilder(); string strDisabled = ""; if (!(m_strType == "update")) { QLink_Search.Text = "<td nowrap=\"nowrap\" class=\"checkboxIsSearchable\" >"; QLink_Search.Text += "<input type=\"hidden\" name=\"AddQlink\" value=\"AddQlink\">"; if (Request.Cookies[DMSCookieName] != null && Request.Cookies[DMSCookieName].Value == "2010") { if (folder_data.IscontentSearchable) QLink_Search.Text += "<input type=\"hidden\" name=\"IsSearchable\" value=\"IsSearchable\">"; } else { if (security_data.IsAdmin) { if (folder_data.IscontentSearchable) QLink_Search.Text += "<input type=\"checkbox\" name=\"IsSearchable\" " + strDisabled + " checked value=\"IsSearchable\" >" + m_refMsg.GetMessage("lbl content searchable"); //m_refMsg.GetMessage("Content Searchable") else QLink_Search.Text += "<input type=\"checkbox\" name=\"IsSearchable\" " + strDisabled + " >" + m_refMsg.GetMessage("lbl content searchable"); //m_refMsg.GetMessage("Content Searchable") } else { //Need to inherit from parent. if (folder_data.IscontentSearchable) QLink_Search.Text += "<input type=\"hidden\" name=\"IsSearchable\" value=\"IsSearchable\">"; } } QLink_Search.Text += "</td>"; } else { TR_Properties.Visible = false; TR_Properties.Height = new Unit(0); } if (QLink_Search.Text != "") { QLink_Search.Text = "<table><tr>" + QLink_Search.Text + "</tr></table>"; } content_id.Value = Convert.ToString(m_refContentId); eType.Value = m_strType; mycollection.Value = strMyCollection; addto.Value = strAddToCollectionType; content_folder.Value = Convert.ToString(m_intContentFolder); content_language.Value = Convert.ToString(intContentLanguage); maxcontentsize.Value = iMaxContLength.ToString(); if (bVer4Editor) { Ver4Editor.Value = "true"; } else { Ver4Editor.Value = "false"; } createtask.Value = Request.QueryString["dontcreatetask"]; EnumeratedHiddenFields.Text = HideVariables(); eWebEditProJS.Text = EditProJS(); if (m_intContentType == 2) { divContentText.Text = m_refMsg.GetMessage("form text"); divSummaryText.Text = m_refMsg.GetMessage("postback text"); } else { divContentText.Text = m_refMsg.GetMessage("content text"); divSummaryText.Text = m_refMsg.GetMessage("Summary text"); } phMetadata.Visible = true; if (this.Request.QueryString["type"] == "update") { aliasContentType = this.content_edit_data.ContType.ToString(); } if ((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias) && Request.QueryString["type"] != "multiple,add" && lContentSubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And Not (m_bIsBlog) { if ((content_edit_data != null) && (content_edit_data.AssetData != null) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_edit_data.AssetData.FileExtension))) { phAlias.Visible = false; EditAliasHtml.Visible = false; } else { phAlias.Visible = true; EditAliasHtml.Visible = true; } } EditContentHtmlScripts(); EditSummaryHtmlScripts(); EditMetadataHtmlScripts(); EditAliasHtmlScripts(); EditScheduleHtmlScripts(); EditCommentHtmlScripts(); EditSubscriptionHtmlScripts(); EditSelectedTemplate(); EditTaxonomyScript(); if (eWebEditProPromptOnUnload == 1) { jsActionOnUnload.Text = "eWebEditPro.actionOnUnload = EWEP_ONUNLOAD_PROMPT;"; } if (Convert.ToString(m_intContentFolder) != "") { defaultFolderId.Text = m_intContentFolder.ToString(); } else { defaultFolderId.Text = "0"; } //Summary_Meta_win if (!String.IsNullOrEmpty(Request.QueryString["summary"])) { Summary_Meta_Win.Text = "<script language=\"JavaScript1.2\">"; Summary_Meta_Win.Text += "PopUpWindow(\'editsummaryarea.aspx?id=" + m_intItemId + "&LangType=" + m_intContentLanguage + "&editor=true\',\'Summary\',790,580,1,1);"; Summary_Meta_Win.Text += "</script>"; } if (!String.IsNullOrEmpty(Request.QueryString["meta"])) { Summary_Meta_Win.Text += "<script language=\"JavaScript1.2\">"; if (MetaDataNumber > 0) { Summary_Meta_Win.Text += "PopUpWindow(\'editmeta_dataarea.aspx?id=" + m_intItemId + "&LangType=" + m_intContentLanguage + "&editor=true\',\'Metadata\',790,580,1,1);"; } else { Summary_Meta_Win.Text += "alert(\'No metadata defined\'); "; } Summary_Meta_Win.Text += "</script>"; } //TAXONOMY DATA if (IsAdmin || m_refContApi.EkUserRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator), CurrentUserID, false)) { TaxonomyRoleExists = true; } TaxonomyBaseData[] taxonomy_cat_arr = null; if (m_strType != "add" && m_strType != "multiple" && (!(m_strType.IndexOf("add", System.StringComparison.InvariantCultureIgnoreCase) > 0 || m_strType.IndexOf("multiple", System.StringComparison.InvariantCultureIgnoreCase) > 0)) || (m_strType == "add" && m_refContentId > 0)) { int tmpLang = 1033; int originalLangID = 1033; if (m_strType == "add" && m_refContentId > 0) //New Language { if (!(Request.QueryString["con_lang_id"] == null) && Request.QueryString["con_lang_id"] != "") { originalLangID = Convert.ToInt32(Request.QueryString["con_lang_id"]); } tmpLang = m_refContent.RequestInformation.ContentLanguage; //Backup the current langID m_refContent.RequestInformation.ContentLanguage = originalLangID; taxonomy_cat_arr = m_refContent.ReadAllAssignedCategory(m_refContentId); m_refContent.RequestInformation.ContentLanguage = tmpLang; } else { taxonomy_cat_arr = m_refContent.ReadAllAssignedCategory(m_intItemId); } if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0) { foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr) { if (taxonomy_cat.LanguageId == 0 || taxonomy_cat.LanguageId == m_refContent.RequestInformation.ContentLanguage) { if (taxonomyselectedtree.Value == "") { taxonomyselectedtree.Value = Convert.ToString(taxonomy_cat.Id); } else { taxonomyselectedtree.Value = taxonomyselectedtree.Value + "," + Convert.ToString(taxonomy_cat.Id); } } } } TaxonomyTreeIdList = (string)taxonomyselectedtree.Value; if (TaxonomyTreeIdList.Trim().Length > 0) { if (m_strType == "add" && m_refContentId > 0) //New Language { m_refContent.RequestInformation.ContentLanguage = originalLangID; //Backup the current LangID TaxonomyTreeParentIdList = m_refContent.ReadDisableNodeList(m_refContentId); m_refContent.RequestInformation.ContentLanguage = tmpLang; } else { TaxonomyTreeParentIdList = m_refContent.ReadDisableNodeList(m_intItemId); } } } else { if (TaxonomySelectId > 0) { taxonomyselectedtree.Value = TaxonomySelectId.ToString(); TaxonomyTreeIdList = (string)taxonomyselectedtree.Value; taxonomy_cat_arr = m_refContent.GetTaxonomyRecursiveToParent(TaxonomySelectId, m_refContent.RequestInformation.ContentLanguage, 0); if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0) { foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr) { if (TaxonomyTreeParentIdList == "") { TaxonomyTreeParentIdList = Convert.ToString(taxonomy_cat.Id); } else { TaxonomyTreeParentIdList = TaxonomyTreeParentIdList + "," + Convert.ToString(taxonomy_cat.Id); } } } } } TaxonomyRequest taxonomy_request = new TaxonomyRequest(); TaxonomyBaseData[] taxonomy_data_arr = null; Utilities.SetLanguage(m_refContApi); taxonomy_request.TaxonomyId = m_intContentFolder; taxonomy_request.TaxonomyLanguage = m_refContApi.ContentLanguage; taxonomy_data_arr = m_refContent.GetAllFolderTaxonomy(m_intContentFolder); bool HideCategoryTab = false; if (Request.QueryString["HideCategoryTab"] != null) { HideCategoryTab = Convert.ToBoolean(Request.QueryString["HideCategoryTab"]); } if (HideCategoryTab || (taxonomy_data_arr == null || taxonomy_data_arr.Length == 0) && (TaxonomyOverrideId == 0)) { if (!HideCategoryTab && folder_data != null && folder_data.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog) && TaxonomySelectId > 0 && m_intTaxFolderId == folder_data.Id && TaxonomyTreeIdList.Trim().Length > 0) { m_intTaxFolderId = 0; } else { phTaxonomy.Visible = false; EditTaxonomyHtml.Visible = false; DisplayTab = false; taxonomyselectedtree.Value = taxonomy_cat_arr != null && taxonomy_cat_arr.Length > 0 && (taxonomy_cat_arr[0].LanguageId == 0 | taxonomy_cat_arr[0].LanguageId == m_refContent.RequestInformation.ContentLanguage) ? taxonomyselectedtree.Value : ""; } } //CALL THE TOOLBAR if (folder_data == null) { LoadToolBar(""); } else { LoadToolBar(folder_data.Name); } if (lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { WebEventCont.Text = "true"; phContent.Visible = false; phEditContent.Visible = false; } //-------------------DisplayTabs Based on selected options from Folder properties---------------------------------- if (((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && folder_data.DisplaySettings != 0) { if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Summary) == (int)EkEnumeration.FolderTabDisplaySettings.Summary) { phEditSummary.Visible = true; } else { if (Request.QueryString["form_type"] == null && Request.QueryString["back_form_id"] == null && Request.QueryString["form_id"] == null && m_bIsBlog != true) { phEditSummary.Visible = false; phSummary.Visible = false; } } if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData) {if(phMetadata.Visible) phMetadata.Visible = true; } else { if (!metadataRequired) phMetadata.Visible = false; } if ((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias) && Request.QueryString["type"] != "multiple,add" && lContentSubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And Not (m_bIsBlog) { if (!((content_edit_data != null) && (content_edit_data.AssetData != null) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_edit_data.AssetData.FileExtension)))) { if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) { phAlias.Visible = true; } else { if (!folder_data.AliasRequired) phAlias.Visible = false; } } } if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Schedule) == (int)EkEnumeration.FolderTabDisplaySettings.Schedule) { PhSchedule.Visible = true; } else { PhSchedule.Visible = false; } if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Comment) == (int)EkEnumeration.FolderTabDisplaySettings.Comment) { PhComment.Visible = true; } else { PhComment.Visible = false; } if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Templates) == (int)EkEnumeration.FolderTabDisplaySettings.Templates) { phTemplates.Visible = true; } else { phTemplates.Visible = false; } if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) { if(phTaxonomy.Visible) phTaxonomy.Visible = true; } else { if (!folder_data.IsCategoryRequired) phTaxonomy.Visible = false; } } //-------------------DisplayTabs Based on selected options from Folder properties End------------------------------ } catch (Exception ex) { throw (new Exception(ex.Message)); } }
private void Process_FormSubmit() { object dontCreateTask; int i = 0; int y = 0; int isub = 0; int ValidCounter = 0; string go_live = ""; string end_date = ""; string end_date_action = ""; string strContent = ""; string strSearchText = ""; bool ret = false; string strTaskName = ""; bool isAlreadyCreated = false; SettingsData site_data; Collection page_subscription_data = new Collection(); Collection page_sub_temp = new Collection(); Array arrSubscriptions; SubscriptionPropertiesData sub_prop_data = new SubscriptionPropertiesData(); string strContentTeaser = ""; string strRptDisplay = ""; string strRpt = ""; bool bUpdateFormQuestions = false; bool bIsReportForm = false; bool bLockedContentLink = false; string strContentTitle = Request.Form["content_title"]; string strTextFromDesigner = string.Empty; EkEnumeration.CMSContentSubtype subtype = Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes; try { dontCreateTask = Request.Form["createtask"]; m_strType = Request.Form["eType"]; if ("ContentDesigner" == m_SelectedEditControl) { string strResponse = Request.Form["response"]; switch (strResponse) { case "message": string strFormDesign; string strXsltDesign; string strFieldList; string strViewXslt; strFormDesign = (string)m_ctlContentDesigner.Content; strXsltDesign = (string)m_ctlSummaryDesigner.Content; strFieldList = m_refContApi.TransformXsltPackage(strFormDesign, Server.MapPath((string)(m_ctlSummaryDesigner.ScriptLocation + "DesignToFieldList.xslt")), true); System.Xml.Xsl.XsltArgumentList objXsltArgs = new System.Xml.Xsl.XsltArgumentList(); objXsltArgs.AddParam("srcPath", "", m_ctlSummaryDesigner.ScriptLocation); strViewXslt = m_refContApi.XSLTransform("<root>" + strXsltDesign + "<ektdesignpackage_list>" + strFieldList + "</ektdesignpackage_list></root>", Server.MapPath((string)(m_ctlSummaryDesigner.ScriptLocation + "DesignToViewXSLT.xslt")), true, false, objXsltArgs, false); StringBuilder sbFormResponse = new StringBuilder(); sbFormResponse.Append("<ektdesignpackage_forms><ektdesignpackage_form><ektdesignpackage_designs><ektdesignpackage_design>"); sbFormResponse.Append(strXsltDesign); sbFormResponse.Append("</ektdesignpackage_design></ektdesignpackage_designs><ektdesignpackage_lists><ektdesignpackage_list>"); sbFormResponse.Append(strFieldList); sbFormResponse.Append("</ektdesignpackage_list></ektdesignpackage_lists><ektdesignpackage_views><ektdesignpackage_view></ektdesignpackage_view><ektdesignpackage_view>"); sbFormResponse.Append(strViewXslt); sbFormResponse.Append("</ektdesignpackage_view></ektdesignpackage_views></ektdesignpackage_form></ektdesignpackage_forms>"); strContentTeaser = sbFormResponse.ToString(); break; case "redirect": strContentTeaser = (string)m_ctlFormResponseRedirect.Content; break; case "transfer": strContentTeaser = (string)m_ctlFormResponseTransfer.Content; break; default: strContentTeaser = (string)m_ctlSummaryDesigner.Content; break; } } else { strContentTeaser = Request.Form["content_teaser"]; } strRptDisplay = Request.Form["report_display_type"]; // Same Window = 1 and New Window = 0 if (!string.IsNullOrEmpty(strRptDisplay) && strRptDisplay.Substring(0, 1) == ",") { strRptDisplay = strRptDisplay.Substring(strRptDisplay.Length - (strRptDisplay.Length - 1)); } strRpt = Request.Form["report_type"]; // Data Table = 1, Bar Chart = 2, Pie Chart = 3 and Combined = 4 if (!string.IsNullOrEmpty(strRpt) && strRpt.Substring(0, 1) == ",") { strRpt = strRpt.Substring(strRpt.Length - (strRpt.Length - 1)); } if (strRptDisplay == "1") { strRptDisplay = "_self"; } else { strRptDisplay = "_blank"; } if (Request.Form["response"] == "report") { bIsReportForm = true; strContentTeaser = "<root><EktReportFormData/><RedirectionLink>"; strContentTeaser = strContentTeaser + "<a href=\"poll.aspx\" id=\"" + strRpt + "\""; strContentTeaser = strContentTeaser + " target = \"" + strRptDisplay + "\""; strContentTeaser = strContentTeaser + "></a>"; strContentTeaser = strContentTeaser + "</RedirectionLink></root>"; } object[] acMetaInfo = new object[4]; object MetaSelect; object MetaSeparator; string MetaTextString = ""; if (!string.IsNullOrEmpty(Request.Form["frm_validcounter"])) { ValidCounter = System.Convert.ToInt32(Request.Form["frm_validcounter"]); } else { ValidCounter = 0; } page_meta_data = new Collection(); for (i = 1; i <= ValidCounter; i++) { acMetaInfo[1] = Request.Form["frm_meta_type_id_" + i]; acMetaInfo[2] = Request.Form["content_id"]; MetaSeparator = Request.Form["MetaSeparator_" + i]; MetaSelect = Request.Form["MetaSelect_" + i]; if (String.IsNullOrEmpty(MetaSelect.ToString())) { MetaTextString = Strings.Replace(Request.Form["frm_text_" + i], ", ", MetaSeparator.ToString(), 1, -1, 0); if (MetaTextString.ToString().Substring(0, 1) == MetaSeparator.ToString()) { MetaTextString = MetaTextString.Substring(MetaTextString.Length - (MetaTextString.Length - 1), (MetaTextString.Length - 1)); } acMetaInfo[3] = MetaTextString; } else { myMeta = Request.Form["frm_text_" + i]; myMeta = Server.HtmlDecode(myMeta); MetaTextString = myMeta.Replace(";", MetaSeparator.ToString()); myMeta = EkFunctions.HtmlEncode(MetaTextString); acMetaInfo[3] = MetaTextString; } page_meta_data.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new object[4]; } if (!string.IsNullOrEmpty(Request.Form["isblogpost"])) //isblogpost { i++; acMetaInfo[1] = Request.Form["blogposttagsid"]; acMetaInfo[2] = Request.Form["content_id"]; MetaSeparator = ";"; acMetaInfo[3] = Request.Form["blogposttags"]; page_meta_data.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new object[4]; i++; acMetaInfo[1] = Request.Form["blogpostcatid"]; acMetaInfo[2] = Request.Form["content_id"]; MetaSeparator = ";"; if (Convert.ToInt32(Request.Form["blogpostcatlen"]) > 0) { MetaTextString = ""; for (y = 0; y <= Convert.ToInt32(Request.Form["blogpostcatlen"]); y++) { if (!String.IsNullOrEmpty(Request.Form["blogcategories" + y.ToString()])) { MetaTextString += (string)(Strings.Replace(Request.Form["blogcategories" + y.ToString()], ";", "~@~@~", 1, -1, 0) + ";"); } } if (MetaTextString.ToString().EndsWith(";")) { MetaTextString = MetaTextString.Substring(0, (MetaTextString.Length - 1)); } acMetaInfo[3] = MetaTextString; } else { acMetaInfo[3] = ""; } page_meta_data.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new object[4]; i++; acMetaInfo[1] = Request.Form["blogposttrackbackid"]; acMetaInfo[2] = Request.Form["content_id"]; MetaSeparator = ";"; acMetaInfo[3] = Request.Form["trackback"]; page_meta_data.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new object[4]; i++; acMetaInfo[1] = Request.Form["blogpostchkpingbackid"]; acMetaInfo[2] = Request.Form["content_id"]; MetaSeparator = ";"; if (!String.IsNullOrEmpty(Request.Form["chkpingback"])) { acMetaInfo[3] = 1; } else { acMetaInfo[3] = 0; } page_meta_data.Add(acMetaInfo, i.ToString(), null, null); acMetaInfo = new object[4]; } sub_prop_data.BreakInheritance = true; if (!String.IsNullOrEmpty(Request.Form["send_notification_button"])) { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { sub_prop_data.SendNextNotification = false; } if (Request.Form["notify_option"] == ("Always")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always; } else if (Request.Form["notify_option"] == ("Initial")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial; if (!(m_strType == "update")) // if new, then set flag to email out { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { if (!String.IsNullOrEmpty(Request.Form["send_notification_button"])) { sub_prop_data.SendNextNotification = true; sub_prop_data.SuspendNextNotification = false; } else { sub_prop_data.SendNextNotification = false; } } } else if (Request.Form["notify_option"] == ("Never")) { sub_prop_data.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never; } if (!String.IsNullOrEmpty(Request.Form["suspend_notification_button"])) { sub_prop_data.SuspendNextNotification = true; sub_prop_data.SendNextNotification = false; } else { sub_prop_data.SuspendNextNotification = false; } sub_prop_data.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]); if (!String.IsNullOrEmpty(Request.Form["use_message_button"])) { sub_prop_data.DefaultMessageID = Convert.ToInt64(Request.Form["notify_messageid"]); } else { sub_prop_data.DefaultMessageID = 0; } if (!String.IsNullOrEmpty(Request.Form["use_summary_button"])) { sub_prop_data.SummaryID = 1; } else { sub_prop_data.SummaryID = 0; } if (!String.IsNullOrEmpty(Request.Form["use_content_button"])) { sub_prop_data.ContentID = Convert.ToInt64(Request.Form["frm_content_id"]); } else { sub_prop_data.ContentID = 0; } sub_prop_data.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]); if (!String.IsNullOrEmpty(Request.Form["notify_url"])) { sub_prop_data.URL = Request.Form["notify_url"]; } else { sub_prop_data.URL = Request.ServerVariables["HTTP_HOST"]; } if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions"); } else { sub_prop_data.FileLocation = Server.MapPath(m_refContApi.AppPath + "subscriptions"); } if (!String.IsNullOrEmpty(Request.Form["notify_weblocation"])) { sub_prop_data.WebLocation = Request.Form["notify_weblocation"]; } else { sub_prop_data.WebLocation = "subscriptions"; } if (!String.IsNullOrEmpty(Request.Form["notify_subject"])) { sub_prop_data.Subject = Request.Form["notify_subject"]; } else { sub_prop_data.Subject = ""; } if (!String.IsNullOrEmpty(Request.Form["notify_emailfrom"])) { sub_prop_data.EmailFrom = Request.Form["notify_emailfrom"]; } else { sub_prop_data.EmailFrom = ""; } sub_prop_data.UseContentTitle = ""; if (!String.IsNullOrEmpty(Request.Form["use_contentlink_button"])) { sub_prop_data.UseContentLink = 1; } else { sub_prop_data.UseContentLink = 0; } if (!String.IsNullOrEmpty(Request.Form["content_sub_assignments"])) { arrSubscriptions = Strings.Split(Strings.Trim(Request.Form["content_sub_assignments"]), " ", -1, 0); if (arrSubscriptions.Length > 0) { for (isub = 0; isub <= (arrSubscriptions.Length - 1); isub++) { page_sub_temp = new Collection(); page_sub_temp.Add(Int64.Parse(Strings.Mid(arrSubscriptions.GetValue(isub).ToString(), 10)), "ID", null, null); page_subscription_data.Add(page_sub_temp, null, null, null); } } } else { page_subscription_data = null; } page_sub_temp = null; if (!String.IsNullOrEmpty(Request.Form["go_live"])) { go_live = DateTime.Parse(Strings.Trim(Request.Form["go_live"])).ToString(); } if (!String.IsNullOrEmpty(Request.Form["end_date"])) { end_date = DateTime.Parse(Strings.Trim(Request.Form["end_date"])).ToString(); end_date_action = Request.Form["end_date_action_radio"]; } lContentType = Convert.ToInt32(Request.Form["content_type"]); switch (Request.Form["content_subtype"].ToLower()) { case "content": { lContentSubType = Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content ; break; } case "pagebuilderdata": { lContentSubType = Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData ; break; } case "webevent": { lContentSubType = Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent ; break; } case "pagebuildermasterdata": { lContentSubType = Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData ; break; } default: { lContentSubType = EkEnumeration.CMSContentSubtype.AllTypes; break; } } for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++) { asset_info.Add(Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i], Strings.Trim(Request.Form["asset_" + Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i].ToString().ToLower()])); } page_content_data = new Collection(); if (!String.IsNullOrEmpty(Request.Form["content_id"])) { page_content_data.Add(Request.Form["content_id"], "ContentID", null, null); } else { page_content_data.Add(0, "ContentID", null, null); } page_content_data.Add(Request.Form["content_language"], "ContentLanguage", null, null); if ((lContentType == 1 || lContentType == 3) && (lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent)) { ContentData cb; if (m_strType == "add") { if (!String.IsNullOrEmpty(Request.QueryString["back_LangType"])) { m_refContApi.ContentLanguage = Convert.ToInt32(Request.QueryString["back_LangType"]); } else { m_refContApi.ContentLanguage = m_refContApi.RequestInformationRef.DefaultContentLanguage; } cb = m_refContApi.GetContentById(Convert.ToInt64(Request.Form["content_id"]), Ektron.Cms.ContentAPI.ContentResultType.Published); m_refContApi.ContentLanguage = m_intContentLanguage; } else { cb = m_refContApi.GetContentById(Convert.ToInt64(Request.Form["content_id"]), Ektron.Cms.ContentAPI.ContentResultType.Staged); } if (cb != null) { subtype = cb.SubType; if (subtype == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || subtype == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || subtype == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { strContent = cb.Html; if (strContentTitle == null) { strContentTitle = cb.Title; } strSearchText = strContentTeaser; page_content_data.Add(subtype, "ContentSubType", null, null); } } } if ("ContentDesigner" == m_SelectedEditControl && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { strContent = (string)m_ctlContentDesigner.Content; if (string.IsNullOrEmpty(strContent) && !string.IsNullOrEmpty(Request.Form["xid"])) { strContent = "<root></root>"; //only for smart form content } strSearchText = (string)m_ctlContentDesigner.Text; strTextFromDesigner = strSearchText; } else { if (subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { i = 1; while (Strings.Len(Request.Form["hiddencontent" + i]) > 0) { strContent = strContent + Request.Form["hiddencontent" + i]; i++; } i = 1; while (Strings.Len(Request.Form["searchtext" + i]) > 0) { strSearchText = strSearchText + Request.Form["searchtext" + i]; i = System.Convert.ToInt32(i + 1); } } } page_content_data.Add(lContentType, "ContentType", null, null); if (IsMac && !IsBrowserIE && m_SelectedEditControl != "ContentDesigner") { //Ephox outputs entity name which causes error in Import/Export utility. //If we finde more entity name being used we should use code snippet from the eWebEditPro to clean. strContent = strContent.Replace(" ", " "); } if ((asset_info != null) && (lContentType == Ektron.Cms.Common.EkConstants.CMSContentType_Media)) { strContent = Request.Form["content_html"]; page_content_data.Add(strContent, "MediaText", null, null); } if (subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { strContent = Utilities.WikiQLink(strContent, Convert.ToInt64(Request.Form["content_folder"])); } if (subtype == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { //we need to update the inner title to match this title, so we deserialize the event, update the field, and reserialize System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(Ektron.Cms.Content.Calendar.EventPersistence.root)); System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(strContent, System.Xml.XmlNodeType.Document, null); Ektron.Cms.Content.Calendar.EventPersistence.root ev; ev = (Ektron.Cms.Content.Calendar.EventPersistence.root)xs.Deserialize(reader); ev.DisplayTitle = strContentTitle; System.IO.MemoryStream stream = new System.IO.MemoryStream(); System.Xml.XmlWriterSettings writersettings = new System.Xml.XmlWriterSettings(); writersettings.OmitXmlDeclaration = true; using (System.Xml.XmlWriter xmlWriter = System.Xml.XmlWriter.Create(stream, writersettings)) { xs.Serialize(xmlWriter, ev); } stream.Flush(); stream.Position = 0; System.IO.StreamReader streamreader = new System.IO.StreamReader(stream); strContent = streamreader.ReadToEnd(); } page_content_data.Add(strContent, "ContentHtml", null, null); if (m_strType != "update" || (strContentTeaser.ToLower() == "<br /><!-- wiki summary -->")) { string strippedTeaser = Utilities.StripHTML(strContentTeaser); if ((lContentType == 1 || lContentType == 3) && (subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData && subtype != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent)) { if (Request.Form["xid"] == null && (strContentTeaser.IndexOf("<img") == -1 && (strippedTeaser == "" || strippedTeaser == " " || strippedTeaser == " " || (strippedTeaser.ToLower() == "<!-- wiki summary -->")))) { if (strTextFromDesigner != string.Empty) { strContentTeaser = strTextFromDesigner; } else { strContentTeaser = Utilities.AutoSummary(strContent); } if (strContentTeaser != "") { strContentTeaser = "<p>" + strContentTeaser + "</p>"; } } } } if ((Request.Form["chkLockedContentLink"] != null) && Request.Form["chkLockedContentLink"] == "on") { bLockedContentLink = true; } page_content_data.Add(bLockedContentLink, "LockedContentLink", null, null); page_content_data.Add(Request.Form["content_comment"], "Comment", null, null); page_content_data.Add(page_meta_data, "ContentMetadata", null, null); page_content_data.Add(strContentTeaser, "ContentTeaser", null, null); page_content_data.Add(Request.Form["content_folder"], "FolderID", null, null); page_content_data.Add(strSearchText, "SearchText", null, null); page_content_data.Add(go_live, "GoLive", null, null); page_content_data.Add(end_date, "EndDate", null, null); page_content_data.Add(end_date_action, "EndDateAction", null, null); int nAssetInfoArrayLBound = 0; int nAssetInfoArrayUBound = -1; int j = 1; string strAssetInfo = ""; Array aryAssetInfoValue; int nArrayLBound; int nArrayUBound; Hashtable cAssetInfoArray = new Hashtable(); string strKeyName = ""; for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++) { strKeyName = Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]; strAssetInfo = Convert.ToString(asset_info[Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]]); page_content_data.Add(strAssetInfo.Replace("%2C", ","), strKeyName, null, null); if (0 == strAssetInfo.Length && nAssetInfoArrayUBound > nAssetInfoArrayLBound) { // This information is not provided at all, so it's not inconsistent. strAssetInfo = ""; for (j = 1; j <= nAssetInfoArrayUBound - nAssetInfoArrayLBound; j++) { strAssetInfo += ","; } } //' Append a space so that an empty string will produce an array of one item //' rather than an array with no items. The value will be Trimmed later to //' remove the space. aryAssetInfoValue = (strAssetInfo + " ").Split(','); nArrayLBound = 0; nArrayUBound = aryAssetInfoValue.Length - 1; if (i == 0) { nAssetInfoArrayLBound = System.Convert.ToInt32(nArrayLBound); nAssetInfoArrayUBound = System.Convert.ToInt32(nArrayUBound); } if (nAssetInfoArrayLBound == nArrayLBound && nAssetInfoArrayUBound == nArrayUBound) { cAssetInfoArray.Add(strKeyName, aryAssetInfoValue); } else { Response.Redirect((string)("reterror.asp?info=" + EkFunctions.UrlEncode((string)("Inconsistent number of assets. Value=" + strAssetInfo))), false); } } if (nAssetInfoArrayLBound == nAssetInfoArrayUBound) { if (0 == strContentTitle.Length) { if (Strings.Len(page_content_data["AssetFilename"]) > 0) { strContentTitle = page_content_data["AssetFilename"].ToString(); } else { strContentTitle = "No Title"; } } } if (strContentTitle.IndexOf("\'") != -1) { strContentTitle = System.Web.HttpUtility.HtmlEncode(strContentTitle); } page_content_data.Add(strContentTitle, "ContentTitle", null, null); m_strManualAlias = (Request.Form["frm_manalias"] != null ? Request.Form["frm_manalias"].ToString().Trim() : null); m_strManualAliasExt = (Request.Form["frm_manaliasExt"] != null ? Request.Form["frm_manaliasExt"].ToString() : null); ast_frm_manaliasExt.Value = Request.Form["frm_manaliasExt"]; //Aliasing logic for 7.6 starts here m_prevManualAliasName = (Request.Form["prev_frm_manalias_name"] != null ? Request.Form["prev_frm_manalias_name"].ToString() : ""); m_prevManualAliasExt = (Request.Form["prev_frm_manalias_ext"] != null ?Request.Form["prev_frm_manalias_ext"].ToString():""); m_currManualAliasName = m_strManualAlias; m_currManualAliasExt = m_strManualAliasExt; if (m_prevManualAliasName == "" && m_currManualAliasName != "" || m_prevManualAliasExt == "" && m_currManualAliasExt != "") { m_currManualAliasStatus = "New"; } else if (m_prevManualAliasName != "" && m_currManualAliasName != "" && (m_currManualAliasName != m_prevManualAliasName || m_prevManualAliasExt != m_currManualAliasExt)) { m_currManualAliasStatus = "Modified"; } else if (m_prevManualAliasName != "" && m_currManualAliasName == "") { m_currManualAliasStatus = "Deleted"; } else { m_currManualAliasStatus = "None"; } if (!string.IsNullOrEmpty(Request.Form["frm_manalias_id"])) { m_intManualAliasId = System.Convert.ToInt64(Request.Form["frm_manalias_id"]); } page_content_data.Add(m_strManualAlias, "NewUrlAliasName", null, null); page_content_data.Add(m_intManualAliasId, "UrlAliasId", null, null); page_content_data.Add(m_strManualAliasExt, "NewUrlAliasExt", null, null); page_content_data.Add(m_currManualAliasStatus, "UrlAliasStatus", null, null); page_content_data.Add(m_prevManualAliasName, "OldUrlAliasName", null, null); page_content_data.Add(m_prevManualAliasExt, "OldUrlAliasExt", null, null); page_content_data.Add(m_strManualAlias, "ManualAlias", null, null); page_content_data.Add(m_intManualAliasId, "ManualAliasID", null, null); if (Request.Form["TaxonomyOverrideId"] != null && Convert.ToInt64(Request.Form["TaxonomyOverrideId"]) != 0) { TaxonomyOverrideId = Convert.ToInt64(Request.Form["TaxonomyOverrideId"]); TaxonomyTreeIdList = TaxonomyOverrideId.ToString(); } if (!string.IsNullOrEmpty(Request.Form[taxonomyselectedtree.UniqueID])) { TaxonomyTreeIdList = Request.Form[taxonomyselectedtree.UniqueID]; if (TaxonomyTreeIdList.Trim().EndsWith(",")) { TaxonomyTreeIdList = TaxonomyTreeIdList.Substring(0, TaxonomyTreeIdList.Length - 1); } } if (TaxonomyTreeIdList.Trim() == string.Empty && TaxonomySelectId > 0) { TaxonomyTreeIdList = TaxonomySelectId.ToString(); } page_content_data.Add(TaxonomyTreeIdList, "Taxonomy", null, null); page_content_data.Add(Request.Form["content_image"], "Image", null, null); long intContentId = 0; int iAsset = 0; string strAssetInfoValue = ""; for (iAsset = nAssetInfoArrayLBound; iAsset <= nAssetInfoArrayUBound; iAsset++) { if (nAssetInfoArrayLBound < nAssetInfoArrayUBound) { for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++) { strKeyName = Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]; strAssetInfoValue = (string)(cAssetInfoArray[strKeyName]); // [iAsset] // Commas were escaped as %2C, so restore them now. See assetevents.js strAssetInfoValue = strAssetInfoValue.Replace("%2C", ",").Trim(); if (Ektron.Cms.Common.EkFunctions.DoesKeyExist(page_content_data, strKeyName)) { page_content_data.Remove(strKeyName); } page_content_data.Add(strAssetInfoValue, strKeyName, null, null); } page_content_data.Remove("ContentTitle"); if (strContentTitle.Length > 0) { page_content_data.Add(strContentTitle + " (" + page_content_data["AssetFilename"] + ")", "ContentTitle", null, null); } else if (Strings.Len(page_content_data["AssetFilename"]) > 0) { page_content_data.Add(page_content_data["AssetFilename"], "ContentTitle", null, null); } else { page_content_data.Add("No Title", "ContentTitle", null, null); } } if (!string.IsNullOrEmpty(Request.Form["xid"]) && !string.IsNullOrEmpty(Request.Form["templateSelect"])) { page_content_data.Add(Request.Form["xid"], "MultiXmlID", null, null); page_content_data.Add(Request.Form["templateSelect"], "MultiTemplateID", null, null); } else if (!string.IsNullOrEmpty(Request.Form["templateSelect"])) { page_content_data.Add(0, "MultiXmlID", null, null); if (lContentSubType == EkEnumeration.CMSContentSubtype.PageBuilderData || lContentSubType == EkEnumeration.CMSContentSubtype.PageBuilderMasterData ) { ITemplateModel templmodel = ObjectFactory.GetTemplateModel(); TemplateData templdat = templmodel.FindByID(Convert.ToInt64(Request.Form["templateSelect"])); if ((templdat != null)) { page_content_data.Add(templdat.Id, "MultiTemplateID", null, null); } } else page_content_data.Add(Request.Form["templateSelect"], "MultiTemplateID", null, null); } else if (!string.IsNullOrEmpty(Request.Form["xid"]) && lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent) { page_content_data.Add(Request.Form["xid"], "MultiXmlID", null, null); page_content_data.Add(0, "MultiTemplateID", null, null); } if (m_strType == "update") { m_refContent.SaveContentv2_0(page_content_data); intContentId = Convert.ToInt64(Request.Form["content_id"]); } else { if (iAsset == nAssetInfoArrayLBound) { if (Request.Form["AddQlink"] == "AddQlink") { page_content_data.Add(true, "AddToQlink", null, null); } else { page_content_data.Add(false, "AddToQlink", null, null); } if (Request.Form["IsSearchable"] == "IsSearchable" || Request.Form["IsSearchable"] =="on") { page_content_data.Add(true, "IsSearchable", null, null); } else { page_content_data.Add(false, "IsSearchable", null, null); } } // Update content flagging: object flagDefSelObj = Request.Form["FlaggingDefinitionSel"]; if ((flagDefSelObj != null) && Ektron.Cms.Common.EkFunctions.IsNumeric(flagDefSelObj)) { page_content_data.Add(Convert.ToInt64(flagDefSelObj.ToString()), "FlagDefId", null, null); } intContentId = m_refContent.AddNewContentv2_0(page_content_data); } if (string.IsNullOrEmpty(Request.Form["suppress_notification"])) { m_refContent.UpdateSubscriptionPropertiesForContent(intContentId, sub_prop_data); m_refContent.UpdateSubscriptionsForContent(intContentId, page_subscription_data); } // process tag info ProcessTags(intContentId, m_intContentLanguage); if (m_strPageAction == "checkin") { m_refContent.CheckIn(intContentId, ""); } if (m_strPageAction == "publish") { m_refContent.CheckIn(intContentId, ""); if (ret == false) { if (bIsReportForm) { if (!String.IsNullOrEmpty(Request.Form["renewpoll"])) { if ("true" == Request.Form["renewpoll"].ToLower()) { //this needs to be done before the histogram is updated with the new data. m_refContApi.EkModuleRef.UpdatePollRev(intContentId); } } bUpdateFormQuestions = m_refContApi.EkModuleRef.UpdateFormFieldQuestions(System.Convert.ToInt64(Request.Form["content_id"]), strContent); } site_data = m_refSiteApi.GetSiteVariables(-1); long PreapprovalGroupID; Collection cPreApproval = new Collection(); cPreApproval = m_refContent.GetFolderPreapprovalGroup(Convert.ToInt64(Request.Form["content_folder"])); PreapprovalGroupID = System.Convert.ToInt64(cPreApproval["UserGroupID"]); if (PreapprovalGroupID > 0) { if (Convert.ToString(dontCreateTask) == "") { if (m_intContentLanguage == 1) { strTaskName = (string)(Request.Form["content_title"] + intContentId + "_Task"); } else { strTaskName = (string)(Request.Form["content_title"] + intContentId + "_Task" + m_intContentLanguage); } m_refTask.ContentLanguage = m_intContentLanguage; m_refTask.LanguageID = m_intContentLanguage; isAlreadyCreated = m_refTask.IsTaskAlreadyCreated(intContentId); if (isAlreadyCreated == false) { m_refTask.TaskTitle = strTaskName; // Task name would be contentname + content id + _Task m_refTask.AssignToUserGroupID = PreapprovalGroupID; //Assigned to group defined by m_refTask.AssignedByUserID = Convert.ToString(CurrentUserID); //Assigned by person creating the task m_refTask.State = "1"; //Not started m_refTask.ContentID = intContentId; //Content ID of the content being created m_refTask.Priority = EkEnumeration.TaskPriority.Normal; //Normal m_refTask.CreatedByUserID = CurrentUserID; // If task is hopping this will always be created by m_refTask.ContentLanguage = m_intContentLanguage; m_refTask.LanguageID = m_intContentLanguage; ret = m_refTask.AddTask(); ret = m_refContent.SetContentState(intContentId, "T"); } else { ret = m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["content_folder"]), ""); } } else { ret = m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["content_folder"]), ""); } } else { string strStatusBefore; string strStatusAfter; Collection colContentState; colContentState = m_refContent.GetContentStatev2_0(intContentId); strStatusBefore = Convert.ToString(colContentState["ContentStatus"]); ret = m_refContent.SubmitForPublicationv2_0(intContentId, Convert.ToInt64(Request.Form["content_folder"]), ""); colContentState = m_refContent.GetContentStatev2_0(intContentId); strStatusAfter = Convert.ToString(colContentState["ContentStatus"]); if (strStatusBefore != strStatusAfter && "T" == strStatusAfter) { blnShowTStatusMessage = true; } string markupPath = ""; string cacheidentifier = ""; string updateContent = ""; markupPath = Request.Form["ctlmarkup"]; cacheidentifier = Request.Form["cacheidentifier"]; if ((markupPath != null) && markupPath.Length > 0) { markupPath = Request.PhysicalApplicationPath + markupPath; } if ((cacheidentifier != null) && cacheidentifier.Length > 0) { if (HttpContext.Current.Cache[cacheidentifier] != null) { HttpContext.Current.Cache.Remove(cacheidentifier); } } object ekml = null; if ((markupPath != null) && (HttpContext.Current.Cache[markupPath] != null)) { ekml = HttpContext.Current.Cache[markupPath]; Ektron.Cms.UI.CommonUI.ApiSupport api = new Ektron.Cms.UI.CommonUI.ApiSupport(); Ektron.Cms.UI.CommonUI.ApiSupport.ContentResult results = api.LoadContent(intContentId, false); m_refContApi = new ContentAPI(); updateContent = this.m_refContApi.FormatOutput((string)ekml.GetType().GetProperty("ContentFormat").GetValue(ekml, null), Request.Form["ctltype"], results.Item); updateContent = this.m_refContApi.WrapAjaxToolBar(updateContent, results.Item, commparams); } else { updateContent = Convert.ToString(colContentState["ContentHtml"]); } if (!String.IsNullOrEmpty(Request.Form["ctlupdateid"])) { Page.ClientScript.RegisterHiddenField("updatefieldcontent", updateContent); StringBuilder strJs = new StringBuilder(); strJs.Append("<script language=\"JavaScript1.2\" type=\"text/javascript\"> ").Append("\r\n"); strJs.Append(" if (top.opener != null) {").Append("\r\n"); strJs.Append(" var objUpdateField = top.opener.document.getElementById(\'" + Request.Form["ctlupdateid"] + "\');").Append("\r\n"); strJs.Append(" if (objUpdateField != null) { objUpdateField.innerHTML = document.getElementById(\"updatefieldcontent\").value; }").Append("\r\n"); strJs.Append(" }").Append("\r\n"); if ((m_bClose) && (m_strPageAction != "save")) { strJs.Append("document.location.href = \"close.aspx\";").Append("\r\n"); } strJs.Append("</script>").Append("\r\n"); UpdateFieldJS.Text = strJs.ToString(); } } } if (strAddToCollectionType == "menu") { if (strMyCollection != "") { pagedata = new Collection(); pagedata.Add(intContentId, "ItemID", null, null); pagedata.Add("content", "ItemType", null, null); pagedata.Add("self", "ItemTarget", null, null); pagedata.Add("", "ItemLink", null, null); pagedata.Add("", "ItemTitle", null, null); pagedata.Add("", "ItemDescription", null, null); ret = m_refContent.AddItemToEcmMenu(strMyCollection, pagedata); } } else { if (strMyCollection != "") { ret = m_refContent.AddItemToEcmCollection(Convert.ToInt64(strMyCollection), intContentId, m_intContentLanguage); } } } } if (m_strPageAction == "summary_save") { Response.Redirect((string)("edit.aspx?close=" + Request.QueryString["close"] + "&LangType=" + m_intContentLanguage + "&id=" + intContentId + "&type=update&mycollection=" + strMyCollection + "&addto" + strAddToCollectionType + "&back_file=" + back_file + "&back_action=" + back_action + "&back_folder_id=" + back_folder_id + "&back_id=" + back_id + "&back_form_id=" + back_form_id + "&back_LangType=" + back_LangType + "&summary=1" + back_callerpage + back_origurl), false); } else if (m_strPageAction == "meta_save") { Response.Redirect((string)("edit.aspx?close=" + Request.QueryString["close"] + "&LangType=" + m_intContentLanguage + "&id=" + intContentId + "&type=update&mycollection=" + strMyCollection + "&addto" + strAddToCollectionType + "&back_file=" + back_file + "&back_action=" + back_action + "&back_folder_id=" + back_folder_id + "&back_id=" + back_id + "&back_form_id=" + back_form_id + "&back_LangType=" + back_LangType + "&meta=1" + back_callerpage + back_origurl), false); } else if ((!m_bClose) && (m_strPageAction != "save")) { if (Request.QueryString["pullapproval"] == "true") { Response.Redirect(GetBackPage(intContentId), false); } else { if (m_strType == "add" && m_strPageAction == "checkin") { //leave back_action } else if (m_strPageAction != "publish") { if (back_action.ToLower() == "viewform") { back_action = back_action + "&staged=true"; } else { back_action = "viewstaged"; } } // replaced logic added by todd 3/30/2006 - when you save then checkin content, GetBackPage() isn't aware of contentid and tries // to use 0 which causes all sorts of bad things to happen - bug# 19413 - however if you just checkin before saving it goes to a different page, // so don't replace that (which is the else statement) if (m_strType == "update") { back_id = intContentId; if (controlName == "cbwidget") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UpdateContentWidget", "UpdateContentWidget(" + intContentId + ",\'" + buttonId.Value + "\');", true); } else { Response.Redirect(GetBackPage(intContentId), false); } } else { Response.Redirect(GetBackPage(intContentId), false); } } } else if (m_strPageAction == "save") { Response.Redirect((string)("edit.aspx?close=" + Request.QueryString["close"] + "&LangType=" + m_intContentLanguage + "&id=" + intContentId + (this.TaxonomyOverrideId > 0 ? ("&TaxonomyId=" + this.TaxonomyOverrideId.ToString()) : "") + (this.TaxonomySelectId > 0 ? ("&SelTaxonomyId=" + this.TaxonomySelectId.ToString()) : "") + "&type=update&mycollection=" + strMyCollection + "&addto" + strAddToCollectionType + "&back_file=" + back_file + "&back_action=" + back_action + "&back_folder_id=" + back_folder_id + "&back_id=" + back_id + "&back_form_id=" + back_form_id + "&back_LangType=" + back_LangType + back_callerpage + back_origurl + "&control=" + controlName+ "&buttonid=" + buttonId.Value), false); } if ((m_bClose) && (m_strPageAction != "save")) { //Close the editor page if (String.IsNullOrEmpty( Request.Form["ctlupdateid"])) { string strQuery = ""; if (TaxonomySelectId > 0) { strQuery = (string)("&__taxonomyid=" + TaxonomySelectId); } else if (TaxonomyOverrideId > 0) { strQuery = (string)("&__taxonomyid=" + TaxonomyOverrideId); } if (controlName == "cbwidget") { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UpdateContentWidget", "UpdateContentWidget(" + intContentId + ",\'" + buttonId.Value + "\');", true); } else { Response.Redirect((string)("close.aspx?toggle=true" + strQuery), false); } } } } catch (Exception ex) { Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message) + "&LangType=" + m_intContentLanguage), false); } }
private void EditSubscriptionHtmlScripts() { StringBuilder sbHtml = new StringBuilder(); Array arrSubscribed = null; int findindex; int i = 0; string strEnabled = ""; string strNotifyA = ""; string strNotifyI = ""; string strNotifyN = ""; string strNotifySend = ""; string strNotifySuspend = ""; string strNotifyMessage = ""; EmailFromData[] emailfrom_list; EmailMessageData[] defaultmessage_list; EmailMessageData[] unsubscribe_list; EmailMessageData[] optout_list; int y = 0; try { emailfrom_list = m_refContApi.GetAllEmailFrom(); defaultmessage_list = m_refContApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.DefaultMessage); unsubscribe_list = m_refContApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.Unsubscribe); optout_list = m_refContApi.GetSubscriptionMessagesForType(Ektron.Cms.Common.EkEnumeration.EmailMessageTypes.OptOut); sbHtml.Append(Environment.NewLine + "<script language=\"javascript\">" + Environment.NewLine); sbHtml.Append("function UpdateNotifyStatus() {" + Environment.NewLine); sbHtml.Append("if (frmMain.notify_option[0].checked == true) {" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"lbl_notification_status\").innerHTML = \'<font color=\"green\">Web Alerts are enabled.</font>\';" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"suspend_notification_button\").disabled = false;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"send_notification_button\").disabled = true;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"send_notification_button\").checked = false;" + Environment.NewLine); sbHtml.Append("} else if (frmMain.notify_option[1].checked == true) {" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"lbl_notification_status\").innerHTML = \'<font color=\"green\">Web Alerts are enabled.</font>\';" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"suspend_notification_button\").disabled = true;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"suspend_notification_button\").checked = false;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"send_notification_button\").disabled = false;" + Environment.NewLine); sbHtml.Append("} else {" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"lbl_notification_status\").innerHTML = \'<font color=\"red\">Web Alerts are disabled.</font>\';" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"suspend_notification_button\").checked = false;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"send_notification_button\").checked = false;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"suspend_notification_button\").disabled = true;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\"send_notification_button\").disabled = true;" + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("function PreviewWebAlert() {" + Environment.NewLine); sbHtml.Append(" var contentid, defmsgid, optid, summaryid, unsubid, conttype, usecontlink;" + Environment.NewLine); sbHtml.Append(" if (document.getElementById(\'use_content_button\').checked == true) {;" + Environment.NewLine); sbHtml.Append(" contentid = document.getElementById(\'frm_content_id\').value;" + Environment.NewLine); sbHtml.Append(" } else {" + Environment.NewLine); sbHtml.Append(" contentid = 0;" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" if (document.getElementById(\'use_message_button\').checked == true) {;" + Environment.NewLine); sbHtml.Append(" defmsgid = document.getElementById(\'notify_messageid\').value;" + Environment.NewLine); sbHtml.Append(" } else {" + Environment.NewLine); sbHtml.Append(" defmsgid = 0;" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" optid = document.getElementById(\'notify_optoutid\').value;" + Environment.NewLine); sbHtml.Append(" summaryid = document.getElementById(\'use_summary_button\').checked; " + Environment.NewLine); sbHtml.Append(" unsubid = document.getElementById(\'notify_unsubscribeid\').value;" + Environment.NewLine); sbHtml.Append(" conttype = document.getElementById(\'content_type\').value;" + Environment.NewLine); sbHtml.Append(" if (document.getElementById(\'use_contentlink_button\').checked == true) {;" + Environment.NewLine); sbHtml.Append(" usecontlink = 1;" + Environment.NewLine); sbHtml.Append(" } else {" + Environment.NewLine); sbHtml.Append(" usecontlink = 0;" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" window.open(\'previewwebalert.aspx?content=" + m_intItemId + "&defmsg=\' + defmsgid + \'&optoutid=\' + optid + \'&summaryid=\' + summaryid + \'&usecontentid=\' + contentid + \'&unsubscribeid=\' + unsubid + \'&content_type=\' + conttype + \'&uselink=\' + usecontlink,\'\',\'menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes\'); " + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("function SetMessageContenttoDefault() {" + Environment.NewLine); sbHtml.Append(" document.getElementById(\'use_content_button\').checked = true;" + Environment.NewLine); sbHtml.Append(" document.getElementById(\'frm_content_id\').value = -1; " + Environment.NewLine); sbHtml.Append(" document.getElementById(\'titlename\').value = \'[[use current]]\'; " + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("function enableCheckboxes() {" + Environment.NewLine); sbHtml.Append(" var idx, masterBtn, tableObj, enableFlag, qtyElements;" + Environment.NewLine); sbHtml.Append(" tableObj = document.getElementById(\'cfld_subscription_assignment\');" + Environment.NewLine); sbHtml.Append(" enableFlag = false;" + Environment.NewLine); sbHtml.Append(" masterBtn = document.getElementById(\'break_inherit_button\');" + Environment.NewLine); sbHtml.Append(" if (validateObject(masterBtn)){" + Environment.NewLine); sbHtml.Append(" enableFlag = masterBtn.checked;" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" if (validateObject(tableObj)){" + Environment.NewLine); sbHtml.Append(" qtyElements = tableObj.all.length;" + Environment.NewLine); sbHtml.Append(" for(idx = 0; idx < qtyElements; idx++ ) {" + Environment.NewLine); sbHtml.Append(" if (tableObj.all[idx].type == \'checkbox\'){" + Environment.NewLine); sbHtml.Append(" tableObj.all[idx].disabled = !enableFlag;" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("function validateObject(obj) {" + Environment.NewLine); sbHtml.Append(" return ((obj != null) &&" + Environment.NewLine); sbHtml.Append(" ((typeof(obj)).toLowerCase() != \'undefined\') &&" + Environment.NewLine); sbHtml.Append(" ((typeof(obj)).toLowerCase() != \'null\'))" + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("function valAndSaveCSubAssignments() {" + Environment.NewLine); if ((!(active_subscription_list == null)) && (!(subscription_data_list == null)) && (!((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (settings_data.AsynchronousLocation == "")))) { sbHtml.Append(" var idx, masterBtn, tableObj, enableFlag, qtyElements, retStr;" + Environment.NewLine); sbHtml.Append(" var hidnFld;" + Environment.NewLine); sbHtml.Append(" //hidnFld = document.getElementById(\'content_sub_assignments\');" + Environment.NewLine); sbHtml.Append(" document.forms[0].content_sub_assignments.value = \'\'; //hidnFld.value=\'\'" + Environment.NewLine); sbHtml.Append(" tableObj = tableObj = document.getElementById(\'therows\');" + Environment.NewLine); sbHtml.Append(" tableObj = tableObj.getElementsByTagName(\'input\');" + Environment.NewLine); sbHtml.Append(" enableFlag = true;" + Environment.NewLine); sbHtml.Append(" retStr = \'\';" + Environment.NewLine); sbHtml.Append(" if ((validateObject(tableObj)) && enableFlag){" + Environment.NewLine); sbHtml.Append(" qtyElements = tableObj.length;" + Environment.NewLine); sbHtml.Append(" for(idx = 0; idx < qtyElements; idx++ ) {" + Environment.NewLine); sbHtml.Append(" if ((tableObj[idx].type == \'checkbox\') && tableObj[idx].checked){" + Environment.NewLine); sbHtml.Append(" retStr = retStr + tableObj[idx].name + \' \';" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" }" + Environment.NewLine); sbHtml.Append(" document.forms[0].content_sub_assignments.value = retStr; // hidnFld.value = " + Environment.NewLine); } sbHtml.Append(" return true; // (Note: return false to prevent form submission)" + Environment.NewLine); sbHtml.Append("}" + Environment.NewLine); sbHtml.Append("</script>" + Environment.NewLine); if (active_subscription_list == null) { sbHtml.Append("<input type=\"hidden\" name=\"suppress_notification\" value=\"true\">"); phSubscription.Visible = false; EditSubscriptionHtml.Visible = false; lblNotificationStatus.Text = "<input type=\"hidden\" name=\"suppress_notification\" value=\"true\">"; } else if ((emailfrom_list == null) || (defaultmessage_list == null) || (unsubscribe_list == null) || (optout_list == null) || (subscription_data_list == null) || (settings_data.AsynchronousLocation == "")) { sbHtml.Append("<div id=\"dvSubscription\">"); sbHtml.Append("<input type=\"hidden\" name=\"suppress_notification\" value=\"true\">"); sbHtml.Append("<br/><b>" + m_refMsg.GetMessage("lbl web alert settings") + ":</b><br/><br/>" + m_refMsg.GetMessage("lbl web alert not setup") + "<br/>"); if (emailfrom_list == null) { sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("lbl web alert emailfrom not setup") + "</font>"); } if (defaultmessage_list == null) { sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("lbl web alert def msg not setup") + "</font>"); } if (unsubscribe_list == null) { sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("lbl web alert unsub not setup") + "</font>"); } if (optout_list == null) { sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("lbl web alert optout not setup") + "</font>"); } if (subscription_data_list == null) { phSubscription.Visible = false; EditSubscriptionHtml.Visible = false; sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("alt No subscriptions are enabled on the folder.") + "</font>"); } if (settings_data.AsynchronousLocation == "") { sbHtml.Append("<br/> <font color=\"red\">" + m_refMsg.GetMessage("alt The location to the Asynchronous Data Processor is not specified.") + "</font>"); } sbHtml.Append("</div>"); } else { if (subscription_properties_list == null) { subscription_properties_list = new SubscriptionPropertiesData(); } sbHtml.Append("<div id=\"dvSubscription\">"); sbHtml.Append("<table class=\"ektronGrid\" width=\"100%\">"); sbHtml.Append("<tr><td class=\"label\">"); sbHtml.Append("" + m_refMsg.GetMessage("lbl web alert opt") + ":"); sbHtml.Append("</td>"); switch (subscription_properties_list.NotificationType.GetHashCode()) { case 0: strNotifyA = " CHECKED=\"true\" "; strNotifyI = ""; strNotifyN = ""; strNotifySend = " DISABLED=\"true\" "; strNotifySuspend = ""; strNotifyMessage = "<font color=\"green\">Web Alerts are enabled.</font>"; break; case 1: strNotifyA = ""; strNotifyI = " CHECKED=\"true\" "; strNotifyN = ""; strNotifySend = ""; strNotifySuspend = " DISABLED=\"true\" "; strNotifyMessage = "<font color=\"green\">Web Alerts are enabled.</font>"; break; case 2: strNotifyA = ""; strNotifyI = ""; strNotifyN = " CHECKED=\"true\" "; strNotifySend = " DISABLED=\"true\" "; strNotifySuspend = " DISABLED=\"true\" "; strNotifyMessage = "<font color=\"red\">Web Alerts are disabled.</font>"; break; } sbHtml.Append("<td class=\"value\">"); sbHtml.Append(" <input type=\"radio\" value=\"Always\" name=\"notify_option\" OnClick=\"UpdateNotifyStatus()\" " + strNotifyA + "> " + m_refMsg.GetMessage("lbl web alert notify always") + "<br />"); sbHtml.Append(" <input id=\"suspend_notification_button\" onclick=\"//;\" type=\"checkbox\" name=\"suspend_notification_button\" " + strNotifySuspend + ">"); sbHtml.Append(" " + m_refMsg.GetMessage("lbl web alert suspend") + "<br/>"); sbHtml.Append(" <input type=\"radio\" value=\"Initial\" name=\"notify_option\" OnClick=\"UpdateNotifyStatus()\" " + strNotifyI + ">"); sbHtml.Append(" " + m_refMsg.GetMessage("lbl web alert notify initial") + "<br />"); sbHtml.Append(" <input id=\"send_notification_button\" onclick=\"//;\" type=\"checkbox\" name=\"send_notification_button\" " + strNotifySend + ">"); sbHtml.Append(" " + m_refMsg.GetMessage("lbl web alert send") + "<br />"); sbHtml.Append(" <input type=\"radio\" value=\"Never\" name=\"notify_option\" OnClick=\"UpdateNotifyStatus()\" " + strNotifyN + "> " + m_refMsg.GetMessage("lbl web alert notify never") + "<br/>"); sbHtml.Append("</td>"); sbHtml.Append("</tr>"); sbHtml.Append("<tr>"); sbHtml.Append("<td class=\"label\">"); sbHtml.Append("" + m_refMsg.GetMessage("lbl web alert subject") + ":"); sbHtml.Append("</td>"); sbHtml.Append("<td class=\"value\">"); if (subscription_properties_list.Subject != "") { sbHtml.Append(" <input type=\"text\" maxlength=\"255\" size=\"65\" value=\"" + subscription_properties_list.Subject + "\" name=\"notify_subject\" " + strEnabled + "/> <br />"); } else { sbHtml.Append(" <input type=\"text\" maxlength=\"255\" size=\"65\" value=\"\" name=\"notify_subject\" " + strEnabled + "/> <br />"); } sbHtml.Append("</td>"); sbHtml.Append("</tr>"); sbHtml.Append("<tr>"); sbHtml.Append("<td class=\"label\">"); sbHtml.Append("" + m_refMsg.GetMessage("lbl web alert emailfrom address") + ":"); sbHtml.Append("</td>"); sbHtml.Append("<td class=\"value\">"); sbHtml.Append("<select name=\"notify_emailfrom\" id=\"notify_emailfrom\">"); if ((emailfrom_list != null) && emailfrom_list.Length > 0) { for (y = 0; y <= emailfrom_list.Length - 1; y++) { if (emailfrom_list[y].Email == subscription_properties_list.EmailFrom) { sbHtml.Append("<option value=\"" + EkFunctions.HtmlEncode(emailfrom_list[y].Email) + "\" selected>" + emailfrom_list[y].Email + "</option>"); } else { sbHtml.Append("<option value=\"" + EkFunctions.HtmlEncode(emailfrom_list[y].Email) + "\">" + emailfrom_list[y].Email + "</option>"); } } } sbHtml.Append("</select>"); sbHtml.Append("</td>"); sbHtml.Append("</tr>"); sbHtml.Append("<tr>"); sbHtml.Append("<td class=\"label\">"); sbHtml.Append("" + m_refMsg.GetMessage("lbl web alert contents") + ": "); sbHtml.Append("<img src=\"" + m_refContApi.AppPath + "images/UI/Icons/preview.png\" alt=\"Preview Web Alert Message\" title=\"Preview Web Alert Message\" onclick=\" PreviewWebAlert(); return false;\" />"); sbHtml.Append("</td>"); sbHtml.Append("<td class=\"value\" nowrap=\"nowrap\">"); sbHtml.Append(" <input id=\"use_optout_button\" type=\"checkbox\" checked=\"true\" name=\"use_optout_button\" disabled=\"true\"> Opt Out Message"); sbHtml.Append(" <select " + strEnabled + " name=\"notify_optoutid\" id=\"notify_optoutid\">"); if ((optout_list != null) && optout_list.Length > 0) { for (y = 0; y <= optout_list.Length - 1; y++) { if (optout_list[y].Id == subscription_properties_list.OptOutID) { sbHtml.Append("<option value=\"" + optout_list[y].Id + "\" selected>" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"); } else { sbHtml.Append("<option value=\"" + optout_list[y].Id + "\">" + EkFunctions.HtmlEncode(optout_list[y].Title) + "</option>"); } } } sbHtml.Append("</select><br />"); if (subscription_properties_list.DefaultMessageID > 0) { sbHtml.Append(" <input id=\"use_message_button\" type=\"checkbox\" checked=\"true\" name=\"use_message_button\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use default message")); } else { sbHtml.Append(" <input id=\"use_message_button\" type=\"checkbox\" name=\"use_message_button\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use default message")); } sbHtml.Append(" <select " + strEnabled + " name=\"notify_messageid\" id=\"notify_messageid\">"); if ((defaultmessage_list != null) && defaultmessage_list.Length > 0) { for (y = 0; y <= defaultmessage_list.Length - 1; y++) { if (defaultmessage_list[y].Id == subscription_properties_list.DefaultMessageID) { sbHtml.Append("<option value=\"" + defaultmessage_list[y].Id + "\" selected>" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"); } else { sbHtml.Append("<option value=\"" + defaultmessage_list[y].Id + "\">" + EkFunctions.HtmlEncode(defaultmessage_list[y].Title) + "</option>"); } } } sbHtml.Append("</select><br />"); if (subscription_properties_list.SummaryID > 0) { sbHtml.Append(" <input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" checked=\"true\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use summary message") + "<br />"); } else { sbHtml.Append(" <input id=\"use_summary_button\" type=\"checkbox\" name=\"use_summary_button\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use summary message") + "<br />"); } if (subscription_properties_list.ContentID == -1) { sbHtml.Append(" <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"true\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use content message")); sbHtml.Append(" <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" id=\"frm_content_id\" value=\"-1\"/><input type=\"hidden\" name=\"frm_content_langid\" id=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\" id=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" id=\"titlename\" value=\"[[use current]]\" size=\"65\" disabled=\"true\"/>"); sbHtml.Append("<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\" QuickLinkSelectBase(" + m_intContentFolder.ToString() + ",\'frmMain\',\'titlename\',0,0,0,0) ;return false;\">" + m_refMsg.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\" SetMessageContenttoDefault();return false;\">" + m_refMsg.GetMessage("use current") + "</a><br/>"); } else if (subscription_properties_list.ContentID > 0) { sbHtml.Append(" <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" checked=\"true\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use content message")); sbHtml.Append(" <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" id=\"frm_content_id\" value=\"" + subscription_properties_list.ContentID.ToString() + "\"/><input type=\"hidden\" name=\"frm_content_langid\" id=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\" id=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" id=\"titlename\" value=\"" + subscription_properties_list.UseContentTitle.ToString() + "\" size=\"65\" disabled=\"true\"/>"); sbHtml.Append("<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\" QuickLinkSelectBase(" + m_intContentFolder.ToString() + ",\'frmMain\',\'titlename\',0,0,0,0) ;return false;\">" + m_refMsg.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\" SetMessageContenttoDefault();return false;\">Use Current</a><br/>"); } else { sbHtml.Append(" <input id=\"use_content_button\" type=\"checkbox\" name=\"use_content_button\" " + strEnabled + "> " + m_refMsg.GetMessage("lbl use content message")); sbHtml.Append(" <input type=\"hidden\" maxlength=\"20\" name=\"frm_content_id\" id=\"frm_content_id\" value=\"0\" /><input type=\"hidden\" name=\"frm_content_langid\" id=\"frm_content_langid\"/><input type=\"hidden\" name=\"frm_qlink\" id=\"frm_qlink\"/><input type=\"text\" name=\"titlename\" id=\"titlename\" onkeydown=\"return false\" value=\"\" size=\"65\" disabled=\"true\"/>"); sbHtml.Append("<a href=\"#\" class=\"button buttonInline greenHover selectContent\" onclick=\" QuickLinkSelectBase(" + m_intContentFolder.ToString() + ",\'frmMain\',\'titlename\',0,0,0,0) ;return false;\">" + m_refMsg.GetMessage("lbl use content select") + "</a><a href=\"#\" class=\"button buttonInline blueHover useCurrent\" onclick=\" SetMessageContenttoDefault();return false;\">Use Current</a><br/>"); } if (subscription_properties_list.UseContentLink > 0) { sbHtml.Append(" <input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" checked=\"true\" " + strEnabled + "> Use Content Link<br />"); } else { sbHtml.Append(" <input id=\"use_contentlink_button\" type=\"checkbox\" name=\"use_contentlink_button\" " + strEnabled + "> Use Content Link<br />"); } sbHtml.Append(" <input id=\"use_unsubscribe_button\" type=\"checkbox\" checked=\"true\" name=\"use_unsubscribe_button\" disabled=\"true\"> " + m_refMsg.GetMessage("lbl unsubscribe message")); sbHtml.Append(" <select " + strEnabled + " name=\"notify_unsubscribeid\" id=\"notify_unsubscribeid\">"); if ((unsubscribe_list != null) && unsubscribe_list.Length > 0) { for (y = 0; y <= unsubscribe_list.Length - 1; y++) { if (unsubscribe_list[y].Id == subscription_properties_list.UnsubscribeID) { sbHtml.Append("<option value=\"" + unsubscribe_list[y].Id + "\" selected>" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"); } else { sbHtml.Append("<option value=\"" + unsubscribe_list[y].Id + "\">" + EkFunctions.HtmlEncode(unsubscribe_list[y].Title) + "</option>"); } } } sbHtml.Append("</select><br /><br />"); sbHtml.Append("</td>"); sbHtml.Append("</tr>"); sbHtml.Append("</table>"); sbHtml.Append("<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl avail web alert") + ":</div>"); sbHtml.Append("</td></tr>"); sbHtml.Append("<table class=\"ektronGrid\" cellspacing=\"1\" id=\"cfld_subscription_assignment\" name=\"cfld_subscription_assignment\"><tbody id=\"therows\">"); lblNotificationStatus.Text = "<span id=\"lbl_notification_status\">" + strNotifyMessage + "</span>"; if (!(subscription_data_list == null) && subscription_data_list.Length > 0) { sbHtml.Append("<tr class=\"title-header\"><td>" + m_refMsg.GetMessage("lbl assigned") + "</td><td>" + m_refMsg.GetMessage("lbl name") + "</td></tr>"); if (!(subscribed_data_list == null)) { arrSubscribed = Array.CreateInstance(typeof(string), subscribed_data_list.Length); for (i = 0; i <= subscribed_data_list.Length - 1; i++) { arrSubscribed.SetValue(subscribed_data_list[i].Name, i); } if (arrSubscribed.Length > 0) { Array.Sort(arrSubscribed); } } for (i = 0; i <= subscription_data_list.Length - 1; i++) { findindex = -1; if (!(subscribed_data_list == null)) { findindex = Array.BinarySearch(arrSubscribed, subscription_data_list[i].Name); } sbHtml.Append("<tr>"); if (findindex < 0) { sbHtml.Append("<td nowrap=\"true\" align=\"center\"><input type=\"checkbox\" name=\"Assigned_" + subscription_data_list[i].Id + "\" id=\"Assigned_" + subscription_data_list[i].Id + "\" " + strEnabled + "></td></td>"); } else { sbHtml.Append("<td nowrap=\"true\" align=\"center\"><input type=\"checkbox\" name=\"Assigned_" + subscription_data_list[i].Id + "\" id=\"Assigned_" + subscription_data_list[i].Id + "\" checked=\"true\" " + strEnabled + "></td></td>"); } sbHtml.Append("<td nowrap=\"true\" align=\"Left\">" + subscription_data_list[i].Name + "</td>"); sbHtml.Append("</tr>"); } } else { sbHtml.Append("<tr><td>Nothing available.</td></tr>"); } sbHtml.Append("</tbody></table>"); sbHtml.Append("<input type=\"hidden\" name=\"content_sub_assignments\" id=\"content_sub_assignments\" value=\"\"></td>"); sbHtml.Append("</tr>"); sbHtml.Append("</table>"); sbHtml.Append("</div>"); } EditSubscriptionHtml.Visible = true; EditSubscriptionHtml.Text = sbHtml.ToString(); } catch (Exception) { } }