예제 #1
0
    private void Display_TaxonomyTab()
    {
        PermissionData permissions = this.ContentApi.LoadPermissions(this.folderId, "folder", ContentAPI.PermissionResultType.Common);
        if (permissions.CanEdit || permissions.CanAdd || this.ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff, this.ContentApi.RequestInformationRef.UserId, false))
        {
            this.taxonomyRoleExists = true;
        }

        EditTaxonomyHtml.Text = "<div id=\"TreeOutput\"></div>";

        TaxonomyBaseData[] taxonomy_data_arr = null;
        Ektron.Cms.TaxonomyRequest taxRequest = new Ektron.Cms.TaxonomyRequest();

        taxRequest.TaxonomyId = 0;
        taxRequest.TaxonomyLanguage = this.ContentApi.ContentLanguage;
        taxRequest.TaxonomyType = EkEnumeration.TaxonomyType.Locale;
        taxonomy_data_arr = this.ContentApi.EkContentRef.ReadAllSubCategories(taxRequest);

        this.taxonomyTreeParamTaxonomyTreeIdList = EkFunctions.UrlEncode(this.idList);
        this.taxonomyTreeParamTaxonomyTreeParentIdList = EkFunctions.UrlEncode(this.parentIdList);
        this.taxonomyTreeParamTaxonomyOverrideId = this.overrideId.ToString();
        this.taxonomyTreeParamTaxonomyFolderId = this.folderId.ToString();
    }
예제 #2
0
    private void DrawFolderLocaleTaxonomyTable()
    {
        string categorydatatemplate = "<input type=\"checkbox\" id=\"localeTaxlist\" name=\"localeTaxlist\" value=\"{0}\" {1} disabled />{2}";
        StringBuilder categorydata = new StringBuilder();
        Ektron.Cms.TaxonomyRequest taxRequest = new Ektron.Cms.TaxonomyRequest();
        taxRequest.TaxonomyId = 0;
        taxRequest.TaxonomyLanguage = this._ContentLanguage;
        taxRequest.TaxonomyType = EkEnumeration.TaxonomyType.Locale;
        TaxonomyBaseData[] TaxArr = _ContentApi.EkContentRef.ReadAllSubCategories(taxRequest);
        // Dim TaxArr As TaxonomyBaseData() = _ContentApi.EkContentRef.GetAllTaxonomyByConfig(Common.EkEnumeration.TaxonomyType.Locale)
        if ((TaxArr != null) && TaxArr.Length > 0)
        {
            int i = 0;
            while (i < TaxArr.Length)
            {
                for (int j = 0; j <= 2; j++)
                {
                    if (i < TaxArr.Length)
                    {
                        checktaxid = TaxArr[i].TaxonomyId;
                        Predicate<TaxonomyBaseData> Taxpredicate = TaxonomyExists;
                        categorydata.Append(string.Format(categorydatatemplate, TaxArr[i].TaxonomyId, IsChecked(Array.Exists(_FolderData.FolderTaxonomy, Taxpredicate)), TaxArr[i].TaxonomyName));
                    }
                    else
                    {
                        break;
                    }
                    i++;
                    categorydata.Append("<br/>");
                }
            }
        }

        StringBuilder str = new StringBuilder();
        str.Append(categorydata.ToString());
        LocaleTaxonomy.Visible = true;
           if (str.ToString() == string.Empty)
        {
            LocaleTaxonomy.Visible = false;
        }
           else
        {
            LocaleTaxonomyList.Text = str.ToString();
        }
    }
예제 #3
0
    void EditEvent(string settings)
    {
        try
        {
            string sitepath = _commonAPI.SitePath;
            string webserviceURL = sitepath + "widgets/taxonomysummary/TSHandler.ashx";
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJQueryClueTipJS);
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
            JS.RegisterJSInclude(this, sitepath + "widgets/taxonomysummary/behavior.js", "TaxonomySummaryWidgetBehaviorJS");

            if (TaxonomyId > 0)
            {
                TaxonomySelected = "";
                JS.RegisterJSBlock(this, "Ektron.PFWidgets.TaxonomySummary.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.TaxonomySummary.setupAll();Ektron.PFWidgets.TaxonomySummary.SetTabs.init(); ", "EktronPFWidgetsTSInit");
            }
            else
            {
                PropertySelected = "";
                JS.RegisterJSBlock(this, "Ektron.PFWidgets.TaxonomySummary.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.TaxonomySummary.setupAll(); ", "EktronPFWidgetsTSInit");
            }

            Css.RegisterCss(this, sitepath + "widgets/taxonomysummary/TSStyle.css", "TSWidgetCSS");

            taxonomyid.Text = TaxonomyId.ToString();
            pagesize.Text = PageSize.ToString();
            TeaserCheckBox.Checked = Teaser;

            EnablePagingCheckBox.Checked = EnablePaging;

            OrderKeyDropDownList.SelectedValue = OrderKey;
            DirectionSelectDropDownList.SelectedValue = Direction;

            ViewSet.SetActiveView(Edit);

            string[] dirs = System.IO.Directory.GetDirectories(Server.MapPath("~/widgets/TaxonomySummary/themes"));
            uxThemes.Items.Clear();
            uxThemes.Attributes.Add("onchange", "javascript:Ektron.PFWidgets.TaxonomySummary.themesPreview(this.id,'" + uxFramePreview.ClientID + "','" + sitepath + "')");

            if (!(dirs == null || dirs.Length == 0))
            {
                for (int themeC = 0; themeC < dirs.Length; themeC++)
                {
                    string folderName = dirs[themeC];
                    folderName = folderName.Substring(folderName.LastIndexOf('\\') + 1);
                    if (string.Compare(folderName, "default", true) != 0)
                    {
                        uxThemes.Items.Insert(0, new ListItem(folderName, folderName.ToLower()));
                    }

                }
            }

            uxThemes.Items.Insert(0, new ListItem("Default", "default"));

            object obj = uxThemes.Items.FindByValue(SelectedThemes);
            if (obj != null)
            {
                uxThemes.SelectedIndex = -1;
                ((ListItem)obj).Selected = true;
            }

            //uxFramePreview.Src = ResolveUrl("~/widgets/TaxonomySummary/themes/") + SelectedThemes + "/preview.jpg";

            headertext.Text = HeaderText;

            //set taxonomy path
            Ektron.Cms.API.Content.Taxonomy _apiTaxonomy = new Ektron.Cms.API.Content.Taxonomy();
            Ektron.Cms.TaxonomyRequest taxRequest = new Ektron.Cms.TaxonomyRequest();
            taxRequest.TaxonomyId = TaxonomyId;
            taxRequest.IncludeItems = false;
            taxRequest.TaxonomyLanguage = _apiTaxonomy.ContentLanguage;
            Ektron.Cms.TaxonomyData taxData = _apiTaxonomy.LoadTaxonomy(ref taxRequest);

            if (!(taxData == null || string.IsNullOrEmpty(taxData.Path)))
            {
                taxonomypath.Text = taxData.Path ;
                m_strTaxonomyPath = taxData.Path;
            }
            else
            {
                taxonomypath.Text = "";
                m_strTaxonomyPath = "";
            }
        }
        catch (Exception e)
        {
            errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
            ViewSet.SetActiveView(View);
        }
    }