Esempio n. 1
0
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     RegisterResources();
         Response.CacheControl = "no-cache";
         Response.AddHeader("Pragma", "no-cache");
         Response.Expires = -1;
         m_refContent = m_refContentApi.EkContentRef;
         m_refMsg = m_refContentApi.EkMsgRef;
         if (m_refContent.IsAllowed(0, 0, "users", "IsLoggedIn", 0) == false || m_refContent.IsAllowed(0, 0, "users", "IsAdmin", 0) == false)
         {
             if (!m_refContent.IsARoleMember(Convert.ToInt64(EkEnumeration.CmsRoleIds.AdminXmlConfig), m_refContent.RequestInformation.UserId, false))
             {
                 Utilities.ShowError(m_refMsg.GetMessage("com: user does not have permission"));
             }
         }
         if (!String.IsNullOrEmpty(Request.QueryString["action"]))
         {
             m_strPageAction = Request.QueryString["action"].ToLower();
         }
         if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
         {
             ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
             m_refApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
         }
         else
         {
             if (m_refApi.GetCookieValue("LastValidLanguageID") != "")
             {
                 ContentLanguage = int.Parse(m_refApi.GetCookieValue("LastValidLanguageID"));
             }
         }
         m_refApi.ContentLanguage = ContentLanguage;
         StyleSheetJS.Text = m_refStyle.GetClientScript();
 }
Esempio n. 2
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        AssertInternalReferrer();
        string output = "";

        try
        {
            string sHtml;
            sHtml = Request["html"];
            if (sHtml == null)
            {
                throw (new ArgumentException("Argument \'html\' is required."));
            }

            Ektron.Cms.Content.EkContent objEkContent = new Ektron.Cms.Content.EkContent(this.GetCommonApi().RequestInformationRef);

            output = objEkContent.ConvertHtmlContenttoXHTML(sHtml);

        }
        catch (Exception ex)
        {
            output = string.Format("<html><head><title>ekAjaxTidy Error</title></head><body class=\"ekAjaxTidyError\">{0}</body></html>", EkFunctions.HtmlEncode(ex.Message));
        }

        Response.ContentType = "application/xml";
        Response.ContentEncoding = System.Text.Encoding.UTF8; // Safari does not encode properly even though this is set
        litContent.Text = output;
    }
Esempio n. 3
0
 protected void Page_Init(object sender, System.EventArgs e)
 {
     _EkContentRef = m_refContentApi.EkContentRef;
     //register page components
     this.RegisterJS();
     this.RegisterCSS();
 }
Esempio n. 4
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        m_refContent = new Ektron.Cms.Content.EkContent(m_refContentApi.RequestInformationRef);
        m_reftask = m_refContentApi.EkTaskRef;
        Utilities.ValidateUserLogin();
        RegisterResources();
        if (!string.IsNullOrEmpty(Request.QueryString["contentid"]))
        {
            m_iPostID = Convert.ToInt64(Request.QueryString["contentid"]);
        }

        if (!string.IsNullOrEmpty(Request.QueryString["blogid"]))
        {
            m_iBlogID = Convert.ToInt64(Request.QueryString["blogid"]);
        }

        if (!string.IsNullOrEmpty(Request.QueryString["close"]))
        {
            closeOnFinish = true;
        }

        if (Page.IsPostBack)
        {
            switch (base.m_sPageAction)
            {
                case "add":
                    Process_Add();
                    break;
                case "edit":
                    Process_Edit();
                    break;
            }
        }
        else
        {
            switch (base.m_sPageAction)
            {
                case "add":
                    Display_Add();
                    break;
                case "edit":
                    Display_Edit();
                    break;
            }
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refCommon.EkMsgRef;
            AppImgPath = m_refCommon.AppImgPath;
            m_strPageAction = Request.QueryString["action"];
            object refAPI = m_refCommon as object;
            Utilities.SetLanguage(m_refCommon);
            //Utilities.SetLanguage(m_refCommon);
            TaxonomyLanguage = m_refCommon.ContentLanguage;
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            if (Request.QueryString["view"] != null)
            {
                m_strViewItem = AntiXss.HtmlEncode(Request.QueryString["view"]);
            }

            PageLabel.Text = PageLabel.ToolTip = m_refMsg.GetMessage("lbl pagecontrol page");
            OfLabel.Text = OfLabel.ToolTip = m_refMsg.GetMessage("lbl pagecontrol of");

            FirstPage.ToolTip = m_refMsg.GetMessage("lbl first page");
            PreviousPage.ToolTip = m_refMsg.GetMessage("lbl previous page");
            NextPage.ToolTip = m_refMsg.GetMessage("lbl next page");
            LastPage.ToolTip = m_refMsg.GetMessage("lbl last page");

            FirstPage.Text = "[" + m_refMsg.GetMessage("lbl first page") + "]";
            PreviousPage.Text = "[" + m_refMsg.GetMessage("lbl previous page") + "]";
            NextPage.Text = "[" + m_refMsg.GetMessage("lbl next page") + "]";
            LastPage.Text = "[" + m_refMsg.GetMessage("lbl last page") + "]";

            taxonomy_request = new TaxonomyRequest();
            taxonomy_request.TaxonomyId = TaxonomyId;
            taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
            m_refContent = m_refCommon.EkContentRef;
            if (Page.IsPostBack && Request.Form[isPostData.UniqueID] != "")
            {
                if (Request.Form["submittedaction"] == "delete")
                {
                    m_refContent.DeleteTaxonomy(taxonomy_request);
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else if (Request.Form["submittedaction"] == "deleteitem")
                {
                    if (m_strViewItem != "folder")
                    {
                        taxonomy_request.TaxonomyIdList = Request.Form["selected_items"];
                        if (m_strViewItem.ToLower() == "cgroup")
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                        }
                        else if (m_strViewItem.ToLower() == "user")
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                        }
                        else
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Content;
                        }
                        m_refContent.RemoveTaxonomyItem(taxonomy_request);
                    }
                    else
                    {
                        TaxonomySyncRequest tax_folder = new TaxonomySyncRequest();
                        tax_folder.TaxonomyId = TaxonomyId;
                        tax_folder.TaxonomyLanguage = TaxonomyLanguage;
                        tax_folder.SyncIdList = Request.Form["selected_items"];
                        m_refContent.RemoveTaxonomyFolder(tax_folder);
                    }
                    if (Request.Params["ccp"] == null)
                    {
                        Response.Redirect("taxonomy.aspx?" + Request.ServerVariables["query_string"] + "&ccp=true", true);
                    }
                    else
                    {
                        Response.Redirect((string) ("taxonomy.aspx?" + Request.ServerVariables["query_string"]), true);
                    }
                }
            }
            else if (IsPostBack == false)
            {
                DisplayPage();
            }
            isPostData.Value = "true";
    }
Esempio n. 6
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        try
        {
            m_refMsg = m_refApi.EkMsgRef;
            AppImgPath = m_refApi.AppImgPath;
            AppPath = m_refApi.AppPath;
            m_strPageAction = Request.QueryString["action"];
            Utilities.SetLanguage(m_refApi);
            TaxonomyLanguage = m_refApi.ContentLanguage;
            if ((TaxonomyLanguage == -1))
            {
                TaxonomyLanguage = m_refApi.DefaultContentLanguage;
            }
            if ((Request.QueryString["taxonomyid"] != null))
            {
                TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            }
            if ((Request.QueryString["parentid"] != null))
            {
                TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
                if ((TaxonomyParentId > 0))
                {
                    TitleLabel = "categorytitle";
                    DescriptionLabel = "categorydescription";
                }
            }

            if ((Page.IsPostBack))
            {
                TaxonomyData taxonomy_data = new TaxonomyData();
                taxonomy_data.TaxonomyType = Ektron.Cms.Common.EkEnumeration.TaxonomyType.Locale;
                taxonomy_data.TaxonomyDescription = Request.Form[taxonomydescription.UniqueID];
                taxonomy_data.TaxonomyName = Request.Form[taxonomytitle.UniqueID];
                taxonomy_data.TaxonomyLanguage = TaxonomyLanguage;
                taxonomy_data.TaxonomyParentId = TaxonomyParentId;
               // taxonomy_data.TaxonomyImage = Request.Form[taxonomy_image.UniqueID];
               // taxonomy_data.CategoryUrl = Request.Form[categoryLink.UniqueID];
                //if (tr_enableDisable.Visible == true)
                //{
                //    if (!string.IsNullOrEmpty(Request.Form[chkEnableDisable.UniqueID]))
                //    {
                //        taxonomy_data.Visible = true;
                //    }
                //    else
                //    {
                //        taxonomy_data.Visible = false;
                //    }
                //}
                //else
                //{
                //    taxonomy_data.Visible = true;
                //}

                //if ((Request.Form[inherittemplate.UniqueID] != null))
                //{
                //    taxonomy_data.TemplateInherited = true;
                //}
                //if ((Request.Form[taxonomytemplate.UniqueID] != null))
                //{
                //    taxonomy_data.TemplateId = Convert.ToInt64(Request.Form[taxonomytemplate.UniqueID]);
                //}
                //else
                //{
                //    taxonomy_data.TemplateId = 0;
                //}

                //If (TaxonomyId <> 0) Then
                //  taxonomy_data.TaxonomyId = TaxonomyId
                //End If
                m_refContent = m_refApi.EkContentRef;
                TaxonomyId = m_refContent.CreateTaxonomy(taxonomy_data);
                //add the default language by Default.
                TaxonomyRequest item_request = new TaxonomyRequest();
                item_request.TaxonomyId = TaxonomyId;
                item_request.TaxonomyIdList =Convert.ToString(TaxonomyLanguage);
                item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Locale;
                item_request.TaxonomyLanguage = TaxonomyLanguage;
                m_refContent.AddTaxonomyItem(item_request);
                if (Request.Form[alllanguages.UniqueID] == "false")
                {
                    m_refContent.UpdateTaxonomyVisible(TaxonomyId, -1, false);
                }
                if ((TaxonomyParentId == 0))
                {
                    string strConfig = string.Empty;
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigContent.UniqueID])))
                    //{
                    //    strConfig = "0";
                    //}
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigUser.UniqueID])))
                    //{
                    //    if ((string.IsNullOrEmpty(strConfig)))
                    //    {
                    //        strConfig = "1";
                    //    }
                    //    else
                    //    {
                    //        strConfig = strConfig + ",1";
                    //    }
                    //}
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigGroup.UniqueID])))
                    //{
                    //    if ((string.IsNullOrEmpty(strConfig)))
                    //    {
                    //        strConfig = "2";
                    //    }
                    //    else
                    //    {
                    //        strConfig = strConfig + ",2";
                    //    }
                    //}
                    if ((!(string.IsNullOrEmpty(strConfig))))
                    {
                        m_refContent.UpdateTaxonomyConfig(TaxonomyId, strConfig);
                    }
                }
                //++++++++++++++++++++++++++++++++++++++++++++++++
                //+++++++++ Adding MetaData Information '+++++++++
                //++++++++++++++++++++++++++++++++++++++++++++++++
                //Commeneted as per Doug suggestion
                //AddCustomProperties();

                if ((Request.QueryString["iframe"] == "true"))
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    //this should jump back to taxonomy that was added
                    //Response.Redirect("taxonomy.aspx?rf=1", True)
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&view=locale&taxonomyid=" + TaxonomyId + "&rf=1", true);
                }
            }
            else
            {
                m_refContent = m_refApi.EkContentRef;
                TaxonomyRequest req = new TaxonomyRequest();
                req.TaxonomyId = TaxonomyParentId;
                req.TaxonomyLanguage = TaxonomyLanguage;

                if (TaxonomyParentId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyParentId, TaxonomyLanguage);
                }
                else if (TaxonomyId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyId, TaxonomyLanguage);
                }
                //if (!m_bSynchronized)
                //{
                //    tr_enableDisable.Visible = false;
                //}
                TaxonomyBaseData data = m_refContent.ReadTaxonomy(ref req);
                if ((data == null))
                {
                    EkException.ThrowException(new Exception("Invalid taxonomy ID: " + TaxonomyId + " parent: " + TaxonomyParentId));
                }
                language_data = (new SiteAPI()).GetLanguageById(TaxonomyLanguage);
                if (((language_data != null) && (m_refApi.EnableMultilingual == 1)))
                {
                    lblLanguage.Text = "[" + language_data.Name + "]";
                }
              //  taxonomy_image_thumb.ImageUrl = m_refApi.AppImgPath + "spacer.gif";
                m_strCurrentBreadcrumb = data.TaxonomyPath.Remove(0, 1).Replace("\\", " > ");
                if ((string.IsNullOrEmpty(m_strCurrentBreadcrumb)))
                {
                    m_strCurrentBreadcrumb = "Root";
                }
                //if ((TaxonomyParentId == 0))
                //{
                //    inherittemplate.Visible = false;
                //    lblInherited.Text = "No";
                //}
                //else
                //{
                //    inherittemplate.Checked = true;
                //    taxonomytemplate.Enabled = false;
                //    inherittemplate.Visible = true;
                //    lblInherited.Text = "";
                //}
             //   TemplateData[] templates = null;
               // templates = m_refApi.GetAllTemplates("TemplateFileName");
                //taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem("-select template-", "0"));
                //if ((templates != null && templates.Length > 0))
                //{
                //    for (int i = 0; i <= templates.Length - 1; i++)
                //    {
                //        taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem(templates[i].FileName, templates[i].Id.ToString()));
                //    }
                //}

               // inherittemplate.Attributes.Add("onclick", "OnInheritTemplateClicked(this)");
               // inherittemplate.Attributes.Add("onclick", "OnInheritTemplateClicked(this)");
                //if ((TaxonomyParentId == 0))
                //{
                //    tr_config.Visible = true;
                //}
                //else
                //{
                //    tr_config.Visible = false;
                //}
               // chkConfigContent.Checked = true;
                //LoadCustomPropertyList();
                TaxonomyToolBar();
            }
        }
        catch (System.Threading.ThreadAbortException)
        {
            //Do nothing
        }
        catch (Exception ex)
        {
            Response.Redirect(AppPath + "reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message + ".") + "&LangType=" + TaxonomyLanguage, false);
        }
    }
Esempio n. 7
0
    private void Display_AddDiscussionForum()
    {
        pnlOuterContainer.Visible = false;
        pnlDiscussionForum.Visible = true;

        _FolderData = _ContentApi.GetFolderById(_Id);

        AddDiscussionForumToolBar();

        DiscussionCategory[] adcCategories;
        Ektron.Cms.Content.EkContent m_refContent = new Ektron.Cms.Content.EkContent();

        hdn_adf_folderid.Value = _Id.ToString();

        ltr_adf_properties.Text += "<input type=\"hidden\" id=\"EnableReplication\" name=\"EnableReplication\" value=\"" + _FolderData.ReplicationMethod + "\" />";

        m_refContent = _ContentApi.EkContentRef;
        adcCategories = m_refContent.GetCategoriesforBoard(_Id);
        if (!(adcCategories == null) && (adcCategories.Length > 0))
        {
            for (int j = 0; j <= (adcCategories.Length - 1); j++)
            {
                drp_adf_category.Items.Add(new ListItem(Convert.ToString(adcCategories[j].Name), Convert.ToString(adcCategories[j].CategoryID)));
            }
        }
        else
        {
            throw (new Exception(MessageHelper.GetMessage("err NoBoardCategories")));
        }

        ltr_adb_cat.Text += "<p id=\"parah\">";
        ltr_adb_cat.Text += "</p>";
        ltr_adb_cat.Text += "<ul class=\"buttonList\">";
        ltr_adb_cat.Text += "<li><a href=\"#AddSubject\" title=\"" + MessageHelper.GetMessage("lnk Add New subject") + "\" onclick=\"addInput();return false;\" class=\"button buttonInlineBlock greenHover\">" + MessageHelper.GetMessage("lnk Add New subject") + "</a>";
        ltr_adb_cat.Text += "</li>";
        ltr_adb_cat.Text += "</ul>";
        ltr_adb_cat.Text += "<p class=\"required\">* Required Field</p>\"";
        ltr_adb_cat.Text += "<input type=\"hidden\" id=\"categorylength\" name=\"categorylength\" value=\"0\" />";
    }
Esempio n. 8
0
    private void AddEditRulesetToolBar()
    {
        bool bAdmin = false;
        bool bRuleEditor = false;
        SetAction("edit");
        base.SetTitleBarToMessage("Business Rules");
        if (m_refContent == null)
        {
            m_refContent = m_refContentApi.EkContentRef;
        }
        bAdmin = m_refContent.IsAllowed(0, 0, "users", "IsAdmin", 0);
        bRuleEditor = m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminRuleEditor), m_refContentApi.UserId, false);
        if (m_sPageAction == "edit")
        {
            base.SetTitleBarToString((string)(m_refMsg.GetMessage("lbl edit ruleset") + " " + EkFunctions.HtmlEncode(m_aRuleset[0].Name) + ""));
        }
        else
        {
            base.SetTitleBarToString((string)(m_refMsg.GetMessage("alt View Ruleset") + " " + EkFunctions.HtmlEncode(m_aRuleset[0].Name) + ""));
        }

        txtRulesetName.Text = EkFunctions.HtmlEncode(m_aRuleset[0].Name);
        base.AddBackButton((string)("ruleset.aspx?action=View&id=" + m_iID.ToString() + "&LangType=" + m_refContentApi.ContentLanguage.ToString()));

        if (bRuleEditor || bAdmin)
        {
            base.AddButton(m_refContentApi.AppPath + "images/UI/Icons/save.png", "#", m_refMsg.GetMessage("alt Click here to save this ruleset"), m_refMsg.GetMessage("lbl save ruleset"), "onclick=\"SaveRule();\" ", StyleHelper.SaveButtonCssClass, true);
            base.AddButton(m_refContentApi.AppPath + "images/UI/Icons/remove.png", "#", m_refMsg.GetMessage("alt Click here to remove rule"), m_refMsg.GetMessage("lbl Remove Rule"), "onclick=\"RuleWizard.removeRuleItem(RuleWizard.getSelectedRule())\" ", StyleHelper.RemoveButtonCssClass);
            if (m_aRuleset[0].Rules.Length > 1)
            {
                base.AddButton(m_refContentApi.AppPath + "images/UI/Icons/arrowUp.png", "#", m_refMsg.GetMessage("alt Click to move up"), m_refMsg.GetMessage("lbl move up"), "onclick=\"RuleWizard.moveRuleItem(\'up\', RuleWizard.getSelectedRule())\"  ", StyleHelper.UpButtonCssClass);
                base.AddButton(m_refContentApi.AppPath + "images/UI/Icons/arrowDown.png", "#", m_refMsg.GetMessage("alt Click to move down"), m_refMsg.GetMessage("lbl Move Down"), "onclick=\"RuleWizard.moveRuleItem(\'down\', RuleWizard.getSelectedRule())\" ", StyleHelper.DownButtonCssClass);
            }
        }
        base.AddHelpButton("edit_ruleset");
    }
Esempio n. 9
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        //Put user code to initialize the page here
            CommonApi m_refApi = new CommonApi();

            if (!string.IsNullOrEmpty(Request.QueryString["enhancedmetaselect"]))
            {
                m_strEnhancedMetaSelect = (string) (EkFunctions.HtmlEncode(Request.QueryString["enhancedmetaselect"]).Replace("\'", "&#39;"));
            }
            if (!string.IsNullOrEmpty(Request.QueryString["metadataformtagid"]))
            {
                m_strMetadataFormTagId = (string) (EkFunctions.HtmlEncode(Request.QueryString["metadataformtagid"]).Replace("\'", "&#39;"));
            }
            if (!string.IsNullOrEmpty(Request.QueryString["separator"]))
            {
                m_strSeparator = (string) (EkFunctions.HtmlEncode(Request.QueryString["separator"]).Replace("\'", "&#39;"));
            }

            if (!string.IsNullOrEmpty(Request.QueryString["selectids"]))
            {
                m_selectids = (string) (EkFunctions.HtmlEncode(Request.QueryString["selectids"]).Replace("\'", "&#39;"));
            }

            if (!string.IsNullOrEmpty(Request.QueryString["selecttitles"]))
            {
                m_selecttitles = (string) (EkFunctions.HtmlEncode(Request.QueryString["selecttitles"]).Replace("\'", "&#39;"));
            }

            if (m_refApi.TreeModel == 1)
            {
                m_bAjaxTree = true;
            }

            m_refMsg = m_refContentApi.EkMsgRef;
            if (! Utilities.ValidateUserLogin())
            {
                return;
            }
            Page.Title = AppName + " " + m_refMsg.GetMessage("library page html title") + " " + Ektron.Cms.CommonApi.GetEcmCookie()["username"];
            scope = EkFunctions.HtmlEncode(Request.QueryString["scope"]).ToLower();
            sEditor = EkFunctions.HtmlEncode(Request.QueryString["EditorName"]).Trim();
            DEntryLink = EkFunctions.HtmlEncode(Request.QueryString["dentrylink"]);
            actionType = EkFunctions.HtmlEncode(Request.QueryString["actionType"]);
            if ((Request.QueryString["retfield"] != null)&& Request.QueryString["retfield"] != "")
            {
                m_retField = (string) ("&retfield=" + EkFunctions.HtmlEncode(Request.QueryString["retfield"]));
            }
            if ((Request.QueryString["showthumb"] != null)&& Request.QueryString["showthumb"] != "")
            {
                m_showThumb = (string) ("&showthumb=" + EkFunctions.HtmlEncode(Request.QueryString["showthumb"]));
            }
            m_refContent = m_refContentApi.EkContentRef;
            if (!string.IsNullOrEmpty(Request.QueryString["iOrderBy"]))
            {
                iOrderBy = EkFunctions.HtmlEncode(Request.QueryString["iOrderBy"]);
            }
            else
            {
                iOrderBy = "Title";
            }
            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                if (Request.QueryString["action"] != "")
                {
                    m_action = EkFunctions.HtmlEncode(Request.QueryString["action"].ToLower());
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["autonavfolder"]))
            {
                if (Request.QueryString["autonavfolder"] != "" && Convert.ToInt64(Request.QueryString["autonavfolder"].ToString()) > 0)
                {
                    m_AutoNavFolderIDs = (string) ((m_refContentApi.EkContentRef).GetFolderParentFolderIdRecursive(Convert.ToInt64(Request.QueryString["autonavfolder"].ToString())));
                }
            }
            if (m_bAjaxTree)
            {
                if (IsInCallbackMode())
                {
                    return;
                }
            }
            else
            {
                ltr_ClientScript.Text = GetClientScript();
                Msg.Text = GetString();
            }

            RegisterResources();
    }
 protected void Page_Load(object sender, System.EventArgs e)
 {
     m_refMsg = m_refCommon.EkMsgRef;
     AppImgPath = m_refCommon.AppImgPath;
     m_strPageAction = Request.QueryString["action"];
     //object refCommon = m_refCommon as object;
     Utilities.SetLanguage(m_refCommon);
     TaxonomyLanguage = m_refCommon.ContentLanguage;
     TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
     if ((Request.QueryString["view"] != null))
     {
         m_strViewItem = Request.QueryString["view"];
     }
     taxonomy_request = new TaxonomyRequest();
     taxonomy_request.TaxonomyId = TaxonomyId;
     taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
     m_refContent = m_refCommon.EkContentRef;
     if ((Page.IsPostBack))
     {
         if ((Request.Form["submittedaction"] == "delete"))
         {
             m_refContent.DeleteTaxonomy(taxonomy_request);
             Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
         }
         else if ((Request.Form["submittedaction"] == "deleteitem"))
         {
             if ((m_strViewItem != "folder"))
             {
                 taxonomy_request.TaxonomyIdList = Request.Form["selected_items"];
                 if ((m_strViewItem.ToLower() == "cgroup"))
                 {
                     taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                 }
                 else if ((m_strViewItem.ToLower() == "user"))
                 {
                     taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                 }
                 else
                 {
                     taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Content;
                 }
                 m_refContent.RemoveTaxonomyItem(taxonomy_request);
             }
             else
             {
                 TaxonomySyncRequest tax_folder = new TaxonomySyncRequest();
                 tax_folder.TaxonomyId = TaxonomyId;
                 tax_folder.TaxonomyLanguage = TaxonomyLanguage;
                 tax_folder.SyncIdList = Request.Form["selected_items"];
                 m_refContent.RemoveTaxonomyFolder(tax_folder);
             }
             if ((Request.Params["ccp"] == null))
             {
                 Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"] + "&ccp=true", true);
             }
             else
             {
                 Response.Redirect("LocaleTaxonomy.aspx?" + Request.ServerVariables["query_string"], true);
             }
         }
     }
     else if ((IsPostBack == false))
     {
         DisplayPage();
     }
 }
Esempio n. 11
0
    //SelectCreateContent.aspx?FolderID=0&rmadd=false&LangType=1033&browser=0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        m_refMsg = (new Ektron.Cms.CommonApi()).EkMsgRef;
        m_refMsg = m_refSiteApi.EkMsgRef;
        RegisterResources();
        pleaseSelectMsg = m_refMsg.GetMessage("js select content block");
        try
        {
            m_refCalendarApi = new CalendarAPI(m_refContentApi.RequestInformationRef);
            if (m_refContentApi.UserId == 0 || m_refContentApi.RequestInformationRef.IsMembershipUser == 1)
            {
                Response.Redirect("login.aspx?fromLnkPg=1", false);
                return;
            }
            blnForTasks = false;
            m_refMsg = m_refContentApi.EkMsgRef;
            //Put user code to initialize the page here
            AppPath = m_refContentApi.AppPath;
            AppName = m_refContentApi.AppName;
            CalendarIcon = "<img src=\"" + AppPath + "images/ui/icons/calendarViewDay.png\" alt=\"Calendar Event\" \">";
            ContentIcon = "<img src=\"" + AppPath + "images/ui/icons/contentHtml.png\"  alt=\"" + m_refMsg.GetMessage("generic content") + "\">";
            formsIcon = "<img src=\"" + AppPath + "images/ui/icons/contentForm.png\"  alt=\"" + m_refMsg.GetMessage("generic form") + "\">";
            if (!string.IsNullOrEmpty(Request.QueryString["FolderID"]))
            {
                FolderId = Convert.ToInt64(Request.QueryString["FolderID"].ToString());
            }
            if (!string.IsNullOrEmpty(Request.QueryString["actionName"]))
            {
                actName = Request.QueryString["actionName"];
            }
            if (actName == null)
            {
                actName = "";
            }
            NextPage.Attributes.Add("onclick", "return resetPostback()");
            lnkBtnPreviousPage.Attributes.Add("onclick", "return resetPostback()");
            FirstPage.Attributes.Add("onclick", "return resetPostback()");
            LastPage.Attributes.Add("onclick", "return resetPostback()");

            if (!(Request.QueryString["ItemID"] == null))
            {
                ItemID = Convert.ToInt64(Request.QueryString["ItemID"]);
            }

            if (!(Request.QueryString["ty"] == null))
            {
                callerPage = Request.QueryString["ty"];
            }

            if (!(Request.QueryString["overrideType"] == null))
            {
                if (Request.QueryString["overrideType"] == "content")
                {
                    overrideContentEnum = "content";
                }
                else if (Request.QueryString["overrideType"].ToLower() == "forms")
                {
                    overrideContentEnum = "forms";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select form").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "blog")
                {
                    overrideContentEnum = "blog";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select blog").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "forum")
                {
                    overrideContentEnum = "forum";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select forum").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "calendar")
                {
                    overrideContentEnum = "calendar";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select calendar").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "collection")
                {
                    overrideContentEnum = "collection";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select collection").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "folder")
                {
                    overrideContentEnum = "folder";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select folder").ToString();
                }
                else if (Request.QueryString["overrideType"].ToLower() == "calfolder")
                {
                    overrideContentEnum = "calfolder";
                    pleaseSelectMsg = m_refMsg.GetMessage("js select folder").ToString();
                }
            }

            if (!(Request.QueryString["StartingFolderID"] == null))
            {
                StartingFolderId = Convert.ToInt64(Request.QueryString["StartingFolderID"]);
            }

            if (IsBrowserIE())
            {
                notSupportIFrame = "0";
            }
            else
            {
                notSupportIFrame = "1";
            }

            StyleSheetJS.Text = m_refStyle.GetClientScript();
            if (Request.QueryString["rmadd"] == "true")
            {
                bRemoveAddContentBtn = true;
            }
            if (!(Request.QueryString["for_tasks"] == null))
            {
                blnForTasks = System.Convert.ToBoolean("1" == Strings.Trim(Request.QueryString["for_tasks"]));
            }
            else if (!(Request.QueryString["for_wiki"] == null))
            {
                blnForWiki = System.Convert.ToBoolean("1" == Strings.Trim(Request.QueryString["for_wiki"]));
                overrideContentEnum = "folder";
                pleaseSelectMsg = m_refMsg.GetMessage("js select folder").ToString();
            }

            if (overrideContentEnum.Length == 0 || overrideContentEnum == "content")
            {
                Page.Title = AppName + " Select Content";
            }
            else if (overrideContentEnum == "forms")
            {
                Page.Title = AppName + " Select Form";
            }
            else if (overrideContentEnum == "blog")
            {
                Page.Title = AppName + " Select Blog";
            }
            else if (overrideContentEnum == "forum")
            {
                Page.Title = AppName + " Select Forum";
            }
            else if (overrideContentEnum == "calendar")
            {
                Page.Title = AppName + " Select Calendar";
            }
            else if (overrideContentEnum == "collection")
            {
                Page.Title = AppName + " Select Collection";
            }
            else if (overrideContentEnum == "folder")
            {
                Page.Title = AppName + " Select Folder";
            }
            else if (overrideContentEnum == "calfolder")
            {
                Page.Title = AppName + " Select Folder";
            }

            if (!(Request.QueryString["LangType"] == null))
            {
                if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
                {
                    ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContentApi.ContentLanguage = ContentLanguage;
            }

            m_refContent = m_refContentApi.EkContentRef;
            gtNavs = m_refContent.GetFolderInfoWithPath(FolderId);
            FolderName = gtNavs["FolderName"];
            folderType = (EkEnumeration.FolderType)Enum.Parse(typeof(EkEnumeration.FolderType), gtNavs["FolderType"].ToString());
            ltr_folderType.Text = (string)(folderType.ToString());
            ParentFolderId = gtNavs["ParentID"];
            fPath = gtNavs["Path"];

            cTmp = new Collection();
            cTmp.Add("name", "OrderBy", null, null);
            cTmp.Add(FolderId, "FolderID", null, null);
            cTmp.Add(FolderId, "ParentID", null, null);
            cFolders = m_refContent.GetAllViewableChildFoldersv2_0(cTmp);
            if (blnForTasks == true)
            {
                cTmp.Add(true, "FilterContentAssetType", null, null);
            }

            if (!(Request.QueryString["action"] == null))
            {
                strPageAction = Request.QueryString["action"];
            }
            // RedirectFromPage: To display only child folders & NOT content.
            if (!(Request.QueryString["from_page"] == null))
            {
                RedirectFromPage = Request.QueryString["from_page"];
            }
            if (RedirectFromPage != "report" && (IsPostBack == false || isPostData.Value != ""))
            {
                FillContentInfo();
            }
            else if (isPostData.Value != "")
            {
                DrawData();
            }
            isPostData.Value = "true";
            if (!(Request.QueryString["report_type"] == null))
            {
                ReportType = Request.QueryString["report_type"];
            }

            SetJsServerVariables();

        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }
Esempio n. 12
0
 private void Page_Init(System.Object sender, System.EventArgs e)
 {
     m_refContent = new Ektron.Cms.Content.EkContent(m_refContentApi.RequestInformationRef);
     m_reftask = m_refContentApi.EkTaskRef;
     ctlEditor = (Ektron.ContentDesignerWithValidator)LoadControl("../controls/Editor/ContentDesignerWithValidator.ascx");
     pnl_message_editor.Controls.Add(ctlEditor);
     ctlEditor.Visible = false;
     ctlEditor.ID = "content_html";
     ctlEditor.ToolsFile = m_refContentApi.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx?EmoticonSelect=1&WMV=1";
 }
Esempio n. 13
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        try
        {
            CurrentUserId = m_refCommon.RequestInformationRef.UserId;
            m_refMsg = m_refCommon.EkMsgRef;
            Utilities.ValidateUserLogin();
            if (m_refCommon.RequestInformationRef.IsMembershipUser > 0 || CurrentUserId == 0)
            {
                Response.Redirect(m_refCommon.ApplicationPath + "reterror.aspx?info=" + Server.UrlEncode(m_refMsg.GetMessage("msg login cms user")), false);
                return;
            }
            else
            {
                AppImgPath = (string)m_refCommon.AppImgPath;
                EnableMultilingual = System.Convert.ToInt32(m_refCommon.EnableMultilingual);
                displaystylesheet.Text = m_refStyle.GetClientScript();
                if (!String.IsNullOrEmpty(Request.QueryString["action"]))
                {
                    m_strPageAction = Request.QueryString["action"].ToLower();
                }
                Utilities.SetLanguage(m_refCommon);
                m_refContent = m_refCommon.EkContentRef;
                TaxonomyLanguage = System.Convert.ToInt32(m_refCommon.ContentLanguage);

                RegisterResources();
                SetJsServerVariables();

                TaxonomyRequest taxonomy_request_data = null;
                if (Page.IsPostBack)
                {
                    string xml = "";
                    string title = "";
                    title = (string)txttitle.Text;
                    if (textimport.Text.Trim().Length > 0)
                    {
                        xml = (string)textimport.Text;
                    }
                    else
                    {
                        System.IO.Stream stream = fileimport.FileContent;
                        stream.Flush();
                        stream.Position = 0;
                        int FileLen = fileimport.PostedFile.ContentLength;
                        byte[] byteArr = new byte[FileLen + 1]; //= stream.ToArray
                        stream.Read(byteArr, 0, FileLen);
                        xml = System.Convert.ToBase64String(byteArr, 0, byteArr.Length);
                        UTF8Encoding utf8 = new UTF8Encoding();
                        xml = utf8.GetString(Convert.FromBase64String(xml));
                    }
                    if (xml.Trim().Length > 0 && title.Trim().Length > 0)
                    {
                        if (xml.IndexOf("<ArrayOfTaxonomyData ") != -1)
                        {
                            m_intTaxonomyId = m_refContent.ImportTaxonomyCollection(xml.Trim(), title);
                        }
                        else
                        {
                            m_intTaxonomyId = m_refContent.ImportTaxonomy(xml.Trim(), title);
                        }
                        string strConfig = string.Empty;
                        if (!string.IsNullOrEmpty(Request.Form[chkConfigContent.UniqueID]))
                        {
                            strConfig = "0";
                        }
                        if (!string.IsNullOrEmpty(Request.Form[chkConfigUser.UniqueID]))
                        {
                            if (string.IsNullOrEmpty(strConfig))
                            {
                                strConfig = "1";
                            }
                            else
                            {
                                strConfig = strConfig + ",1";
                            }
                        }
                        if (!string.IsNullOrEmpty(Request.Form[chkConfigGroup.UniqueID]))
                        {
                            if (string.IsNullOrEmpty(strConfig))
                            {
                                strConfig = "2";
                            }
                            else
                            {
                                strConfig = strConfig + ",2";
                            }
                        }
                        if (!(string.IsNullOrEmpty(strConfig)))
                        {
                            m_refContent.UpdateTaxonomyConfig(m_intTaxonomyId, strConfig);
                        }
                    }
                    if (m_intTaxonomyId > 0)
                    {
                        Response.Redirect("taxonomy.aspx?reloadtrees=tax", false);
                    }
                    else
                    {
                        textimport.Text = xml;
                        textimport.Attributes.Add("onkeypress", "ClearErr();");
                        textimport.Focus();
                    }
                }
                else
                {
                    if (m_strPageAction == "export")
                    {
                        Response.Clear();
                        Response.Charset = "";
                        Response.ContentType = "text/xml";
                        if (!String.IsNullOrEmpty(Request.QueryString["taxonomyid"]))
                        {
                            m_intTaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
                        }
                        TaxonomyDataCollection col = new TaxonomyDataCollection();
                        LanguageData[] langList = (new SiteAPI()).GetAllActiveLanguages();
                        foreach (LanguageData langitem in langList)
                        {
                            taxonomy_request_data = new TaxonomyRequest();
                            taxonomy_request_data.TaxonomyId = m_intTaxonomyId;
                            taxonomy_request_data.TaxonomyLanguage = langitem.Id;
                            taxonomy_request_data.Depth = -1;
                            taxonomy_request_data.IncludeItems = false;
                            taxonomy_request_data.ReadCount = false;
                            TaxonomyData data = m_refContent.LoadTaxonomy(ref taxonomy_request_data);
                            if (data != null)
                            {
                                col.Add(data);
                            }
                        }

                        string returnXml = (string)(EkXml.Serialize(typeof(TaxonomyDataCollection), col));
                        XmlDocument doc;
                        try
                        {
                            doc = new XmlDocument();
                            doc.LoadXml(returnXml);
                            string[] removablenode = new string[] { "TaxonomyParentId", "TaxonomyLevel", "TaxonomyPath", "TaxonomyCreatedDate", "TaxonomyItemCount", "TaxonomyHasChildren", "TemplateId", "TemplateName", "TemplateInherited", "TemplateInheritedFrom", "TaxonomyType", "Visible", "TaxonomyImage", "TaxonomyItems", "CategoryUrl", "FolderId" };
                            XmlNodeList nodelist = doc.GetElementsByTagName("TaxonomyData");
                            for (int i = 0; i <= nodelist.Count - 1; i++)
                            {
                                XmlNode node = nodelist[i];
                                for (int j = 0; j <= removablenode.Length - 1; j++)
                                {
                                    XmlNode n = node.SelectSingleNode(removablenode[j]);
                                    try
                                    {
                                        n.ParentNode.RemoveChild(n);
                                    }
                                    catch (Exception)
                                    {
                                    }
                                }
                            }
                            returnXml = doc.InnerXml;
                        }
                        catch (Exception)
                        {
                        }
                        Response.Write(returnXml);
                        Response.AddHeader("content-disposition", "attachment; filename=taxonomy_" + m_intTaxonomyId + ".xml");
                    }
                    ViewImportToolBar();
                }
            }
        }
        catch (Exception ex)
        {
            Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message + ".") + "&LangType=" + TaxonomyLanguage), false);
        }
    }
Esempio n. 14
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refContentApi.EkMsgRef;
            AppImgPath = m_refContentApi.AppImgPath;
            AppPath = m_refContentApi.AppPath;
            m_strPageAction = Request.QueryString["action"];
            object refApi = m_refContentApi as object;
            Utilities.SetLanguage(m_refContentApi);
            //Utilities.SetLanguage(m_refContentApi);
            TaxonomyLanguage = m_refContentApi.ContentLanguage;
            if (TaxonomyLanguage == -1)
            {
                TaxonomyLanguage = m_refContentApi.DefaultContentLanguage;
            }
            if (Request.QueryString["taxonomyid"] != null)
            {
                TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            }
            if (Request.QueryString["parentid"] != null)
            {
                TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
            }
            if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "author")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User;
                m_UserType = Ektron.Cms.Common.EkEnumeration.UserTypes.AuthorType;
            }
            else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "member")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User;
                m_UserType = Ektron.Cms.Common.EkEnumeration.UserTypes.MemberShipType;
            }
            else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "cgroup")
            {
                m_ObjectType = Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup;
            }

            if ((Request.QueryString["contFetchType"] != null) && Request.QueryString["contFetchType"].ToLower() != "")
            {
                contentFetchType = Request.QueryString["contFetchType"];
            }
            m_refContent = m_refContentApi.EkContentRef;
            CalendarIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/calendar.png\" alt=\"Calendar Event\">";
            FormsIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\">";
            ContentIcon = "<img src=\"" + m_refContentApi.AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\">";
            pageIcon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/layout.png\" alt=\"Page\">"; //-HC-
            if (this.m_UserType == Ektron.Cms.Common.EkEnumeration.UserTypes.AuthorType)
            {
                UserIcon = "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/user.png\" alt=\"Content\">";
            }
            else
            {
                UserIcon = "<img src=\"" + m_refContentApi.AppPath + "Images/ui/icons/userMembership.png\" alt=\"Content\">";
            }
            if ((Page.IsPostBack && (!string.IsNullOrEmpty(Request.Form[isPostData.UniqueID])) && (m_ObjectType == EkEnumeration.CMSObjectTypes.Content | (m_ObjectType == EkEnumeration.CMSObjectTypes.User & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup & !string.IsNullOrEmpty(Request.Form["itemlist"]) | (m_ObjectType == EkEnumeration.CMSObjectTypes.Folder & !string.IsNullOrEmpty(Request.Form["itemlist"]))))))
            //if (Page.IsPostBack && (Request.Form[isPostData.UniqueID] != "") && (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.Content || (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User && Request.Form["itemlist"] != "") || (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup && Request.Form["itemlist"] != "")))
                {
                if (m_strPageAction == "additem")
                {
                    TaxonomyRequest item_request = new TaxonomyRequest();
                    item_request.TaxonomyId = TaxonomyId;
                    item_request.TaxonomyIdList = Validate(Request.Form["itemlist"]);
                    if (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User)
                    {
                        item_request.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
                    }
                    else if (m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup)
                    {
                        item_request.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.Group;
                    }
                    item_request.TaxonomyLanguage = TaxonomyLanguage;
                    m_refContent.AddTaxonomyItem(item_request);
                }
                else if (m_strPageAction == "addfolder")
                {
                    TaxonomySyncRequest sync_request = new TaxonomySyncRequest();
                    sync_request.TaxonomyId = TaxonomyId;
                    sync_request.SyncIdList = Validate(Request.Form["selectedfolder"]); //Validate(Request.Form("itemlist"))
                    //sync_request.SyncRecursiveIdList = Validate(Request.Form("recursiveidlist"))
                    sync_request.TaxonomyLanguage = TaxonomyLanguage;
                    m_refContent.AddTaxonomySyncFolder(sync_request);
                }
                if (Request.QueryString["iframe"] == "true")
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    Response.Redirect((string) ("taxonomy.aspx?action=view&taxonomyid=" + TaxonomyId));
                }
            }
            else
            {
                FolderId = Convert.ToInt64(Request.QueryString["folderid"]);

                folder_data_col = m_refContent.GetFolderInfoWithPath(FolderId);
                FolderName = folder_data_col["FolderName"].ToString();
                FolderParentId = Convert.ToInt64(folder_data_col["ParentID"].ToString());
                FolderPath = folder_data_col["Path"].ToString();
                folder_request_col = new Collection();
                folder_request_col.Add(FolderId, "ParentID", null, null);
                folder_request_col.Add("name", "OrderBy", null, null);
                folder_data_col = m_refContent.GetAllViewableChildFoldersv2_0(folder_request_col);

                if (m_strPageAction != "additem")
                {
                    if (Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                    {
                        if (Information.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                        {
                            SelectedContentType = System.Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                            m_refContentApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, SelectedContentType.ToString());
                        }
                    }
                    else if (Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
                    {
                        if (Information.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                        {
                            SelectedContentType = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                        }
                    }
                    asset_data = m_refContent.GetAssetSuperTypes();
                }
                RegisterResources();
                TaxonomyToolBar();
                if (! Page.IsPostBack || m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.User || m_ObjectType == Ektron.Cms.Common.EkEnumeration.CMSObjectTypes.CommunityGroup)
                {
                    // avoid redisplay when clicking next/prev buttons
                    DisplayPage();
                }
            }
    }
Esempio n. 15
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);

        cDevice = new CmsDeviceConfiguration(m_refContentApi.RequestInformationRef);

        Packages.EktronCoreJS.Register(this);
        Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaCss);
        Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronWorkareaIeCss, Ektron.Cms.API.Css.BrowserTarget.AllIE);
        Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronFixedPositionToolbarCss);
        Ektron.Cms.API.Css.RegisterCss(this, "csslib/ektron.widgets.selector.css", "EktronWidgetsSelectorCss");

        // add resource text values as needed
        selectTemplate.Text = m_refMsg.GetMessage("lbl pagebuilder select template");
        lblTemplateFile.Text = m_refMsg.GetMessage("lbl pagebuilder template file");
        lblSelectWidgets.Text = m_refMsg.GetMessage("lbl pagebuilder select widgets");
        ltrTemplateMessage.Text = m_refMsg.GetMessage("js template msg");
        Page.Title = (string)(m_refMsg.GetMessage("generic select template"));
        widgetTitle.Text = m_refMsg.GetMessage("lbl pagebuilder widgets title");
        btnSelectNone.Text = m_refMsg.GetMessage("lbl pagebuilder select none");
        btnSelectNone.ToolTip = btnSelectNone.Text;
        btnSelectAll.Text = m_refMsg.GetMessage("lbl pagebuilder select all");
        btnSelectAll.ToolTip = btnSelectAll.Text;
        cbPageBuilderTemplate.Text = m_refMsg.GetMessage("lbl pagebuilder wireframe");
        m_refContent = m_refContentApi.EkContentRef;
        closeDialogLink.ToolTip = m_refMsg.GetMessage("close title");
        try
        {
            if (!Utilities.ValidateUserLogin())
            {
                return;
            }
            if (m_refContentApi.UserId == 0 || m_refContentApi.RequestInformationRef.IsMembershipUser > 0)
            {
                Response.Redirect("login.aspx?fromLnkPg=1", false);
                return;
            }
            m_refMsg = m_refContentApi.EkMsgRef;
            if (!m_refContentApi.IsAdmin())
            {
                if (!m_refContent.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TemplateConfigurations, m_refContent.RequestInformation.UserId, false))
                {
                    Utilities.ShowError((string)(m_refMsg.GetMessage("com: user does not have permission")));
                    return;
                }
            }
            string view = "list";
            if (!String.IsNullOrEmpty(Request.QueryString["view"]))
            {
                view = (string)(Request.QueryString["view"].ToLower());
            }

            if (view != "list" && view != "update" && view != "delete" && view != "add")
            {
                view = "list";
            }

            if (view == "list")
            {
                ViewTemplateList();
            }
            else if (view == "update")
            {
                UpdateTemplate();
            }
            else if (view == "add")
            {
                AddTemplate();
            }
            else if (view == "delete")
            {
                DeleteTemplate();
            }
        }
        catch (Exception ex)
        {
            EkException.ThrowException(ex);
        }
    }
Esempio n. 16
0
    private void ViewRulesetToolBar()
    {
        bool bAdmin = false;
        bool bRuleEditor = false;
        SetAction("view");
        base.SetTitleBarToMessage("lbl ruleset");
        if (m_refContent == null)
        {
            m_refContent = m_refContentApi.EkContentRef;
        }
        bAdmin = m_refContent.IsAllowed(0, 0, "users", "IsAdmin", 0);
        bRuleEditor = m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminRuleEditor), m_refContentApi.UserId, false);

        base.SetTitleBarToString((string)(m_refMsg.GetMessage("alt View Ruleset") + " " + EkFunctions.HtmlEncode(m_aRuleset[0].Name) + ""));
        if (bRuleEditor || bAdmin)
        {
            string buttonId = Guid.NewGuid().ToString();

            base.AddButtonText("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"new\">" + m_refMsg.GetMessage("lbl New") + "</span></td>");

            buttonId = Guid.NewGuid().ToString();

            base.AddButtonText("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"action\">" + m_refMsg.GetMessage("lbl Action") + "</span></td>");

            StringBuilder result = new StringBuilder();
            result.Append("<script type=\"text/javascript\">" + Environment.NewLine);
            result.Append("    var actmenu = new Menu( \"action\" );" + Environment.NewLine);
            result.Append("    actmenu.addItem(\"&nbsp;<img src=\'" + m_refContentApi.AppPath + "images/ui/icons/contentEdit.png\' />&nbsp;&nbsp;" + base.GetMessage("lbl edit ruleset") + "\", function() { window.location.href = \'ruleset.aspx?action=Edit&id=" + m_iID.ToString() + "\' } );" + Environment.NewLine);
            result.Append("    actmenu.addItem(\"&nbsp;<img src=\'" + m_refContentApi.AppPath + "images/ui/icons/cogEdit.png\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl Edit Rule") + "\", function() { RuleWizard.showEditRuleWizard(RuleWizard.getSelectedRule()) } );" + Environment.NewLine);
            result.Append("    actmenu.addItem(\"&nbsp;<img src=\'" + m_refContentApi.AppPath + "images/ui/icons/delete.png\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl Delete Ruleset") + "\", function() { var agree = VerifyDelete(); if(agree === true) {window.location.href = \'ruleset.aspx?action=Remove&id=" + m_iID.ToString() + "\';}} );" + Environment.NewLine);
            result.Append("    actmenu.addItem(\"&nbsp;<img src=\'" + m_refContentApi.AppPath + "images/ui/icons/back.png\' />&nbsp;&nbsp;" + m_refMsg.GetMessage("lbl Back") + "\", function() { window.location.href = \'ruleset.aspx\'} );" + Environment.NewLine);

            result.Append("    MenuUtil.add( actmenu );" + Environment.NewLine);
            //end
            result.Append("    </script>" + Environment.NewLine);
            ltrrulejs.Text = result.ToString();
        }
        base.AddHelpButton("view_ruleset");
    }
Esempio n. 17
0
 private void ShowRulesetToolBar()
 {
     bool bAdmin = false;
     bool bRuleEditor = false;
     base.SetTitleBarToMessage("lbl ruleset");
     if (m_refContent == null)
     {
         m_refContent = m_refContentApi.EkContentRef;
     }
     bAdmin = m_refContent.IsAllowed(0, 0, "users", "IsAdmin", 0);
     bRuleEditor = m_refContent.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminRuleEditor), m_refContentApi.UserId, false);
     if (bRuleEditor || bAdmin)
     {
         base.AddButton(m_refContentApi.AppPath + "images/UI/Icons/add.png", "ruleset.aspx?action=Add", m_refMsg.GetMessage("alt addruleset"), m_refMsg.GetMessage("btn addruleset"), "", StyleHelper.AddButtonCssClass, true);
     }
     base.AddHelpButton("view_rulesets");
 }
Esempio n. 18
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        try
        {
            Response.CacheControl = "no-cache";
            Response.AddHeader("Pragma", "no-cache");
            Response.Expires = -1;
            CurrentUserId = m_refCommon.RequestInformationRef.UserId;
            m_refContent = m_refCommon.EkContentRef;
            m_refMsg = m_refCommon.EkMsgRef;
            RegisterResources();
            Utilities.ValidateUserLogin();
            if ((m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || (!m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff))) && (!m_refContentApi.IsAdmin()))
            {
                Response.Redirect("../reterror.aspx?info=" + m_refContentApi.EkMsgRef.GetMessage("msg login xliff administrator"), false);
                return;
            }
            else
            {
                AppImgPath = m_refCommon.AppImgPath;
                AppPath = m_refCommon.AppPath;
                litAppPath.Text = AppPath;
                EnableMultilingual = m_refCommon.EnableMultilingual;
                displaystylesheet.Text = m_refStyle.GetClientScript();
                if ((Request.QueryString["action"] != null && !string.IsNullOrEmpty(Request.QueryString["action"])))
                {
                    m_strPageAction = Request.QueryString["action"].ToLower();
                }
                Utilities.SetLanguage(m_refCommon);

                TaxonomyLanguage = m_refCommon.ContentLanguage;
                if ((Page.IsPostBack))
                {
                    if (((Request.Form[submittedaction.UniqueID]) == "deleteSelected"))
                    {
                        TaxonomyRequest taxonomy_request_data = new TaxonomyRequest();
                        taxonomy_request_data.TaxonomyIdList = Request.Form["selected_taxonomy"];
                        taxonomy_request_data.TaxonomyLanguage = TaxonomyLanguage;
                        m_refContent.DeleteTaxonomy(taxonomy_request_data);
                        Response.Redirect("LocaleTaxonomy.aspx?rf=1", false);
                    }
                }
                switch (m_strPageAction)
                {
                    case "add":
                        addLocaleTaxonomy m_at = default(addLocaleTaxonomy);
                        m_at = (addLocaleTaxonomy)LoadControl("../controls/localetaxonomy/addLocaleTaxonomy.ascx");
                        m_at.ID = "taxonomy";
                        DataHolder.Controls.Add(m_at);
                        break;

                    case "edit":
                    case "reorder":
                        editLocaleTaxonomy m_et = default(editLocaleTaxonomy);
                        m_et = (editLocaleTaxonomy)LoadControl("../controls/localetaxonomy/editLocaleTaxonomy.ascx");
                        m_et.ID = "taxonomy";
                        DataHolder.Controls.Add(m_et);
                        break;
                    case "view":
                        viewLocaletaxonomy m_vt = default(viewLocaletaxonomy);
                        m_vt = (viewLocaletaxonomy)LoadControl("../controls/localetaxonomy/viewLocaletaxonomy.ascx");
                        m_vt.ID = "taxonomy";
                        DataHolder.Controls.Add(m_vt);
                        break;
                    case "viewcontent":
                    case "removeitems":
                        Control m_vi = default(Control);

                        m_vi = (Control)LoadControl("../controls/localetaxonomy/viewLocaleTaxonomyItems.ascx");
                        m_vi.ID = "taxonomy";
                        DataHolder.Controls.Add(m_vi);
                        break;
                    case "viewattributes":
                        Control m_va = default(Control);
                        m_va = (Control)LoadControl("../controls/localetaxonomy/viewLocaleTaxonomyAttributes.ascx");
                        m_va.ID = "taxonomy";
                        DataHolder.Controls.Add(m_va);
                        break;
                    case "additem":
                    case "addfolder":
                        if ((m_strPageAction == "addfolder"))
                        {
                            //body.Attributes.Add("onload", "Main.start();displayTreeFolderSelect();showSelectedFolderTree();setupClassNames();")
                            body.Attributes.Add("onload", "Main.start();displayTreeFolderSelect();showSelectedFolderTree();setupClassNames();");
                        }

                        assignLocaleTaxonomy m_asnt = default(assignLocaleTaxonomy);
                        m_asnt = (assignLocaleTaxonomy)LoadControl("../controls/localetaxonomy/assignLocaleTaxonomy.ascx");
                        m_asnt.ID = "taxonomy";
                        DataHolder.Controls.Add(m_asnt);

                        break;
                    default:
                        div_taxonomylist.Visible = true;
                        if ((IsPostBack == false || (IsPostBack == true & !string.IsNullOrEmpty(Request.Form[isSearchPostData.UniqueID]))))
                        {
                            //ViewAllTaxonomy();
                            ViewAllToolBar();
                        }
                        break;
                }

                //if ((Request.QueryString["rf"] == "1"))
                //{
                //    litRefreshAccordion.Text = "<script language=\"javascript\">" + "\n" + "top.refreshTaxonomyAccordion(" + TaxonomyLanguage + ");" + "\n" + "</script>" + "\n";
                //}

            }
            SetJsServerVariables();
        }
        catch (System.Threading.ThreadAbortException)
        {
            //Do nothing
        }
        catch (Exception ex)
        {
            Response.Redirect("../reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message + ".") + "&LangType=" + TaxonomyLanguage, false);
        }
    }
Esempio n. 19
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        //Put user code to initialize the page here
        //string var1 = "";
        string var2 = "";

        if (!string.IsNullOrEmpty(Request.QueryString["fromModal"]))
        {

            fromModal = Convert.ToBoolean(Request.QueryString["fromModal"]);
            commerceAdmin = m_refSiteApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin);
            cancelJavascript = "if ('function' == typeof parent.EktronUiDialogClose) { parent.EktronUiDialogClose('email'); } else { parent.ektb_remove(); }";

        }

        RegisterResources();
        m_refMsg = m_refSiteApi.EkMsgRef;
        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        if (m_refSiteApi.RequestInformationRef.IsMembershipUser > 0)
        {
            Response.Redirect((string)("reterror.aspx?info=" + m_refSiteApi.EkMsgRef.GetMessage("msg login cms user")), true);
            return;
        }
        ContentLanguage = m_refSiteApi.ContentLanguage;
        if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || ContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
        {
            ContentLanguage = m_refSiteApi.DefaultContentLanguage;
        }
        language_data = m_refSiteApi.GetLanguageById(ContentLanguage);
        BrowserCode = language_data.BrowserCode;
        strTargUserEmail = "";
        strUserFName = "";
        strUserLName = "";
        globalWarningMsg = "";
        iMaxContLength = 65000;
        localeFileString = "0000";
        m_refUser = m_refSiteApi.EkUserRef;
        m_refContent = m_refSiteApi.EkContentRef;
        UserId = Convert.ToInt64(Request.QueryString["userid"]);
        GroupId = Convert.ToInt64(Request.QueryString["groupid"]);

        UserArray = Request.QueryString["userarray"];
        GroupArray = Request.QueryString["grouparray"];
        MsgNotes = Request.QueryString["notes"];
        ContentId = Convert.ToInt64(Request.QueryString["contentid"]);
        emailclangid = Request.QueryString["emailclangid"];
        target = Request.Form["target"];
        source = Request.Form["source"];
        subject = Request.Form["subject"];
        sMessage = this.message.Content;
        AppeWebPath = m_refSiteApi.ApplicationPath + m_refSiteApi.AppeWebPath;
        var2 = m_refContent.GetEditorVariablev2_0(0, "email");
        EmailData.Text += m_refMail.EmailJS();
        DisplayControl();
    }
Esempio n. 20
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refApi.EkMsgRef;
        AppImgPath = m_refApi.AppImgPath;
        m_strPageAction = Request.QueryString["action"];
        object refAPI = m_refApi as object;
        Utilities.SetLanguage(m_refApi);
        TaxonomyLanguage = m_refApi.ContentLanguage;
        if ((TaxonomyLanguage == -1))
        {
            TaxonomyLanguage = m_refApi.DefaultContentLanguage;
        }
        if ((Request.QueryString["taxonomyid"] != null))
        {
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            hdnTaxonomyId.Value = TaxonomyId.ToString();
        }
        if ((Request.QueryString["parentid"] != null))
        {
            TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
        }
        m_refContent = m_refApi.EkContentRef;
        if ((Request.QueryString["reorder"] != null))
        {
            m_strReorderAction = Convert.ToString(Request.QueryString["reorder"]);
        }
        if ((Request.QueryString["view"] != null))
        {
            _ViewItem = Request.QueryString["view"];
        }
        if ((Page.IsPostBack))
        {
            if ((m_strPageAction == "edit"))
            {
                taxonomy_data.TaxonomyLanguage = TaxonomyLanguage;
                taxonomy_data.TaxonomyParentId = TaxonomyParentId;
                taxonomy_data.TaxonomyId = TaxonomyId;
                taxonomy_data.TaxonomyDescription = Request.Form[taxonomydescription.UniqueID];
                taxonomy_data.TaxonomyName = Request.Form[taxonomytitle.UniqueID];
                // taxonomy_data.TaxonomyImage = Request.Form[taxonomy_image.UniqueID];
                //  taxonomy_data.CategoryUrl = Request.Form[categoryLink.UniqueID];
                //if (tr_enableDisable.Visible == true)
                //{
                //    if (!string.IsNullOrEmpty(Request.Form[chkEnableDisable.UniqueID]))
                //    {
                //        taxonomy_data.Visible = true;
                //    }
                //    else
                //    {
                //        taxonomy_data.Visible = false;
                //    }
                //}
                //else
                //{
                //    taxonomy_data.Visible = Convert.ToBoolean(Request.Form[visibility.UniqueID]);
                //}
                //if ((Request.Form[inherittemplate.UniqueID] != null))
                //{
                //    taxonomy_data.TemplateInherited = true;
                //}
                //if ((Request.Form[taxonomytemplate.UniqueID] != null))
                //{
                //    taxonomy_data.TemplateId = Convert.ToInt64(Request.Form[taxonomytemplate.UniqueID]);
                //}
                //else
                //{
                //    taxonomy_data.TemplateId = 0;
                //}

                try
                {
                    m_refContent.UpdateTaxonomy(taxonomy_data);
                }
                catch (Exception ex)
                {
                    Utilities.ShowError(ex.Message);
                }
                //if (((Request.Form[chkApplyDisplayAllLanguages.UniqueID] != null)) && (Request.Form[chkApplyDisplayAllLanguages.UniqueID].ToString().ToLower() == "on"))
                //{
                //    m_refContent.UpdateTaxonomyVisible(TaxonomyId, -1, taxonomy_data.Visible);
                //}
                //else
                //{
                //    m_refContent.UpdateTaxonomyVisible(TaxonomyId, TaxonomyLanguage, taxonomy_data.Visible);
                //}
                if ((TaxonomyParentId == 0))
                {
                    string strConfig = string.Empty;
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigContent.UniqueID])))
                    //{
                    //    strConfig = "0";
                    //}
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigUser.UniqueID])))
                    //{
                    //    if ((string.IsNullOrEmpty(strConfig)))
                    //    {
                    //        strConfig = "1";
                    //    }
                    //    else
                    //    {
                    //        strConfig = strConfig + ",1";
                    //    }
                    //}
                    //if ((!string.IsNullOrEmpty(Request.Form[chkConfigGroup.UniqueID])))
                    //{
                    //    if ((string.IsNullOrEmpty(strConfig)))
                    //    {
                    //        strConfig = "2";
                    //    }
                    //    else
                    //    {
                    //        strConfig = strConfig + ",2";
                    //    }
                    //}
                    //if ((!(string.IsNullOrEmpty(strConfig))))
                    //{
                    //    m_refContent.UpdateTaxonomyConfig(TaxonomyId, strConfig);
                    //}
                }
                UpdateCustomProperties();

                if ((Request.QueryString["iframe"] == "true"))
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    if ((Request.QueryString["backaction"] != null && Convert.ToString(Request.QueryString["backaction"]).ToLower() == "viewtree"))
                    {
                        Response.Redirect("LocaleTaxonomy.aspx?action=viewtree&taxonomyid=" + TaxonomyId + "&LangType=" + TaxonomyLanguage, true);
                    }
                    else if (Request.QueryString["view"] != null)
                    {
                        Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" +Convert.ToString(Request.QueryString["view"]) + "&taxonomyid=" + TaxonomyId + "&rf=1", true);
                    }
                    else
                    {
                        Response.Redirect("LocaleTaxonomy.aspx?action=view&view=item&taxonomyid=" + TaxonomyId + "&rf=1", true);
                    }
                }
            }
            else
            {
                if ((!string.IsNullOrEmpty(Request.Form[LinkOrder.UniqueID])))
                {
                    taxonomy_request = new TaxonomyRequest();
                    taxonomy_request.TaxonomyId = TaxonomyId;
                    taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
                    taxonomy_request.TaxonomyIdList = Request.Form[LinkOrder.UniqueID];
                    if (!string.IsNullOrEmpty(Request.Form[chkOrderAllLang.UniqueID]))
                    {
                        if ((m_strReorderAction == "category"))
                        {
                            m_refContent.ReOrderAllLanguageCategories(taxonomy_request);
                        }
                    }
                    else
                    {
                        if ((m_strReorderAction == "category"))
                        {
                            m_refContent.ReOrderCategories(taxonomy_request);
                        }
                        else
                        {
                            m_refContent.ReOrderTaxonomyItems(taxonomy_request);
                        }
                    }
                }
                if ((Request.QueryString["iframe"] == "true"))
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&type="+ Request.QueryString["type"]+"&taxonomyid=" + TaxonomyId + "&rf=1", true);
                }
            }
        }
        else
        {
            //ltr_sitepath.Text = m_refApi.SitePath;
            taxonomy_request = new TaxonomyRequest();
            taxonomy_request.TaxonomyId = TaxonomyId;
            taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;

            if ((m_strPageAction == "edit"))
            {
                taxonomy_data = m_refContent.ReadTaxonomy(ref taxonomy_request);

                taxonomydescription.Text = taxonomy_data.TaxonomyDescription;
                taxonomytitle.Text = taxonomy_data.TaxonomyName;
                //  taxonomy_image.Text = taxonomy_data.TaxonomyImage;
                // taxonomy_image_thumb.ImageUrl = taxonomy_data.TaxonomyImage;
                //   categoryLink.Text = taxonomy_data.CategoryUrl;
                visibility.Value = taxonomy_data.Visible.ToString();
                if ((Request.QueryString["taxonomyid"] != null))
                {
                    TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
                }

                if (TaxonomyParentId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyParentId, TaxonomyLanguage);
                }
                else if (TaxonomyId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyId, TaxonomyLanguage);
                }

                // ' why in the world would you disable the visible flag if it's not synchronized???
                //If Not m_bSynchronized Then
                //tr_enableDisable.Visible = False
                //End If

                //if (taxonomy_data.Visible == true)
                //{
                //    chkEnableDisable.Checked = true;
                //}
                //else
                //{
                //    chkEnableDisable.Checked = false;
                //}
                //if (!string.IsNullOrEmpty(taxonomy_data.TaxonomyImage))
                //{
                //    taxonomy_image_thumb.ImageUrl = (taxonomy_data.TaxonomyImage.IndexOf("/") == 0 ? taxonomy_data.TaxonomyImage : m_refApi.SitePath + taxonomy_data.TaxonomyImage);
                //}
                //else
                //{
                //    taxonomy_image_thumb.ImageUrl = m_refApi.AppImgPath + "spacer.gif";
                //}
                //language_data = (new SiteAPI()).GetLanguageById(TaxonomyLanguage);
                ////if ((taxonomy_data.TaxonomyParentId == 0))
                //{
                //    inherittemplate.Visible = false;
                //    lblInherited.Text = "No";
                //    inherittemplate.Checked = taxonomy_data.TemplateInherited;
                //}
                //else
                //{
                //    inherittemplate.Visible = true;
                //    lblInherited.Text = "";
                //    inherittemplate.Checked = taxonomy_data.TemplateInherited;
                //    if ((taxonomy_data.TemplateInherited))
                //    {
                //        taxonomytemplate.Enabled = false;
                //    }
                //}
                //TemplateData[] templates = null;
                //templates = m_refApi.GetAllTemplates("TemplateFileName");
                //taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem("-select template-", "0"));
                //if ((templates != null && templates.Length > 0))
                //{
                //    for (int i = 0; i <= templates.Length - 1; i++)
                //    {
                //        taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem(templates[i].FileName, templates[i].Id.ToString()));
                //        if ((taxonomy_data.TemplateId == templates[i].Id))
                //        {
                //            taxonomytemplate.SelectedIndex = i + 1;
                //        }
                //    }
                //}
                if (((language_data != null) && (m_refApi.EnableMultilingual == 1)))
                {
                    lblLanguage.Text = "[" + language_data.Name + "]";
                }
                m_strCurrentBreadcrumb = taxonomy_data.TaxonomyPath.Remove(0, 1).Replace("\\", " > ");
                if ((string.IsNullOrEmpty(m_strCurrentBreadcrumb)))
                {
                    m_strCurrentBreadcrumb = "Root";
                }
                //admin inherittemplate.Attributes.Add("onclick", "OnInheritTemplateClicked(this)");
                if ((TaxonomyParentId == 0))
                {
                    //tr_config.Visible = true;
                    //List<Int32> config_list = m_refApi.EkContentRef.GetAllConfigIdListByTaxonomy(TaxonomyId, TaxonomyLanguage);
                    //for (int i = 0; i <= config_list.Count - 1; i++)
                    //{
                    //    if ((config_list[i] == 0))
                    //    {
                    //        chkConfigContent.Checked = true;
                    //    }
                    //    else if ((config_list[i] == 1))
                    //    {
                    //        chkConfigUser.Checked = true;
                    //    }
                    //    else if ((config_list[i] == 2))
                    //    {
                    //        chkConfigGroup.Checked = true;
                    //    }
                    //}
                }
                else
                {
                    //  tr_config.Visible = false;
                }
                LoadCustomPropertyList();
            }
            else
            {
                if ((m_strReorderAction == "category"))
                {
                    taxonomy_request.PageSize = 99999999;
                    // pagesize of 0 used to mean "all"
                    taxonomy_arr = m_refContent.ReadAllSubCategories(taxonomy_request);
                    if ((taxonomy_arr != null))
                    {
                        TotalItems = taxonomy_arr.Length;
                    }
                    else
                    {
                        TotalItems = 0;
                    }
                    if ((TotalItems > 1))
                    {
                        td_msg.Text = m_refMsg.GetMessage("generic first msg");
                        OrderList.DataSource = taxonomy_arr;
                        OrderList.DataTextField = "TaxonomyName";
                        OrderList.DataValueField = "TaxonomyId";
                        OrderList.DataBind();
                        OrderList.SelectionMode = ListSelectionMode.Multiple;
                        OrderList.CssClass = "width: 100%; border-style: none; border-color: White; font-family: Verdana;font-size: x-small;";
                        if ((TotalItems > 20))
                        {
                            OrderList.Rows = 20;
                        }
                        else
                        {
                            OrderList.Rows = TotalItems;
                        }
                        OrderList.Width = 300;
                        if ((TotalItems > 0))
                        {
                            loadscript.Text = "document.forms[0].taxonomy_OrderList[0].selected = true;";
                        }
                        for (int i = 0; i <= taxonomy_arr.Length - 1; i++)
                        {
                            if ((string.IsNullOrEmpty(LinkOrder.Value)))
                            {
                                LinkOrder.Value = Convert.ToString(taxonomy_arr[i].TaxonomyId);
                            }
                            else
                            {
                                LinkOrder.Value = Convert.ToString(taxonomy_arr[i].TaxonomyId) + ",";
                            }
                        }
                    }
                    else
                    {
                        LoadNoItem();
                    }
                }
                else
                {
                    AllLangForm.Visible = false;
                    // the all languages checkbox is only valid for categories
                    taxonomy_request.PageSize = 99999999;
                    taxonomy_request.IncludeItems = true;
                    taxonomy_data = m_refContent.ReadTaxonomy(ref taxonomy_request);
                    tr_ordering.Visible = true;
                    //Not showing for items
                    if ((taxonomy_data.TaxonomyItems != null))
                    {
                        TotalItems = taxonomy_data.TaxonomyItems.Length;
                        if ((TotalItems > 1))
                        {
                            td_msg.Text = m_refMsg.GetMessage("generic first msg");
                            OrderList.DataSource = taxonomy_data.TaxonomyItems;
                            OrderList.DataTextField = "TaxonomyItemTitle";
                            OrderList.DataValueField = "TaxonomyItemId";
                            OrderList.DataBind();
                            OrderList.SelectionMode = ListSelectionMode.Multiple;
                            OrderList.CssClass = "width: 100%; border-style: none; border-color: White; font-family: Verdana;font-size: x-small;";
                            if ((TotalItems > 20))
                            {
                                OrderList.Rows = 20;
                            }
                            else
                            {
                                OrderList.Rows = TotalItems;
                            }
                            OrderList.Width = 300;
                            if ((TotalItems > 0))
                            {
                                loadscript.Text = "document.forms[0].taxonomy_OrderList[0].selected = true;";
                            }
                            foreach (TaxonomyItemData taxonomy_item in taxonomy_data.TaxonomyItems)
                            {
                                if ((string.IsNullOrEmpty(LinkOrder.Value)))
                                {
                                    LinkOrder.Value = Convert.ToString(taxonomy_item.TaxonomyItemId);
                                }
                                else
                                {
                                    LinkOrder.Value = Convert.ToString(taxonomy_item.TaxonomyItemId) + ",";
                                }
                            }
                        }
                        else
                        {
                            LoadNoItem();
                        }
                    }
                }
            }
            TaxonomyToolBar();
        }
    }
Esempio n. 21
0
 public threadeddisc_emoticon_select()
 {
     getEmoticons = m_refContentApi.EkContentRef;
        // aRep = Array.CreateInstance(typeof(Ektron.Cms.ReplaceWord), 0);
 }
Esempio n. 22
0
    private void PopulateCategory(string Action)
    {
        LibraryData library_data;
        FolderData fold_data;

        m_intTaxFolderId = _FolderId;
        _EkContent = _ContentApi.EkContentRef;
        _CurrentUserID = _ContentApi.UserId;

        _PermissionData = _ContentApi.LoadPermissions(_FolderId, "content", 0);
        library_data = _ContentApi.GetLibraryItemByID(_Id, _FolderId);
        fold_data = _ContentApi.GetFolderById(_FolderId);
        if (_Type == "images" || _Type == "files")
        {
            if (fold_data.CategoryRequired == true && _EkContent.GetAllFolderTaxonomy(_FolderId).Length > 0)
            {
                jsCategoryrequired.Text = "true";
            }
        }

        if (_PermissionData.IsAdmin || _EkContent.IsARoleMember(Convert.ToInt64( Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator),_CurrentUserID,false))
        {
            TaxonomyRoleExists = true;
        }
        TaxonomyBaseData[] taxonomy_cat_arr = null;
        if (Action != "add")
        {
            taxonomy_cat_arr = _EkContent.ReadAllAssignedCategory(library_data.ContentId);
            if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0)
            {
                foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr)
                {
                    if (taxonomyselectedtree.Value == "")
                    {
                        taxonomyselectedtree.Value = Convert.ToString(taxonomy_cat.TaxonomyId);
                    }
                    else
                    {
                        taxonomyselectedtree.Value = taxonomyselectedtree.Value + "," + Convert.ToString(taxonomy_cat.TaxonomyId);
                    }
                }
            }
            TaxonomyTreeIdList = (string)taxonomyselectedtree.Value;
            if (TaxonomyTreeIdList.Trim().Length > 0)
            {
                TaxonomyTreeParentIdList = _EkContent.ReadDisableNodeList(library_data.ContentId);
            }
        }
        else
        {
            if (TaxonomySelectId > 0)
            {
                taxonomyselectedtree.Value = Convert.ToString( TaxonomySelectId);
                TaxonomyTreeIdList = (string)taxonomyselectedtree.Value;
                taxonomy_cat_arr = _EkContent.GetTaxonomyRecursiveToParent(TaxonomySelectId, _EkContent.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.TaxonomyId);
                        }
                        else
                        {
                            TaxonomyTreeParentIdList = TaxonomyTreeParentIdList + "," + Convert.ToString(taxonomy_cat.TaxonomyId);
                        }
                    }
                }
            }
        }

        TaxonomyRequest taxonomy_request = new TaxonomyRequest();
        TaxonomyBaseData[] taxonomy_data_arr = null;
        Utilities.SetLanguage(_ContentApi);
        taxonomy_request.TaxonomyId = _FolderId;
        taxonomy_request.TaxonomyLanguage = _ContentApi.ContentLanguage;
        taxonomy_data_arr = _EkContent.GetAllFolderTaxonomy(_FolderId);
        foreach (TaxonomyBaseData tax_node in taxonomy_data_arr)
        {
            _SelectedTaxonomyList = _SelectedTaxonomyList + tax_node.TaxonomyId;
            _SelectedTaxonomyList += ",";
        }
        //Hiding the Category tab if no taxonomy is applied for the folder or if user requires the category tab to be hidden
        bool HideCategoryTab = false;
        if (!string.IsNullOrEmpty(Request.QueryString["HideCategoryTab"] ))
        {
            HideCategoryTab = Convert.ToBoolean(Request.QueryString["HideCategoryTab"]);
        }
        if (HideCategoryTab || (taxonomy_data_arr == null || taxonomy_data_arr.Length == 0) && (TaxonomyOverrideId == 0))
        {
            //TODO: Ross - Not sure why, but the tab was set to non-visible in either case...odd!!
            //if (Action == "add" || _Operation == "overwrite")
            //{
                //TODO: Ross - Don't have "add" tabs yet
                phAddCategoryTab.Visible = false;
                phCategory.Visible = false;
                phCategory2.Visible = false;
            //}
        }
    }
Esempio n. 23
0
    protected string CallbackDoAction(string key, Dictionary<string, string> data)
    {
        InitFromCallback(data);
        string what = data["action"];
        string sselected = data["selected"];
        List<long> selected = sselected.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList().ConvertAll<long>(new Converter<string, long>(delegate(string s) { return long.Parse(s); }));

        Ektron.Cms.CommonApi commonApi = new CommonApi();
        Ektron.Cms.Content.EkContent contentManager = new Ektron.Cms.Content.EkContent(commonApi.RequestInformationRef);
        Ektron.Cms.API.Content.Content capi = new Ektron.Cms.API.Content.Content();
        Ektron.Cms.Framework.Localization.LocaleManager localeApi = new Ektron.Cms.Framework.Localization.LocaleManager();
        Ektron.Cms.Framework.Localization.LocalizationObject lobjApi = new Ektron.Cms.Framework.Localization.LocalizationObject();
        Ektron.Cms.API.Content.Taxonomy taxonomyApi = new Ektron.Cms.API.Content.Taxonomy();

        string title = string.Empty, html = string.Empty, okclick = string.Empty, action = string.Empty;

        switch (what)
        {
            case "locales":
                {
                    action = "showmodal";
                    bool? addRemoveReplace = null;
                    if (data.ContainsKey("mode"))
                        if (data["mode"] == "add")
                            addRemoveReplace = true;
                        else if (data["mode"] == "del")
                            addRemoveReplace = false;
                    title = (addRemoveReplace == null ? this.GetMessage("lbl Change selected locales") :
                        (addRemoveReplace == true ? "Add locale(s)" : "Remove locale(s)"))
                        + " " + this.GetMessage("generic for") + " " + (selected.Count == 1 ? "1 item" : (selected.Count.ToString() + " " + this.GetMessage("generic items")));
                    html = GenerateLocaleList(selected, CurrentLanguageId, addRemoveReplace);
                    okclick = this.ClientID + (addRemoveReplace == null ? "_LocaleSet" : (addRemoveReplace == true ? "_LocaleAdd" : "_LocaleDel"));
                }
                break;
            case "localeset":
                {
                    List<int> locales = data["locales"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList<string>().ConvertAll<int>(new Converter<string, int>(delegate(string s) { return int.Parse(s); }));
                    bool? addRemoveReplace = null;
                    if (data.ContainsKey("mode"))
                        if (data["mode"] == "add")
                            addRemoveReplace = true;
                        else if (data["mode"] == "del")
                            addRemoveReplace = false;
                    SetLocales(selected, locales, CurrentLanguageId, addRemoveReplace);
                    action = "hidemodal";
                    title = "";
                    Fill();
                    html = RenderControl(plcRenderMe);
                    okclick = "";
                }
                break;
            case "transstatus":
                {
                    action = "showmodal";
                    title = "Set Translation Readiness";
                    // ##TODO: Check current translation status
                    html = RenderControl(pnlSetTransStatus);
                    okclick = this.ClientID + "_TransStatusSet";
                }
                break;
            case "settranstatus":
                {
                    string status = data["status"].ToLower();
                    foreach (long id in selected)
                    {
                        Ektron.Cms.Localization.LocalizableCmsObjectType objectType = Ektron.Cms.Localization.LocalizableCmsObjectType.Content;
                        Ektron.Cms.Framework.Localization.LocalizationObject lobj = new Ektron.Cms.Framework.Localization.LocalizationObject();
                        switch (status)
                        {
                            case "ready":
                                lobjApi.MarkReadyForTranslation(objectType, id, CurrentLanguageId);
                                break;
                            case "notready":
                                lobjApi.MarkNotReadyForTranslation(objectType, id, CurrentLanguageId);
                                break;
                            case "donottranslate":
                                lobjApi.MarkDoNotTranslate(objectType, id, CurrentLanguageId);
                                break;
                        }
                    }
                    action = "hidemodal";
                    title = string.Empty;
                    Fill();
                    html = RenderControl(plcRenderMe);
                    okclick = string.Empty;
                }
                break;
            case "notes":
                {
                    action = "showmodal";
                    title = "Add notes for " + (selected.Count == 1 ? "1 item" : (selected.Count.ToString() + " items"));
                    lNoteN.Visible = selected.Count > 1;

                    if (selected.Count == 1) // Load notes if there is only one piece of content
                    {
                        // ##TODO: Add this!
                    }
                    html = RenderControl(pnlNotes);
                    okclick = this.ClientID + "_NotesSet";
                }
                break;
            case "setnotes":
                {
                    string notes = data["notes"];

                    long metadataId = commonApi.EkContentRef.GetMetadataTypeId("XliffNote", CurrentLanguageId, 0);

                    foreach (long cid in selected)
                    {
                        capi.UpdateContentMetaData(cid, metadataId, notes);
                    }

                    action = "hidemodal";
                    title = string.Empty;
                    Fill();
                    html = RenderControl(plcRenderMe);
                    okclick = string.Empty;
                }
                break;
            case "pseudo":
                {
                    action = "showmodal";
                    title = "Pseudo Localize " + (selected.Count == 1 ? "1 item" : (selected.Count.ToString() + " items")) + ".";

                    Ektron.Cms.Framework.Localization.LocaleManager locale = new Ektron.Cms.Framework.Localization.LocaleManager();
                    List<Ektron.Cms.Localization.LocaleData> pseudoLocales = locale.GetEnabledLocales().FindAll(d => d.XmlLang.Contains("-x-pseudo"));

                    if (pseudoLocales.Count > 0)
                        foreach (Ektron.Cms.Localization.LocaleData pseudoLocale in pseudoLocales)
                        {
                            CheckBox pseudoLoc = new CheckBox()
                            {
                                ID = "chkPS" + pseudoLocale.Id.ToString(),
                                Checked = true,
                                Text = pseudoLocale.Loc + " " + pseudoLocale.EnglishName
                            };
                            pnlPseudo.Controls.Add(pseudoLoc);
                            pnlPseudo.Controls.Add(new LiteralControl("<br />"));
                        }
                    else
                        lblPseudoInstructions.Text = "There are no Pseudo localization enabled locales.";

                    html = RenderControl(pnlPseudo);
                    okclick = this.ClientID + "_PseudoSet";
                }
                break;
            case "setpseudo":
                {
                    action = "showmodal";
                    title = "Pseudo Localize " + (selected.Count == 1 ? "1 item" : (selected.Count.ToString() + " items")) + ".";

                    string selectedIds = string.Join(",", selected.ConvertAll<string>(delegate(long i) { return i.ToString(); }).ToArray());
                    string pseudoLocaleIds = data["locales"];

                    ektronExportPseudoIframe.Attributes["src"] = "widgets/Modal/localizationjobs.aspx?action=pseudo&contentIds=" + selectedIds + "&languageIds=" + pseudoLocaleIds;
                    html = RenderControl(pnlSetPseudo);
                    okclick = this.ClientID + "_PseudoReset";
                }
                break;
            case "pseudocomplete":
                {
                    action = "hidemodal";
                    title = string.Empty;
                    Fill();
                    html = RenderControl(plcRenderMe);
                    okclick = string.Empty;
                }
                break;
            default:
                {
                    action = "showmodal";
                    title = "Invalid selection";
                    html = "The option that was selected is not available.";
                    okclick = this.ClientID + "_CloseModalDialog";
                }
                break;
        }

        Dictionary<string, string> output = new Dictionary<string, string>();
        output["action"] = action;
        output["title"] = title;
        output["html"] = html;
        output["okclick"] = okclick;

        return ConvertDictionaryToQueryString(output);
    }
Esempio n. 24
0
    public bool Display()
    {
        m_intId = 0;
        if (((Request.QueryString["id"] != null)))
        {
            m_intId = Convert.ToInt64(Request.QueryString["id"]);
        }
        if ((IsPostBack))
        {
            m_strPageAction = Request.Form["action"].Trim().ToLower();
        }
        else if (((Request.QueryString["action"] != null)))
        {
            m_strPageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim();
        }
        if ((IsPostBack && (ddlSourceLanguage != null) && ddlSourceLanguage.Items.Count > 0))
        {
            // SourceLanguageList.SelectedValue doesn't work, not sure why, may be viewstate
            // or b/c its a user control that's losing state
            string strSrcLang = Request.Form[ddlSourceLanguage.UniqueID].Trim();
            if ((Information.IsNumeric(strSrcLang)))
            {
                ContentLanguage = Convert.ToInt32(strSrcLang);
            }
        }
        else if (((Request.QueryString["LangType"] != null)))
        {
            if ((!string.IsNullOrEmpty(Request.QueryString["LangType"])))
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                this.CommonApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (!string.IsNullOrEmpty(this.CommonApi.GetCookieValue("LastValidLanguageID")))
                {
                    ContentLanguage = Convert.ToInt32(this.CommonApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (!string.IsNullOrEmpty(this.CommonApi.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(this.CommonApi.GetCookieValue("LastValidLanguageID"));
            }
        }
        if ((Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED == ContentLanguage | Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES == ContentLanguage))
        {
            ContentLanguage = this.CommonApi.DefaultContentLanguage;
        }
        this.CommonApi.ContentLanguage = ContentLanguage;
        m_objLocalizationApi.ContentLanguage = ContentLanguage;

        //language_data = m_refSiteApi.GetLanguageById(ContentLanguage);
        //LanguageName = language_data.Name;
        m_refContent = this.CommonApi.EkContentRef;

        CurrentUserId = this.CommonApi.UserId;
        AppImgPath = this.CommonApi.AppImgPath;
        AppPath = this.CommonApi.AppPath;
        SitePath = this.CommonApi.SitePath;
        EnableMultilingual = this.CommonApi.EnableMultilingual;
        if ((!((Request.QueryString["callerpage"] == null))))
        {
            CallerPage = Request.QueryString["callerpage"];
        }

        if ((string.IsNullOrEmpty(CallerPage)))
        {
            if ((!((Request.QueryString["calledfrom"] == null))))
            {
                CallerPage = Request.QueryString["calledfrom"];
            }
        }
        m_intFolderId = -1;
        if ((!((Request.QueryString["folder_id"] == null))))
        {
            if ((!string.IsNullOrEmpty(Request.QueryString["folder_id"])))
            {
                m_intFolderId = Convert.ToInt64(Request.QueryString["folder_id"]);
            }
        }
        string strType = Request.QueryString["type"];
        if (((strType == null)))
        {
            strType = "";
        }
        strType = strType.Trim().ToLower();
        if (("menu" == strType))
        {
            m_Type = CmsTranslatableType.Menu;
        }
        else if (("taxonomy" == strType))
        {
            m_Type = CmsTranslatableType.Taxonomy;
        }
        else if ((-1 == m_intFolderId))
        {
            m_intFolderId = m_intId;
            m_intId = 0;
            m_Type = CmsTranslatableType.Folder;
        }
        else if ((m_intId > 0))
        {
            if (this.m_refContent.GetContentType(m_intId) == 3333)
                m_Type = CmsTranslatableType.Product;
            else
                m_Type = CmsTranslatableType.Content;
        }
        else
        {
            m_Type = CmsTranslatableType.Folder;
        }

        if ((IsPostBack))
        {
            if (((chkRecursive != null)))
            {
                // chkRecursive.Checked doesn't work, not sure why, may be viewstate
                // or b/c its a user control that's losing state
                m_bRecursive = ((Request.Form[chkRecursive.UniqueID] != null));
                chkRecursive.Checked = m_bRecursive;
            }
            else
            {
                m_bRecursive = true;
            }
        }
        else
        {
            string strRecursive = Request.QueryString["recursive"];
            if (((strRecursive == null)))
            {
                m_bRecursive = true;
            }
            else
            {
                strRecursive = strRecursive.Trim().ToLower();
                m_bRecursive = ("true" == strRecursive || "1" == strRecursive || "yes" == strRecursive);
            }
            chkRecursive.Checked = m_bRecursive;
        }

        if ((m_intFolderId != -1))
        {
            folder_data = m_refContentApi.GetFolderById(m_intFolderId);
            if ((folder_data == null))
            {
                Response.Redirect("notify_user.aspx", false);
                return false;
            }
        }
        else
        {
            folder_data = null;
        }

        if (CmsTranslatableType.Content == m_Type ||
            CmsTranslatableType.Product == m_Type)
        {
            content_data = m_refContentApi.GetContentById(m_intId, Ektron.Cms.ContentAPI.ContentResultType.Published);
            if ((content_data == null))
            {
                Response.Redirect("notify_user.aspx", false);
                return false;
            }
        }
        else
        {
            content_data = null;
        }

        Display_Localization();

        switch (m_strPageAction)
        {
            case "localizeexport":
                Display_Select(false);
                ExportForTranslation();
                break;
            default:
                // "localize"
                m_strPageAction = "localize";
                Display_Select(true);
                break;
        }
        return true;
    }
Esempio n. 25
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refCommon.EkMsgRef;
        AppImgPath = m_refCommon.AppImgPath;
        AppPath = m_refCommon.AppPath;
        m_strPageAction = Request.QueryString["action"];
        Utilities.SetLanguage(m_refCommon);
        MenuLanguage = m_refCommon.ContentLanguage;
        MenuId = Convert.ToInt64(Request.QueryString["menuid"]);
        if (Request.QueryString["view"] != null)
        {
            m_strViewItem = Request.QueryString["view"];
        }
        if (!string.IsNullOrEmpty( Request.QueryString["folderid"]))
        {
            FoldId = long.Parse(Request.QueryString["folderid"].ToString());
        }
        m_refContent = m_refCommon.EkContentRef;
        m_refContentApi = new ContentAPI();
        Utilities.SetLanguage(m_refContentApi);

        m_strBackPage = Request.QueryString.ToString();
        // strip off refresh indicator
        if (m_strBackPage.EndsWith("&rf=1"))
        {
            // refresh is needed after we edit a submenu, but we don't want to keep refreshing if we use the same URL
            m_strBackPage = m_strBackPage.Substring(0, m_strBackPage.Length - 5);
        }

        reloadTree = (Request.QueryString["rf"] != null && Request.QueryString["rf"] == "1");

        if (IsPostBack == false)
        {
            DisplayPage();
            RegisterResources();
        }
        else
        {
            if (Request.Form[submittedaction.Name] == "deleteitem")
            {
                // handle deleting menu items
                string contentids = Request.Form[frm_item_ids.Name];
                Server.Transfer((string)("collections.aspx?action=doDeleteMenuItem&folderid=" + MenuId + "&nid=" + MenuId + "&ids=" + contentids + "&back=" + EkFunctions.UrlEncode(Request.Url.ToString())), true);
            }
            else if (Request.Form[submittedaction.Name] == "delete")
            {
                // handle deleting the menu
                AxMenuData menu;
                menu = m_refContent.GetMenuDataByID(MenuId);
                if (FoldId == 0)
                    reloadTree = true;
                if (reloadTree)
                {
                    Server.Transfer((string)("collections.aspx?action=doDeleteMenu&reloadtrees=menu&nid=" + MenuId + "&back=" + EkFunctions.UrlEncode((string)("menu.aspx?action=deleted&title=" + menu.Title))), true);
                }
                else
                {
                    Server.Transfer((string)("collections.aspx?action=doDeleteMenu&folderid=" + FoldId + "&nid=" + MenuId + "&back=" + EkFunctions.UrlEncode((string)("menu.aspx?action=deleted&title=" + menu.Title))), true);
                }
            }
        }
        isPostData.Value = "true";
    }
Esempio n. 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _msgRef = new Ektron.Cms.Common.EkMessageHelper(_ContentAPI.RequestInformationRef);
        _refContentObject = _ContentAPI.EkContentRef;

        if (!(_CommonApi.IsAdmin() || (_refContentObject.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.MessageBoardAdmin, _CommonApi.RequestInformationRef.UserId, false))))
        {
            Utilities.ShowError(_msgRef.GetMessage("User not authorized"));
        }
        try
        {

            imagePath = _ContentAPI.AppPath + "images/ui/icons/";
            RegisterResources();
            SetServerSizeJSVariables();
            if (!Utilities.ValidateUserLogin())
                return;
            if (Request.QueryString["action"] != null || Request.QueryString["action"] != String.Empty)
            {
                _PageAction = Request.QueryString["action"];
            }
            if(Request.Form[isPostData.UniqueID] != "")
            {
                switch (_PageAction)
                {
                    case "viewmessage":
                        msgId = Convert.ToInt64(Request.QueryString["messageid"]);
                        objectType = Request.QueryString["objecttype"];
                        objectId = Convert.ToInt64(Request.QueryString["objectId"]);
                        DisplayUnApprovedMessage(msgId, objectId, objectType);
                        break;
                    case "approvemessage":
                        ApproveSelectedMessages();
                        break;
                    case "deletemessage":
                        DeleteSelectedMessages();
                        break;
                    default:
                        Display_ViewAllUnApprovedMessages(selVal.Value);
                        ViewMessageBoardToolBar();
                        break;
                }
            }
            isPostData.Value = "true";
        }
        catch (Exception ex)
        {
            Response.Redirect("../reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message), false);
        }
    }
Esempio n. 27
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = this.m_refContentApi.EkMsgRef;
        AppImgPath = this.m_refContentApi.AppImgPath;
        AppPath = this.m_refContentApi.AppPath;
        m_strPageAction = Request.QueryString["action"];
        object refApi = m_refContentApi as object;
        Utilities.SetLanguage(m_refContentApi);
        TaxonomyLanguage = this.m_refContentApi.ContentLanguage;
        if ((TaxonomyLanguage == -1))
        {
            TaxonomyLanguage = m_refContentApi.DefaultContentLanguage;
        }
        if ((Request.QueryString["view"] != null))
        {
            _ViewItem = Request.QueryString["view"];
        }
        if ((Request.QueryString["taxonomyid"] != null))
        {
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
        }

        if ((Request.QueryString["parentid"] != null))
        {
            this.TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
        }

        if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "author")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.User;
            this.m_UserType = EkEnumeration.UserTypes.AuthorType;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "member")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.User;
            this.m_UserType = EkEnumeration.UserTypes.MemberShipType;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "cgroup")
        {
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.CommunityGroup;
        }

        else if ((Request.QueryString["type"] != null) && Request.QueryString["type"].ToLower() == "locales")
        {
            this.m_LocaleObjectType = EkEnumeration.TaxonomyItemType.Locale;
        }

        else if ((m_strPageAction == "addfolder"))
        {
            localization_folder_chkRecursive_div.Visible = true;
            this.m_ObjectType = EkEnumeration.CMSObjectTypes.Folder;
        }

        if ((Request.QueryString["contFetchType"] != null) && !string.IsNullOrEmpty(Request.QueryString["contFetchType"].ToLower()))
        {
            contentFetchType = Request.QueryString["contFetchType"];
        }

        this.m_refContent = this.m_refContentApi.EkContentRef;
        FormsIcon = "<img src=\"" + this.m_refContentApi.AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\">";
        ContentIcon = "<img src=\"" + this.m_refContentApi.AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\">";
        pageIcon = "<img src=\"" + m_refContentApi.AppPath + "images/ui/icons/layout.png\" alt=\"Page\">";
        if (this.m_UserType == EkEnumeration.UserTypes.AuthorType)
        {
            UserIcon = "<img src=\"" + this.m_refContentApi.AppPath + "Images/ui/icons/user.png\" alt=\"Content\">";
        }
        else
        {
            UserIcon = "<img src=\"" + this.m_refContentApi.AppPath + "Images/ui/icons/userMembership.png\" alt=\"Content\">";
        }
        if ((Page.IsPostBack && (!string.IsNullOrEmpty(Request.Form[isPostData.UniqueID])) && (m_ObjectType == EkEnumeration.CMSObjectTypes.Content | (m_ObjectType == EkEnumeration.CMSObjectTypes.User & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup & !string.IsNullOrEmpty(Request.Form["itemlist"]) | (m_ObjectType == EkEnumeration.CMSObjectTypes.Folder & !string.IsNullOrEmpty(Request.Form["itemlist"])) | (m_ObjectType == EkEnumeration.CMSObjectTypes.TaxonomyNode & !string.IsNullOrEmpty(Request.Form["itemlist"]))))))
        {
            if ((this.m_strPageAction == "additem"))
            {
                TaxonomyRequest item_request = new TaxonomyRequest();
                item_request.TaxonomyId = TaxonomyId;
                item_request.TaxonomyIdList = Validate(Request.Form["itemlist"]);
                if (m_ObjectType == EkEnumeration.CMSObjectTypes.User)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                }
                else if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                }
                else if (this.m_LocaleObjectType == EkEnumeration.TaxonomyItemType.Locale)
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Locale;
                }
                item_request.TaxonomyLanguage = TaxonomyLanguage;
                m_refContent.AddTaxonomyItem(item_request);
            }
            else if (this.m_strPageAction == "addfolder")
            {
                TaxonomyRequest item_request = new TaxonomyRequest();
                item_request.TaxonomyId = this.TaxonomyId;
                item_request.TaxonomyLanguage = this.TaxonomyLanguage;

                item_request.TaxonomyIdList = this.Validate(Request.Form["newFolderDescendantsCSV"]);
                if (!String.IsNullOrEmpty(item_request.TaxonomyIdList))
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderDescendants;
                    this.m_refContent.AddTaxonomyItem(item_request);
                }

                item_request.TaxonomyIdList = this.Validate(Request.Form["newFolderChildrenCSV"]);
                if (!String.IsNullOrEmpty(item_request.TaxonomyIdList))
                {
                    item_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.FolderChildren;
                    this.m_refContent.AddTaxonomyItem(item_request);
                }
            }
            if ((Request.QueryString["iframe"] == "true"))
            {
                Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
            }
            else
            {
                if ((Request.QueryString["type"] != null))
                {
                    if (this.m_LocaleObjectType == EkEnumeration.TaxonomyItemType.Locale)
                    {
                        Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + this.m_LocaleObjectType + "&taxonomyid=" + this.TaxonomyId);
                    }
                    else
                    {
                        if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup)
                        {
                            Response.Redirect("LocaleTaxonomy.aspx?action=view&view=cGroup&taxonomyid=" + TaxonomyId);
                        }
                        else
                        {
                            Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + Convert.ToString(this.m_ObjectType).ToLower() + "&taxonomyid=" + TaxonomyId);
                        }

                    }

                }
                else if (this.m_ObjectType == EkEnumeration.CMSObjectTypes.Folder)
                {
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&view=" + Convert.ToString(this.m_ObjectType).ToLower() + "&taxonomyid=" + TaxonomyId);
                }
                else
                {
                    Response.Redirect("LocaleTaxonomy.aspx?action=view&taxonomyid=" + TaxonomyId);
                }

            }
        }
        else
        {
            this.FolderId = Convert.ToInt64(Request.QueryString["folderid"]);

            folder_data_col = this.m_refContent.GetFolderInfoWithPath(FolderId);
            FolderName = this.folder_data_col["FolderName"].ToString();
            FolderParentId = Convert.ToInt64(this.folder_data_col["ParentID"].ToString());
            FolderPath = this.folder_data_col["Path"].ToString();

            folder_request_col = new Collection();
            folder_request_col.Add(this.FolderId, "ParentID", null, null);
            folder_request_col.Add("name", "OrderBy", null, null);
            folder_data_col = this.m_refContent.GetAllViewableChildFoldersv2_0(folder_request_col);

            if ((m_strPageAction != "additem"))
            {
                if (!string.IsNullOrEmpty(Request.QueryString[EkConstants.ContentTypeUrlParam]))
                {
                    if (Information.IsNumeric(Request.QueryString[EkConstants.ContentTypeUrlParam]))
                    {
                        this.SelectedContentType = Convert.ToInt32(Request.QueryString[EkConstants.ContentTypeUrlParam]);
                        this.m_refContentApi.SetCookieValue(EkConstants.ContentTypeUrlParam.ToString(), SelectedContentType.ToString());
                    }
                }
                else if (!string.IsNullOrEmpty(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]))
                {
                    if (Information.IsNumeric(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]))
                    {
                        this.SelectedContentType = Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()[(EkConstants.ContentTypeUrlParam)]);
                    }
                }
                asset_data = this.m_refContent.GetAssetSuperTypes();
            }
            this.RegisterResources();
            this.TaxonomyToolBar();
            if ((!Page.IsPostBack || m_ObjectType == EkEnumeration.CMSObjectTypes.User || this.m_ObjectType == EkEnumeration.CMSObjectTypes.CommunityGroup))
            {
                //// avoid redisplay when clicking next/prev buttons
                this.DisplayPage();
            }
        }
    }
Esempio n. 28
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refCommon.EkMsgRef;
        AppImgPath = m_refCommon.AppImgPath;
        m_strPageAction = Request.QueryString["action"];
        Utilities.SetLanguage(m_refCommon);
        TaxonomyLanguage = m_refCommon.ContentLanguage;
        TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
        taxonomy_request = new TaxonomyRequest();
        taxonomy_request.TaxonomyId = TaxonomyId;
        taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
        m_refContent = m_refCommon.EkContentRef;
        Util_RegisterResources();
        Util_SetServerJSVariables();

        litEnable.Text = m_refMsg.GetMessage("js:Confirm enable taxonomy all languages");
        litDisable.Text = m_refMsg.GetMessage("js:Confirm disable taxonomy all languages");
        if (Page.IsPostBack)
        {
            if (Request.Form["submittedaction"] == "delete")
            {
                m_refContent.DeleteTaxonomy(taxonomy_request);
                Response.Redirect((string)("taxonomy.aspx?LangType=" + TaxonomyLanguage), true);
            }
            else if (Request.Form["submittedaction"] == "deletenode")
            {
                long CurrentDeleteId = TaxonomyId;
                if ((Request.Form["LastClickedOn"] != null) && Request.Form["LastClickedOn"] != "")
                {
                    CurrentDeleteId = Convert.ToInt64(Request.Form["LastClickedOn"]);
                }
                taxonomy_request.TaxonomyId = CurrentDeleteId;
                m_refContent.DeleteTaxonomy(taxonomy_request);
                if (CurrentDeleteId == TaxonomyId)
                {
                    Response.Redirect((string)("taxonomy.aspx?taxonomyid=" + TaxonomyId), true);
                }
                else
                {
                    Response.Redirect((string)("taxonomy.aspx?action=viewtree&taxonomyid=" + TaxonomyId + "&LangType=" + TaxonomyLanguage), true);
                }
            }
            else if (Request.Form["submittedaction"] == "enable")
            {
                long CurrentEnableId = TaxonomyId;
                if ((Request.Form["LastClickedOn"] != null) && Request.Form["LastClickedOn"] != "")
                {
                    CurrentEnableId = Convert.ToInt64(Request.Form["LastClickedOn"]);
                }
                if (Request.Form[alllanguages.UniqueID] == "true")
                {
                    m_refContent.UpdateTaxonomyVisible(CurrentEnableId, -1, true);
                }
                else
                {
                    m_refContent.UpdateTaxonomyVisible(CurrentEnableId, TaxonomyLanguage, true);
                }
                Response.Redirect((string)("taxonomy.aspx?action=viewtree&taxonomyid=" + TaxonomyId + "&LangType=" + TaxonomyLanguage), true);
            }
            else if (Request.Form["submittedaction"] == "disable")
            {
                long CurrentDisableId = TaxonomyId;
                if ((Request.Form["LastClickedOn"] != null) && Request.Form["LastClickedOn"] != "")
                {
                    CurrentDisableId = Convert.ToInt64(Request.Form["LastClickedOn"]);
                }
                if (Request.Form[alllanguages.UniqueID] == "true")
                {
                    m_refContent.UpdateTaxonomyVisible(CurrentDisableId, -1, false);
                }
                else
                {
                    m_refContent.UpdateTaxonomyVisible(CurrentDisableId, TaxonomyLanguage, false);
                }
                Response.Redirect((string)("taxonomy.aspx?action=viewtree&taxonomyid=" + TaxonomyId + "&LangType=" + TaxonomyLanguage), true);
            }
        }
        else
        {
            taxonomy_data = m_refContent.ReadTaxonomy(ref taxonomy_request);
            if (taxonomy_data != null)
            {
                TaxonomyParentId = taxonomy_data.TaxonomyParentId;
                m_strTaxonomyName = taxonomy_data.TaxonomyName;
            }
            AncestorTaxonomyId = TaxonomyId;
            m_selectedTaxonomyList = Convert.ToString(TaxonomyId);
            TaxonomyToolBar();
        }
    }
Esempio n. 29
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refApi.EkMsgRef;
        AppImgPath = m_refApi.AppImgPath;
        m_strPageAction = Request.QueryString["action"];
        object refAPI = m_refApi as object;
        Utilities.SetLanguage(m_refApi);
        TaxonomyLanguage = m_refApi.ContentLanguage;
        if (TaxonomyLanguage == -1)
        {
            TaxonomyLanguage = m_refApi.DefaultContentLanguage;
        }
        if (Request.QueryString["taxonomyid"] != null)
        {
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            hdnTaxonomyId.Value = TaxonomyId.ToString();
        }
        if (Request.QueryString["parentid"] != null)
        {
            TaxonomyParentId = Convert.ToInt64(Request.QueryString["parentid"]);
        }
        m_refContent = m_refApi.EkContentRef;
        if (Request.QueryString["reorder"] != null)
        {
            m_strReorderAction = Convert.ToString(Request.QueryString["reorder"]);
        }
        chkApplyDisplayAllLanguages.Text = m_refMsg.GetMessage("lbl apply display taxonomy languages");
        chkConfigContent.Text = chkConfigContent.ToolTip = m_refMsg.GetMessage("content text");
        chkConfigUser.Text = chkConfigUser.ToolTip = m_refMsg.GetMessage("generic user");
        chkConfigGroup.Text = chkConfigGroup.ToolTip = m_refMsg.GetMessage("lbl group");
        if (Page.IsPostBack)
        {
            if (m_strPageAction == "edit")
            {
                taxonomy_data.TaxonomyLanguage = TaxonomyLanguage;
                taxonomy_data.TaxonomyParentId = TaxonomyParentId;
                taxonomy_data.TaxonomyId = TaxonomyId;
                taxonomy_data.TaxonomyDescription = Request.Form[taxonomydescription.UniqueID];
                taxonomy_data.TaxonomyName = Request.Form[taxonomytitle.UniqueID];
                taxonomy_data.TaxonomyImage = Request.Form[taxonomy_image.UniqueID];
                taxonomy_data.CategoryUrl = Request.Form[categoryLink.UniqueID];
                if (tr_enableDisable.Visible == true)
                {
                    if (!string.IsNullOrEmpty(Request.Form[chkEnableDisable.UniqueID]))
                    {
                        taxonomy_data.Visible = true;
                    }
                    else
                    {
                        taxonomy_data.Visible = false;
                    }
                }
                else
                {
                    taxonomy_data.Visible = Convert.ToBoolean(Request.Form[visibility.UniqueID]);
                }
                if (Request.Form[inherittemplate.UniqueID] != null)
                {
                    taxonomy_data.TemplateInherited = true;
                }
                if (Request.Form[taxonomytemplate.UniqueID] != null)
                {
                    taxonomy_data.TemplateId = Convert.ToInt64(Request.Form[taxonomytemplate.UniqueID]);
                }
                else
                {
                    taxonomy_data.TemplateId = 0;
                }

                try
                {
                    m_refContent.UpdateTaxonomy(taxonomy_data);
                }
                catch (Exception ex)
                {
                    Utilities.ShowError(ex.Message);
                }
                if ((!(Request.Form[chkApplyDisplayAllLanguages.UniqueID] == null)) && (Request.Form[chkApplyDisplayAllLanguages.UniqueID].ToString().ToLower() == "on"))
                {
                    m_refContent.UpdateTaxonomyVisible(TaxonomyId, -1, taxonomy_data.Visible);
                }
                m_refContent.UpdateTaxonomySynchronization(TaxonomyId, GetCheckBoxValue(chkTaxSynch));
                //else
                //{
                //    m_refContent.UpdateTaxonomyVisible(TaxonomyId, TaxonomyLanguage, taxonomy_data.Visible);
                //}
                if (TaxonomyParentId == 0)
                {
                    string strConfig = string.Empty;
                    if (!string.IsNullOrEmpty(Request.Form[chkConfigContent.UniqueID]))
                    {
                        strConfig = "0";
                    }
                    if (!string.IsNullOrEmpty(Request.Form[chkConfigUser.UniqueID]))
                    {
                        if (string.IsNullOrEmpty(strConfig))
                        {
                            strConfig = "1";
                        }
                        else
                        {
                            strConfig = strConfig + ",1";
                        }
                    }
                    if (!string.IsNullOrEmpty(Request.Form[chkConfigGroup.UniqueID]))
                    {
                        if (string.IsNullOrEmpty(strConfig))
                        {
                            strConfig = "2";
                        }
                        else
                        {
                            strConfig = strConfig + ",2";
                        }
                    }
                    if (!(string.IsNullOrEmpty(strConfig)))
                    {
                        m_refContent.UpdateTaxonomyConfig(TaxonomyId, strConfig);
                    }
                }
                UpdateCustomProperties();

                if (Request.QueryString["iframe"] == "true")
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    if ((Request.QueryString["backaction"] != null) && Convert.ToString(Request.QueryString["backaction"]).ToLower() == "viewtree")
                    {
                        Response.Redirect((string)("taxonomy.aspx?action=viewtree&taxonomyid=" + TaxonomyId + "&LangType=" + TaxonomyLanguage), true);
                    }
                    else
                    {
                        Response.Redirect("taxonomy.aspx?action=view&view=item&taxonomyid=" + TaxonomyId + "&rf=1", true);
                    }
                }
            }
            else
            {
                if (Request.Form[LinkOrder.UniqueID] != "")
                {
                    taxonomy_request = new TaxonomyRequest();
                    taxonomy_request.TaxonomyId = TaxonomyId;
                    taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
                    taxonomy_request.TaxonomyIdList = Request.Form[LinkOrder.UniqueID];
                    if (!string.IsNullOrEmpty(Request.Form[chkOrderAllLang.UniqueID]))
                    {
                        if (m_strReorderAction == "category")
                        {
                            m_refContent.ReOrderAllLanguageCategories(taxonomy_request);
                        }
                        else if (m_strReorderAction == "users")
                        {

                                taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                            m_refContent.ReOrderTaxonomyItems(taxonomy_request);
                        }
                    }
                    else
                    {
                        if (m_strReorderAction == "category")
                        {
                            m_refContent.ReOrderCategories(taxonomy_request);
                        }
                        else
                        {
                            if (m_strReorderAction == "users")
                            {
                                taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                            }
                            m_refContent.ReOrderTaxonomyItems(taxonomy_request);
                        }
                    }
                }
                if (Request.QueryString["iframe"] == "true")
                {
                    Response.Write("<script type=\"text/javascript\">parent.CloseChildPage();</script>");
                }
                else
                {
                    if(m_strReorderAction == "category")
                        Response.Redirect("taxonomy.aspx?action=view&taxonomyid=" + TaxonomyId + "&rf=1&reloadtrees=Tax", true);
                    else
                        Response.Redirect("taxonomy.aspx?action=view&taxonomyid=" + TaxonomyId + "&rf=1", true);
                }
            }
        }
        else
        {
            ltr_sitepath.Text = m_refApi.SitePath;
            taxonomy_request = new TaxonomyRequest();
            taxonomy_request.TaxonomyId = TaxonomyId;
            taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;

            if (m_strPageAction == "edit")
            {
                taxonomy_data = m_refContent.ReadTaxonomy(ref taxonomy_request);

                taxonomydescription.Text = taxonomy_data.TaxonomyDescription;
                taxonomydescription.ToolTip = taxonomydescription.Text;
                taxonomytitle.Text = taxonomy_data.TaxonomyName;
                taxonomytitle.ToolTip = taxonomytitle.Text;
                taxonomy_image.Text = taxonomy_data.TaxonomyImage;
                taxonomy_image.ToolTip = taxonomy_image.Text;
                taxonomy_image_thumb.ImageUrl = taxonomy_data.TaxonomyImage;
                categoryLink.Text = taxonomy_data.CategoryUrl;
                visibility.Value = taxonomy_data.Visible.ToString();
                if (Request.QueryString["taxonomyid"] != null)
                {
                    TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
                }

                if (TaxonomyParentId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyParentId, TaxonomyLanguage);
                    if (TaxonomyId > 0)
                        chkTaxSynch.Checked = m_refContent.IsSynchronizedTaxonomy(TaxonomyId, TaxonomyLanguage);
                }
                else if (TaxonomyId > 0)
                {
                    m_bSynchronized = m_refContent.IsSynchronizedTaxonomy(TaxonomyId, TaxonomyLanguage);
                    chkTaxSynch.Checked = m_bSynchronized;
                }
                if (taxonomy_data.Visible == true)
                {
                    chkEnableDisable.Checked = true;
                }
                else
                {
                    chkEnableDisable.Checked = false;
                }
                if (taxonomy_data.TaxonomyImage != "")
                {
                    taxonomy_image_thumb.ImageUrl = (taxonomy_data.TaxonomyImage.IndexOf("/") == 0) ? taxonomy_data.TaxonomyImage : m_refApi.SitePath + taxonomy_data.TaxonomyImage;
                }
                else
                {
                    taxonomy_image_thumb.ImageUrl = m_refApi.AppImgPath + "spacer.gif";
                }
                language_data = (new SiteAPI()).GetLanguageById(TaxonomyLanguage);
                if (taxonomy_data.TaxonomyParentId == 0)
                {
                    inherittemplate.Visible = false;
                    lblInherited.Text = "No";
                    lblInherited.ToolTip = lblInherited.Text;
                    inherittemplate.Checked = taxonomy_data.TemplateInherited;
                }
                else
                {
                    inherittemplate.Visible = true;
                    lblInherited.Text = "";
                    inherittemplate.Checked = taxonomy_data.TemplateInherited;
                    if (taxonomy_data.TemplateInherited)
                    {
                        taxonomytemplate.Enabled = false;
                    }
                }
                TemplateData[] templates = null;
                templates = m_refApi.GetAllTemplates("TemplateFileName");
                taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem("- " + m_refMsg.GetMessage("generic select template") + " -", "0"));
                if ((templates != null) && templates.Length > 0)
                {
                    for (int i = 0; i <= templates.Length - 1; i++)
                    {
                        taxonomytemplate.Items.Add(new System.Web.UI.WebControls.ListItem(templates[i].FileName, templates[i].Id.ToString()));
                        if (taxonomy_data.TemplateId == templates[i].Id)
                        {
                            taxonomytemplate.SelectedIndex = i + 1;
                        }
                    }
                }
                if ((language_data != null) && (m_refApi.EnableMultilingual == 1))
                {
                    lblLanguage.Text = "[" + language_data.Name + "]";
                    lblLanguage.ToolTip = lblLanguage.Text;
                }
                m_strCurrentBreadcrumb = (string)(taxonomy_data.TaxonomyPath.Remove(0, 1).Replace("\\", " > "));
                if (m_strCurrentBreadcrumb == "")
                {
                    m_strCurrentBreadcrumb = "Root";
                }
                inherittemplate.Attributes.Add("onclick", "OnInheritTemplateClicked(this)");
                if (TaxonomyParentId == 0)
                {
                    tr_config.Visible = true;
                    List<int> config_list = m_refApi.EkContentRef.GetAllConfigIdListByTaxonomy(TaxonomyId, TaxonomyLanguage);
                    for (int i = 0; i <= config_list.Count - 1; i++)
                    {
                        if (config_list[i] == 0)
                        {
                            chkConfigContent.Checked = true;
                        }
                        else if (config_list[i] == 1)
                        {
                            chkConfigUser.Checked = true;
                        }
                        else if (config_list[i] == 2)
                        {
                            chkConfigGroup.Checked = true;
                        }
                    }
                }
                else
                {
                    tr_config.Visible = false;
                }

                LoadCustomPropertyList();

            }
            else
            {
                if (m_strReorderAction == "category")
                {
                    taxonomy_request.PageSize = 99999999; // pagesize of 0 used to mean "all"
                    taxonomy_arr = m_refContent.ReadAllSubCategories(taxonomy_request);
                    if (taxonomy_arr != null)
                    {
                        TotalItems = taxonomy_arr.Length;
                    }
                    else
                    {
                        TotalItems = 0;
                    }
                    if (TotalItems > 1)
                    {
                        td_msg.Text = m_refMsg.GetMessage("generic first msg");
                        OrderList.DataSource = taxonomy_arr;
                        OrderList.DataTextField = "TaxonomyName";
                        OrderList.DataValueField = "TaxonomyId";
                        OrderList.DataBind();
                        OrderList.SelectionMode = ListSelectionMode.Multiple;
                        OrderList.CssClass = "width: 100%; border-style: none; border-color: White; font-family: Verdana;font-size: x-small;";
                        if (TotalItems > 20)
                        {
                            OrderList.Rows = 20;
                        }
                        else
                        {
                            OrderList.Rows = TotalItems;
                        }
                        OrderList.Width = 300;
                        if (TotalItems > 0)
                        {
                            loadscript.Text = "document.forms[0].taxonomy_OrderList[0].selected = true;";
                        }
                        for (int i = 0; i <= taxonomy_arr.Length - 1; i++)
                        {
                            if (LinkOrder.Value == "")
                            {
                                LinkOrder.Value = Convert.ToString(taxonomy_arr[i].TaxonomyId);
                            }
                            else
                            {
                                LinkOrder.Value = Convert.ToString(taxonomy_arr[i].TaxonomyId) + ",";
                            }
                        }
                    }
                    else
                    {
                        LoadNoItem();
                    }
                }
                else if (m_strReorderAction == "users")
                {
                    DirectoryUserRequest uReq = new DirectoryUserRequest();
                    DirectoryAdvancedUserData uDirectory = new DirectoryAdvancedUserData();
                    uReq.GetItems = true;
                    uReq.DirectoryId = TaxonomyId;
                    uReq.DirectoryLanguage = TaxonomyLanguage;
                    uReq.PageSize = 99999;
                    uReq.CurrentPage = 1;
                    uDirectory = this.m_refContent.LoadDirectory(ref uReq);
                    TotalItems = uDirectory.DirectoryItems.Count();
                    if (TotalItems > 1)
                    {
                        td_msg.Text = m_refMsg.GetMessage("generic first msg");
                        OrderList.DataSource = uDirectory.DirectoryItems;
                        OrderList.DataTextField = "Username";
                        OrderList.DataValueField = "Id";
                        OrderList.DataBind();
                        OrderList.SelectionMode = ListSelectionMode.Multiple;
                        OrderList.CssClass = "width: 100%; border-style: none; border-color: White; font-family: Verdana;font-size: x-small;";
                        if (TotalItems > 20)
                        {
                            OrderList.Rows = 20;
                        }
                        else
                        {
                            OrderList.Rows = TotalItems;
                        }
                        OrderList.Width = 300;
                        if (TotalItems > 0)
                        {
                            loadscript.Text = "document.forms[0].taxonomy_OrderList[0].selected = true;";
                        }
                        for (int i = 0; i <= TotalItems - 1; i++)
                        {
                            if (LinkOrder.Value == "")
                            {
                                LinkOrder.Value = Convert.ToString(uDirectory.DirectoryItems[i].Id);
                            }
                            else
                            {
                                LinkOrder.Value = Convert.ToString(uDirectory.DirectoryItems[i].Id) + ",";
                            }
                        }
                    }
                    else
                    {
                        LoadNoItem();
                    }
                }
                else
                {
                    AllLangForm.Visible = false; // the all languages checkbox is only valid for categories
                    taxonomy_request.PageSize = 99999999;
                    taxonomy_request.IncludeItems = true;
                    taxonomy_data = m_refContent.ReadTaxonomy(ref taxonomy_request);
                    tr_ordering.Visible = true; //Not showing for items
                    if (taxonomy_data.TaxonomyItems != null)
                    {
                        TotalItems = taxonomy_data.TaxonomyItems.Length;
                        if (TotalItems > 1)
                        {
                            td_msg.Text = m_refMsg.GetMessage("generic first msg");
                            OrderList.DataSource = taxonomy_data.TaxonomyItems;
                            OrderList.DataTextField = "TaxonomyItemTitle";
                            OrderList.DataValueField = "TaxonomyItemId";
                            OrderList.DataBind();
                            OrderList.SelectionMode = ListSelectionMode.Multiple;
                            OrderList.CssClass = "width: 100%; border-style: none; border-color: White; font-family: Verdana;font-size: x-small;";
                            if (TotalItems > 20)
                            {
                                OrderList.Rows = 20;
                            }
                            else
                            {
                                OrderList.Rows = TotalItems;
                            }
                            OrderList.Width = 300;
                            if (TotalItems > 0)
                            {
                                loadscript.Text = "document.forms[0].taxonomy_OrderList[0].selected = true;";
                            }
                            foreach (TaxonomyItemData taxonomy_item in taxonomy_data.TaxonomyItems)
                            {
                                if (LinkOrder.Value == "")
                                {
                                    LinkOrder.Value = Convert.ToString(taxonomy_item.TaxonomyItemId);
                                }
                                else
                                {
                                    LinkOrder.Value = Convert.ToString(taxonomy_item.TaxonomyItemId) + ",";
                                }
                            }
                        }
                        else
                        {
                            LoadNoItem();
                        }
                    }
                }
            }
            TaxonomyToolBar();
        }
    }
Esempio n. 30
0
    private void Process_MoveMultiContent()
    {
        long intMoveFolderId = 0;
            string strContentIds = "";
            string[] arrArray;
            int i = 0;
            string strContentLanguages = "";
            string[] arrLanguages;
            Ektron.Cms.Content.EkContent m_refContent;
            string FolderPath;
            int contCount = 0;
            SiteAPI m_refsite = new SiteAPI();

            try
            {
                m_refContent = m_refContentApi.EkContentRef;
                m_intFolderId = Convert.ToInt64(Request.Form[folder_id.UniqueID]);
                intMoveFolderId = m_refContent.GetFolderID(Request.Form["move_folder_id"]);
                arrArray = Strings.Split(Request.Form[contentids.UniqueID], ",", -1, 0);
                for (i = 0; i <= (arrArray.Length - 1); i++)
                {
                    if ((Request.Form["id_" + arrArray[i]]).ToString().IndexOf("on") + 1 > 0)
                    {
                        strContentIds = strContentIds + arrArray[i] + ",";
                    }
                }
                if (strContentIds != "")
                {
                    strContentIds = strContentIds.Substring(0, strContentIds.Length - 1);
                }
                arrLanguages = Strings.Split(Request.Form[contentlanguages.UniqueID], ",", -1, 0);
                for (i = 0; i <= (arrArray.Length - 1); i++)
                {
                    if ((Request.Form["id_" + arrArray[i]]).ToString().IndexOf("on") + 1 > 0)
                    {
                        strContentLanguages = strContentLanguages + arrLanguages[i] + ",";
                    }
                }
                if (strContentLanguages != "")
                {
                    strContentLanguages = strContentLanguages.Substring(0, strContentLanguages.Length - 1);
                }
                if (Request.Form[hdnCopyAll.UniqueID] == "true")
                {
                    bool publishContent = false;
                    if (! (Request.Form["btn_PublishCopiedContent"] == null) && Request.Form["btn_PublishCopiedContent"].ToString() == "on")
                    {
                        publishContent = true;
                    }
                    var countContentIds = strContentIds.Split(",".ToCharArray());
                    for (contCount = 0; contCount <= countContentIds.Length - 1; contCount++)
                    {
                        m_refContent.CopyAllLanguageContent(System.Convert.ToInt32(countContentIds[contCount]), intMoveFolderId, publishContent);
                    }
                }
                else
                {
                    if (! (Request.Form[RadBtnMoveCopyValue.UniqueID] == null) && Request.Form[RadBtnMoveCopyValue.UniqueID].ToString() == "copy")
                    {
                        bool bPublish = false;
                        if (! (Request.Form["btn_PublishCopiedContent"] == null) && Request.Form["btn_PublishCopiedContent"].ToString() == "on")
                        {
                            bPublish = true;
                        }
                        m_refContent.CopyContentByID(strContentIds, strContentLanguages, intMoveFolderId, bPublish);
                    }
                    else
                    {
                        m_refContent.MoveContent(strContentIds, strContentLanguages, intMoveFolderId);
                    }
                }

                FolderPath = m_refContent.GetFolderPath(intMoveFolderId);
                if ((FolderPath.Substring(FolderPath.Length - 1, 1) == "\\"))
                {
                    FolderPath = FolderPath.Substring(FolderPath.Length - FolderPath.Length - 1, FolderPath.Length - 1);
                }
                FolderPath = FolderPath.Replace("\\", "\\\\");
                Response.Redirect((string) ("content.aspx?LangType=" + ContentLanguage + "&action=ViewContentByCategory&id=" + intMoveFolderId + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false);

            }
            catch (Exception ex)
            {
                int intError;
                string strError;
                strError = "because a record with the same title exists in the destination folder";
                intError = ex.Message.IndexOf(strError);
                if (intError > -1)
                {
                    strError = ex.Message.Substring(0, intError + strError.Length);
                    Response.Redirect((string) ("reterror.aspx?info=" + EkFunctions.UrlEncode(strError + ".")), false);
                }
                else
                {
                    Response.Redirect((string) ("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message)), false);
                }
            }
    }