Exemplo 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();
 }
Exemplo n.º 2
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);
        }
    }
Exemplo n.º 3
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;
            //}
        }
    }
Exemplo n.º 4
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);
        }
    }