예제 #1
0
    /// <summary>
    /// Page Init
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Init(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                contentId = long.Parse(Request.QueryString["id"]);
                //    this.GetContentData(contentId);

                // XmlDocument xmlD = commonfunctions.getContentXML(contentId);

            }

            //Resource Type Taxonomy

            ResourceTypeTaxonomy.DataSource = AdminFunc.ResourceTypeTaxonomyDataTable; // commonfunctions.sortDataTable(commonfunctions.getTaxonomyTree(123), "TaxName", "ASC");
            ResourceTypeTaxonomy.DataBind();
            //ListItem li = new ListItem();
            //li.Text = "All Resources";
            //li.Value = "";
            //li.Selected = true;
            //ResourceTypeTaxonomy.Items.Add(li);

        }

        RightSideContent.ccontentID = mainContent.EkItem.Id.ToString();
        RightSideContent.cfolderID = mainContent.EkItem.FolderId.ToString();
        uxPageTitle.pgTitle = mainContent.EkItem.Title.ToString();
        uxPageTitle.pageId = mainContent.EkItem.Id.ToString();
        uxBreadcrumb.contentID = mainContent.EkItem.Id.ToString();
        mainContent.Text = "<!-- -->";
        uxPageTitle.ResourceTypeId = "2";

        XmlDocument XMLDoc = new XmlDocument();
        XMLDoc.LoadXml(mainContent.EkItem.Html);

        SActive = commonfunctions.getFieldValue(XMLDoc, "Active", "/SubjectAreas");
        if (SActive == "true")
        {
            SATitle = commonfunctions.getFieldValue(XMLDoc, "Name", "/SubjectAreas");

            string sadescript = commonfunctions.getFieldValue(XMLDoc, "FullDescription", "/SubjectAreas");

            int maxAllowedshown = 400;
            int wholeLength = sadescript.Length;
            if (wholeLength > maxAllowedshown)
            {

                SADescription = sadescript.Substring(0, maxAllowedshown) + "<a href=\"#\" class=\"show_text\">show more >></a>";
                SADescription += "  <span class='slidingDiv hide'>" + sadescript.Substring(maxAllowedshown, wholeLength - maxAllowedshown) + "<a href='#' class='hide_text'> << show less</a></span>";
            }
            else
            {
                SADescription = sadescript;
            }

            string allTaxonomy = commonfunctions.GetAssignedTaxonomyList(contentId);

            //make sure this is a subject area taxonomy - just in case this content is attached to many taxonomies
            string[] txIds = allTaxonomy.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            foreach (var taxID in txIds)
            {
                Ektron.Cms.Controls.Directory taxControl = new Ektron.Cms.Controls.Directory();
                taxControl.TaxonomyId = long.Parse(taxID);
                taxControl.Page = this.Page;
                taxControl.Fill();
                Ektron.Cms.TaxonomyData taxData = new Ektron.Cms.TaxonomyData();
                taxData = taxControl.TaxonomyTreeData;
                long parentId = taxData.ParentId;

                if (parentId == 136)
                {
                    SubjectAreaTaxID = taxID;
                    SubjectAreaTaxIDHF.Value = taxID;
                    break;
                }

            }

        }
          //  myFavCollection = commonfunctions.getAllmyFavorites();
        // Response.Write(SubjectAreaTaxID);
        if (IsPostBack)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "hash", "location.hash = '#MOVEHERE';", true);
        }
    }
예제 #2
0
    private string getAudienceTax(string cntID)
    {
        ArrayList assignCat = new ArrayList();
        string AudTaxID = string.Empty;
        assignCat = commonfunctions.GetAssignedTaxonomyArray(long.Parse(cntID));

        if (assignCat.Count > 0)
        {
            foreach (string taxID in assignCat)
            {

                Ektron.Cms.Controls.Directory taxControl = new Ektron.Cms.Controls.Directory();
                taxControl.TaxonomyId = long.Parse(taxID);
                taxControl.Page = this.Page;
                taxControl.Fill();
                Ektron.Cms.TaxonomyData taxData = new Ektron.Cms.TaxonomyData();
                taxData = taxControl.TaxonomyTreeData;
                long parentId = taxData.ParentId;

                if (parentId == 96)
                {
                    AudTaxID = taxID;

                    break;
                }
            }
        }

        return AudTaxID;
    }