예제 #1
0
    void EditEvent(string settings)
    {
        try
        {
            tabTesting.Visible = _ShowTestingTab;

            string webserviceURL = _api.SitePath + "widgets/contentblock/CBHandler.ashx";
            // Register JS
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronClueTipJS);
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
            JS.RegisterJSInclude(this, _api.SitePath + "widgets/contentblock/behavior.js", "ContentBlockWidgetBehaviorJS");

            // Insert CSS Links
            Css.RegisterCss(this, _api.SitePath + "widgets/contentblock/CBStyle.css", "CBWidgetCSS"); //cbstyle will include the other req'd stylesheets
        Ektron.Cms.Framework.UI.Packages.jQuery.jQueryUI.ThemeRoller.Register(this); //cbstyle will include the other req'd stylesheets

            JS.RegisterJSBlock(this, "Ektron.PFWidgets.ContentBlock.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.ContentBlock.setupAll('"+ ClientID  +"');", "EktronPFWidgetsCBInit");

            IsGoogleMultivariate = cbMultiVariate.Checked;
            GoogleSectionName = tbSectionName.Text;

            ViewSet.SetActiveView(Edit);

            if (ContentBlockId > 0)
            {
                tbData.Text = ContentBlockId.ToString();
                ContentAPI capi = new ContentAPI();
                long folderid = capi.GetFolderIdForContentId(ContentBlockId);
                tbFolderPath.Text = folderid.ToString();
                while (folderid != 0)
                {
                    folderid = capi.GetParentIdByFolderId(folderid);
                    if (folderid > 0) tbFolderPath.Text += "," + folderid.ToString();
                }
            }
        }
        catch (Exception e)
        {
            errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
            _host.Title = _host.Title + " error";
            ViewSet.SetActiveView(View);
        }
    }
예제 #2
0
    protected void SetOutput()
    {
        tab1.InnerHtml = "<a href=\"#fragment-1\" title=\"" + _Tab1String + "\">" + _Tab1String + "</a>";
        tab2.InnerHtml = "<a href=\"#fragment-2\" title=\"" + _Tab2String + "\">" + _Tab2String + "</a>";
        tab3.InnerHtml = "<a href=\"#fragment-3\" title=\"" + _Tab3String + "\">" + _Tab3String + "</a>";
        tab4.InnerHtml = "<a href=\"#fragment-4\" title=\"" + _Tab4String + "\">" + _Tab4String + "</a>";
        tab1_edit.InnerHtml = "<a href=\"#editfragment-1\" title=\"" + _EditTab1String + "\">" + _EditTab1String + "</a>";
        tab2_edit.InnerHtml = "<a href=\"#editfragment-2\" title=\"" + _EditTab2String + "\">" + _EditTab2String + "</a>";
        tab3_edit.InnerHtml = "<a href=\"#editfragment-3\" title=\"" + _EditTab3String + "\">" + _EditTab3String + "</a>";
        tab4_edit.InnerHtml = "<a href=\"#editfragment-4\" title=\"" + _EditTab4String + "\">" + _EditTab4String + "</a>";

        if (!_skipSetOutput && tabNum.Value != "")
        {
            string filterObjectId = string.Empty;
            string filterObject = string.Empty;
            switch (tabNum.Value)
            {
                case "2":
                    filterObjectId = FilterIdTextBox2.Value;
                    filterObject = FilterObjectsList2.SelectedValue;
                    break;
                case "3":
                    filterObjectId = FilterIdTextBox3.Value;
                    filterObject = FilterObjectsList3.SelectedValue;
                    break;
                case "4":
                    filterObjectId = FilterIdTextBox4.Value;
                    filterObject = FilterObjectsList4.SelectedValue;
                    break;
                case "1":
                default:
                    filterObjectId = FilterIdTextBox1.Value;
                    filterObject = FilterObjectsList1.SelectedValue;
                    break;
            }
            ContentAPI capi = new ContentAPI();
            //if (filterObjectId.Length > 0)
            {
                switch (filterObject)
                {
                    case "folder":
                        //prepare for re-select folder path on the folder tree
                        string folderpath = string.Empty;
                        if (filterObjectId.Length > 0)
                        {
                            Int64 folderid = Convert.ToInt64(filterObjectId);
                            folderpath = filterObjectId;
                            while (folderid != 0)
                            {
                                folderid = capi.GetParentIdByFolderId(folderid);
                                if (folderid >= 0) folderpath += "," + folderid.ToString();
                            }
                        }
                        tbFolderPath.Text = folderpath;
                        folderId.Value = filterObjectId;
                        break;
                    case "taxonomy":
                        //prepare for re-select taxonomy path on the folder tree
                        string taxonomyPath = string.Empty;
                        if (filterObjectId.Length > 0)
                        {
                            Int64 taxId = Convert.ToInt64(filterObjectId);
                            TaxonomyBaseData[] TaxData = capi.EkContentRef.GetTaxonomyRecursiveToParent(taxId, _userLang, 0);
                            for (int i = 0; i < TaxData.Length; i++)
                            {
                                taxId = TaxData[i].TaxonomyId;
                                if (taxId > 0)
                                {
                                    if (0 == i)
                                    {
                                        taxonomyPath = taxId.ToString();
                                    }
                                    else
                                    {
                                        taxonomyPath += "," + taxId.ToString();
                                    }
                                }
                            }
                        }
                        tbTaxonomyPath.Text = taxonomyPath;
                        TaxId.Value = filterObjectId;
                        break;
                    default:
                        break;
                }
            }
        }
        linkDelete1.Visible = false;
        if (Tab1FilterObjectId != "")
        {
            linkDelete1.Visible = true;
        }
        linkDelete2.Visible = false;
        if (Tab2FilterObjectId != "")
        {
            linkDelete2.Visible = true;
        }
        linkDelete3.Visible = false;
        if (Tab3FilterObjectId != "")
        {
            linkDelete3.Visible = true;
        }
        linkDelete4.Visible = false;
        if (Tab4FilterObjectId != "")
        {
            linkDelete4.Visible = true;
        }
        _skipSetOutput = false;
    }
예제 #3
0
    protected void SetOutput()
    {
        if (!_skipSetOutput)
        {
            ReportTypeList.ClearSelection();
            FilterObjectsList.ClearSelection();
            try
            {
                ReportTypeList.Items.FindByValue(_ReportName).Selected = true;
                if (_FilterObject.Length > 0)
                {
                    FilterObjectsList.Items.FindByValue(_FilterObject).Selected = true;
                }
            }
            catch { }
            OrderDirList.ClearSelection();
            string orderdir = "descending";
            if (EkEnumeration.OrderByDirection.Ascending == _OrderDirection)
            {
                orderdir = "ascending";
            }
            OrderDirList.Items.FindByValue(orderdir).Selected = true;
            DurationTextBox.Text = _Duration.ToString();
            PageSizeTextBox.Text = _PageSize.ToString();
            FilterIdTextBox.Value = (_FilterObject != "" ? _FilterObjectId : "");
            chkFilterObjectRecur.Value = _FilterObjectRecursion.ToString();
            filterDisplay.Text = (_FilterDisplayText.Length > 0 ? _FilterDisplayText : _NotSet);
            linkDelete.Visible = false;
            if (_FilterObjectId != "")
            {
                linkDelete.Visible = true;
            }

            ContentAPI capi = new ContentAPI();
            if (_FilterObjectId.Length > 0)
            {
                switch (_FilterObject)
                {
                    case "folder":
                        //prepare for re-select folder path on the folder tree
                        string folderpath = string.Empty;
                        Int64 folderid = Convert.ToInt64(FilterIdTextBox.Value);
                        folderpath = FilterIdTextBox.Value;
                        while (folderid != 0)
                        {
                            folderid = capi.GetParentIdByFolderId(folderid);
                            if (folderid >= 0) folderpath += "," + folderid.ToString();
                        }
                        tbFolderPath.Text = folderpath;
                        break;
                    case "taxonomy":
                        //prepare for re-select taxonomy path on the folder tree
                        string taxonomyPath = string.Empty;
                        Int64 taxId = Convert.ToInt64(FilterIdTextBox.Value);
                        TaxonomyBaseData[] TaxData = capi.EkContentRef.GetTaxonomyRecursiveToParent(taxId, Convert.ToInt32(_userLang), 0);
                        for (int i = 0; i < TaxData.Length; i++)
                        {
                            taxId = TaxData[i].Id;
                            if (taxId > 0)
                            {
                                if (0 == i)
                                {
                                    taxonomyPath = taxId.ToString();
                                }
                                else
                                {
                                    taxonomyPath += "," + taxId.ToString();
                                }
                            }
                        }
                        tbTaxonomyPath.Text = taxonomyPath;
                        break;
                    default:
                        break;
                }
            }
        }
        _skipSetOutput = false;
    }