protected void Page_Load(object sender, EventArgs e)
    {
        if (CultureHelper.IsUICultureRTL())
        {
            ControlsHelper.ReverseFrames(colsFrameset);
        }

        int moduleId = QueryHelper.GetInteger("moduleid", 0);
        int catId    = QueryHelper.GetInteger("categoryid", -1);

        if (catId <= 0)
        {
            string  whereCond = moduleId > 0 ? "CategoryResourceID = " + moduleId : "CategoryParentID = (SELECT CategoryId FROM CMS_SettingsCategory WHERE CategoryName = 'CMS.Settings')";
            DataSet ds        = SettingsCategoryInfoProvider.GetSettingsCategories(whereCond, "CategoryLevel, CategoryOrder", 1, "CategoryIsGroup, CategoryID, CategoryParentID");
            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                DataRow row = ds.Tables[0].Rows[0];
                catId = ValidationHelper.GetBoolean(row["CategoryIsGroup"], false) ? ValidationHelper.GetInteger(row["CategoryParentID"], 0) : ValidationHelper.GetInteger(row["CategoryID"], 0);
            }
            else
            {
                catId = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo().CategoryID;
            }
        }

        frameTree.Attributes["src"] = "Tree.aspx?categoryid=" + catId + "&moduleid=" + moduleId;

        var queryString = "categoryid=" + catId + "&moduleid=" + moduleId + "&objectID=" + catId + "&objectParentID=" + moduleId;

        frameMain.Attributes["src"] = URLHelper.AppendQuery(UIContextHelper.GetElementUrl(ModuleName.CMS, "EditSettingsCategory", false), queryString);

        ScriptHelper.HideVerticalTabs(this);
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterJQuery(Page);

        TreeViewCategories.RootIsClickable = true;

        // Get selected category ID
        int categoryId;

        if (!RequestHelper.IsPostBack() && QueryHelper.Contains("selectedCategoryId"))
        {
            // Get from URL
            categoryId = QueryHelper.GetInteger("selectedCategoryId", 0);
        }
        else if (Request.Form["selectedCategoryId"] != null)
        {
            // Get from postback
            categoryId = ValidationHelper.GetInteger(Request.Form["selectedCategoryId"], 0);
        }
        else
        {
            // Select root by default
            categoryId = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo().CategoryID;
        }
        TreeViewCategories.CategoryID = categoryId;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterJQuery(Page);

        // URL for tree selection
        string script = "var categoryURL = '" + ResolveUrl("keys.aspx") + "';\n";

        script += "var doNotReloadContent = false;\n";

        // Get selected site id
        mSiteId = ValidationHelper.GetInteger(siteSelector.Value, 0);
        TreeViewCategories.SiteID          = mSiteId;
        TreeViewCategories.RootIsClickable = true;

        int categoryId = 0;

        if (Request.Params["selectedCategoryId"] != null)
        {
            // Selected category
            categoryId = ValidationHelper.GetInteger(Request.Params["selectedCategoryId"], 0);
        }
        else
        {
            // First request to Settings
            categoryId = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo().CategoryID;
        }


        bool reload = QueryHelper.GetBoolean("reload", true);

        // Select category
        SettingsCategoryInfo sci = SettingsCategoryInfoProvider.GetSettingsCategoryInfo(categoryId);

        if (sci != null)
        {
            // Stop reloading of right frame, if explicitly set
            if (!reload)
            {
                script += "doNotReloadContent = true;";
            }
            script += SelectAtferLoad(sci.CategoryIDPath, sci.CategoryName, sci.CategoryID, sci.CategoryParentID);
        }

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "SelectCat", ScriptHelper.GetScript(script));

        // Style site selector
        siteSelector.DropDownSingleSelect.CssClass = "";
        siteSelector.DropDownSingleSelect.Attributes.Add("style", "width: 100%");
        lblSite.Text = GetString("general.site") + ResHelper.Colon;

        // Set site selector
        siteSelector.DropDownSingleSelect.AutoPostBack = true;
        siteSelector.AllowAll = false;
        siteSelector.UniSelector.SpecialFields = new string[1, 2] {
            { GetString("general.global"), "0" }
        };
        siteSelector.OnlyRunningSites = false;
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get query strings
        mCategoryId = QueryHelper.GetInteger("categoryid", 0);
        mSiteId     = QueryHelper.GetInteger("siteid", 0);

        // Assign category id, site id
        SettingsGroupViewer.CategoryID = mCategoryId;
        SettingsGroupViewer.SiteID     = mSiteId;

        if (SettingsGroupViewer.SettingsCategoryInfo == null)
        {
            // Get root category info
            SettingsCategoryInfo sci = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo();
            SettingsGroupViewer.CategoryID = sci.CategoryID;
        }

        // Get search text if exist
        string search = QueryHelper.GetString("search", String.Empty).Trim();

        // If root selected show search controls
        if ((SettingsKeyProvider.DevelopmentMode) && (SettingsGroupViewer.CategoryName == "CMS.Settings"))
        {
            pnlSearch.Visible            = true;
            lblNoSettings.ResourceString = "Development.Settings.SearchSettings";
            if (!string.IsNullOrEmpty(search))
            {
                // Set searched values
                if (!URLHelper.IsPostback())
                {
                    txtSearch.Text         = search;
                    chkDescription.Checked = QueryHelper.GetBoolean("description", true);
                }
            }
            RegisterSearchScript();
        }

        // Set master title
        CurrentMaster.Title.TitleText     = HTMLHelper.HTMLEncode(ResHelper.LocalizeString(SettingsGroupViewer.SettingsCategoryInfo.CategoryDisplayName));
        CurrentMaster.Title.TitleImage    = GetImageUrlForHeader(SettingsGroupViewer.SettingsCategoryInfo.CategoryName);
        CurrentMaster.Title.HelpTopicName = GetHelpTopicName();

        // Check, if there are any groups
        DataSet ds = SettingsCategoryInfoProvider.GetSettingsCategories("CategoryIsGroup = 1 AND CategoryParentID = " + mCategoryId, null, -1, "CategoryID");

        if ((!DataHelper.DataSourceIsEmpty(ds)) || (!string.IsNullOrEmpty(search)))
        {
            CurrentMaster.HeaderActions.Actions          = GetHeaderActions();
            CurrentMaster.HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;
        }
        else
        {
            lblNoSettings.Visible = true;
        }

        ScriptHelper.RegisterSaveShortcut(this, "save", false);
    }
示例#5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptHelper.RegisterJQuery(Page);

        // URL for tree selection
        string script = "var categoryURL = '" + ResolveUrl("keys.aspx") + "';\n";

        script += "var doNotReloadContent = false;\n";

        // Get selected site id
        mSiteId = ValidationHelper.GetInteger(siteSelector.Value, 0);
        TreeViewCategories.SiteID          = mSiteId;
        TreeViewCategories.RootIsClickable = true;

        bool searchMode = false;
        int  categoryId = 0;

        if (Request.Params["selectedCategoryId"] != null)
        {
            // Selected category
            categoryId = ValidationHelper.GetInteger(Request.Params["selectedCategoryId"], 0);
            searchMode = true;
        }
        else
        {
            // First request to Settings
            categoryId = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo().CategoryID;
            searchMode = SettingsKeyProvider.DevelopmentMode;
        }

        TreeViewCategories.RootIsClickable = SettingsKeyProvider.DevelopmentMode;
        bool reload = QueryHelper.GetBoolean("reload", true);

        // Select category if set
        if ((categoryId > 0) && (searchMode))
        {
            SettingsCategoryInfo sci = SettingsCategoryInfoProvider.GetSettingsCategoryInfo(categoryId);
            if (sci != null)
            {
                // Stop reloading of right frame, if explicitly set
                if (!reload)
                {
                    script += "doNotReloadContent = true;";
                }
                script += SelectAtferLoad(sci.CategoryIDPath, sci.CategoryName, sci.CategoryID, sci.CategoryParentID);
            }
        }
        // If no category specified, select the first category under root by default
        else
        {
            SettingsCategoryInfo sci = SettingsCategoryInfoProvider.GetRootSettingsCategoryInfo();
            TreeViewCategories.RootCategory = sci;

            if (sci != null)
            {
                TreeViewCategories.RootIsClickable = false;
                DataSet ds = SettingsCategoryInfoProvider.GetSettingsCategories(string.Format("CategoryParentID = {0}", sci.CategoryID), "CategoryOrder", 1, "CategoryIDPath, CategoryName, CategoryID, CategoryParentID");
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    DataRow firstRow = ds.Tables[0].Rows[0];
                    script += SelectAtferLoad(SqlHelperClass.GetString(firstRow["CategoryIDPath"], "/"), SqlHelperClass.GetString(firstRow["CategoryName"], "CMS.Settings"), SqlHelperClass.GetInteger(firstRow["CategoryID"], 0), SqlHelperClass.GetInteger(firstRow["CategoryParentID"], 0));
                }
            }
        }

        ScriptHelper.RegisterStartupScript(Page, typeof(string), "SelectCat", ScriptHelper.GetScript(script));

        // Style site selector
        siteSelector.DropDownSingleSelect.CssClass = "";
        siteSelector.DropDownSingleSelect.Attributes.Add("style", "width: 100%");
        lblSite.Text = GetString("general.site") + ResHelper.Colon;

        // Set site selector
        siteSelector.DropDownSingleSelect.AutoPostBack = true;
        siteSelector.AllowAll = false;
        siteSelector.UniSelector.SpecialFields = new string[1, 2] {
            { GetString("general.global"), "0" }
        };
        siteSelector.OnlyRunningSites = false;
    }