Exemplo n.º 1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        m_refMsg = m_refCommon.EkMsgRef;
            AppImgPath = m_refCommon.AppImgPath;
            AppPath = m_refCommon.AppPath;
            m_strPageAction = Request.QueryString["action"];
            Utilities.SetLanguage(m_refCommon);
            MenuLanguage = m_refCommon.ContentLanguage;
            MenuId = Convert.ToInt64(Request.QueryString["menuid"]);
            if (Request.QueryString["view"] != null)
            {
                m_strViewItem = Request.QueryString["view"];
            }
            m_refContent = m_refCommon.EkContentRef;
            m_refContentApi = new ContentAPI();
            Utilities.SetLanguage(m_refContentApi);
            sitePath = m_refCommon.SitePath;

            m_strBackPage = Request.QueryString.ToString();
            // strip off refresh indicator
            if (m_strBackPage.EndsWith("&rf=1"))
            {
                // refresh is needed after we edit a submenu, but we don't want to keep refreshing if we use the same URL
                m_strBackPage = m_strBackPage.Substring(0, m_strBackPage.Length - 5);
            }

            DisplayPage();
    }
Exemplo n.º 2
0
 public Workarea_MenuActions()
 {
     m_CommonApi = new CommonApi();
     m_ContentApi = new ContentAPI();
     m_EkContent = m_ContentApi.EkContentRef;
     m_refMsg = m_ContentApi.EkMsgRef;
 }
Exemplo n.º 3
0
    private void ApproveContent()
    {
        long lId;
            bool ret;
            try
            {
                _EkContent = _CommonApi.EkContentRef;
                lId = System.Convert.ToInt64(Request.QueryString["id"]);
                ret = System.Convert.ToBoolean(_EkContent.Approvev2_0(lId));

                if (Request.QueryString["page"] == "workarea" || Request.QueryString["page"] == "tree")
                {
                    //' redertrect to the folder page.
                    //Response.Redirect("approval.aspx?action=viewApprovalList&fldid=" & Request.QueryString("fldid"), False)
                    // redirect to workarea
                    Response.Write("<script type=\"text/javascript\">" + "var rightFrame = top.document.getElementById(\'ek_main\');" + "var rightFrameUrl = \'approval.aspx?action=viewApprovalList\';" + ("var appPath  = \'" + _CommonApi.AppPath + "\';") + "rightFrame.src = appPath + rightFrameUrl;" + "</script>");
                }
                else
                {
                    Response.Write("<script language=\"Javascript\">" + "top.opener.location.reload(true);" + "top.close();" + "</script>");

                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
    }
Exemplo n.º 4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         Response.CacheControl = "no-cache";
         Response.AddHeader("Pragma", "no-cache");
         Response.Expires = -1;
         CurrentUserId = m_refCommon.RequestInformationRef.UserId;
         m_refContent = m_refCommon.EkContentRef;
         m_refMsg = m_refCommon.EkMsgRef;
         RegisterResources();
         //TODO: Ross - Not sure which role to check
         if ((CurrentUserId == 0) || (Convert.ToBoolean(m_refCommon.RequestInformationRef.IsMembershipUser) && m_refContent.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator, CurrentUserId, false) == false))
         {
             Response.Redirect("login.aspx?fromLnkPg=1", false);
             return;
         }
         else
         {
             AppImgPath = m_refCommon.AppImgPath;
             EnableMultilingual = m_refCommon.EnableMultilingual;
             if ((Request.QueryString["action"] != null) && Request.QueryString["action"] != "")
             {
                 m_strPageAction = Request.QueryString["action"].ToLower();
             }
             Utilities.SetLanguage(m_refCommon);
             MenuLanguage = m_refCommon.ContentLanguage;
             switch (m_strPageAction)
             {
                 case "deleted":
                     Message.Text = m_refMsg.GetMessage("lbl menu") + " \'" + Request.QueryString["title"] + "\' " + m_refMsg.GetMessage("lbl deleted");
                     Message.Text = Message.Text + "<script language=\"javascript\">" + "\r\n";
                     Message.Text = Message.Text + "top.refreshMenuAccordion(" + MenuLanguage + ");" + "\r\n";
                     Message.Text = Message.Text + "</script>" + "\r\n";
                     break;
                 case "viewcontent":
                 case "removeitems":
                     Control m_vi;
                     m_vi = (Control)(LoadControl("controls/menu/viewitems.ascx"));
                     m_vi.ID = "menu";
                     DataHolder.Controls.Add(m_vi);
                     break;
                 case "viewmenu":
                     Control m_va;
                     m_va = (Control)(LoadControl("controls/menu/viewmenu.ascx"));
                     m_va.ID = "menuprops";
                     DataHolder.Controls.Add(m_va);
                     break;
             }
         }
     }
     catch (System.Threading.ThreadAbortException)
     {
         //Do nothing
     }
     catch (Exception ex)
     {
         Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message + ".") + "&LangType=" + MenuLanguage), false);
     }
 }
Exemplo n.º 5
0
    private void Page_Init(System.Object sender, System.EventArgs e)
    {
        EkContent _EkContent = new EkContent(m_refApi.RequestInformationRef);
        EkMessageHelper m_refMsg = new EkMessageHelper(m_refApi.RequestInformationRef);
        if (!_EkContent.IsAllowed(m_refApi.RequestInformationRef.CallerId, m_refApi.RequestInformationRef.UserCulture, "users", "IsLoggedIn"))
            Response.Redirect(m_refApi.RequestInformationRef.SitePath + "workarea/login.aspx");

        //Register Page Components
        this.RegisterPackages();

        //set javascript strings
        this.SetJavascriptStrings();
    }
Exemplo n.º 6
0
 public bool IsWorkflowAdmin(long userId)
 {
     EkRequestInformation requestInfo = ObjectFactory.GetRequestInfoProvider().GetRequestInformation();
     EkContent EkContentInstance = new EkContent(requestInfo);
     IUserGroup _usergroupmanager = ObjectFactory.GetUserGroup(requestInfo);
     if (EkContentInstance.IsARoleMember((long)EkEnumeration.CmsRoleIds.ContentWorkflowAdmin, requestInfo.UserId, true)
         || _usergroupmanager.IsUserInGroup(requestInfo.UserId, 1) || requestInfo.CallerId == EkConstants.InternalAdmin)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        capi = new ContentAPI();
        m_refContent = new EkContent(capi.RequestInformationRef);
        if (!(_siteApi.IsAdmin() || m_refContent.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin, capi.RequestInformationRef.UserId, false)))
        {

                Response.Redirect("blank.htm", false);
        }
        else
        {
            InitializeHeader();
            InitializeTitleBar();
            InitializeContent();
        }
    }
Exemplo n.º 8
0
 private void Action_PurgeHistory()
 {
     Collection iSrc = new Collection();
         bool bRet;
         string ErrorString = "";
         string datePurge = DateTime.Today.ToShortDateString();
         try
         {
             m_contentRef = m_refAPI.EkContentRef;
             if (Request.Form["frm_purge_date"] != "")
             {
                 datePurge = Request.Form["frm_purge_date"];
             }
             iSrc.Add(datePurge, "PurgeDate", null, null);
             m_FolderId = System.Convert.ToInt64(frm_folder_id.Value);
             iSrc.Add(m_FolderId, "FolderID", null, null);
             if (this.chkRecursivePurge.Checked)
             {
                 iSrc.Add(1, "Recursive", null, null);
             }
             else
             {
                 iSrc.Add(0, "Recursive", null, null);
             }
             if (this.chkPurgePublished.Checked)
             {
                 iSrc.Add(1, "IncludePublished", null, null);
             }
             else
             {
                 iSrc.Add(0, "IncludePublished", null, null);
             }
             bRet = m_contentRef.PurgeContentHitory(iSrc, ErrorString);
             if (ErrorString == "")
             {
                 Response.Redirect((string) ("content.aspx?action=ViewFolder&id=" + m_FolderId), false);
             }
         }
         catch (Exception ex)
         {
             Utilities.ShowError(ex.Message);
         }
 }
Exemplo n.º 9
0
    private void DeclineContent()
    {
        long lId;
            bool ret;
            try
            {
                lId = long.Parse(Request.QueryString["id"]);
                _EkContent = _CommonApi.EkContentRef;
                string reason = "";
                if (! (Request.QueryString["comment"] == null))
                {
                    reason = Request.QueryString["comment"];
                }
                ret = System.Convert.ToBoolean(_EkContent.DeclineApproval2_0(lId, reason));

                if (Request.QueryString["page"] == "workarea")
                {
                    //' re-direct to the folder page.
                    Response.Redirect((string) ("approval.aspx?action=viewApprovalList&fldid=" + Request.QueryString["fldid"]), false);
                    // redirect to workarea
                    //Response.Write("<script language=""Javascript"">" & _
                    //                       "top.switchDesktopTab();" & _
                    //                       "</script>")
                }
                else if (Request.QueryString["page"] == "dmsmenu")
                {
                    // re-direct to the folder page.
                    //Response.Redirect("approval.aspx?action=viewApprovalList&fldid=" & Request.QueryString("fldid"), False)
                }
                else
                {
                    Response.Write("<script language=\"Javascript\">" + "top.opener.location.reload(true);" + "top.close();" + "</script>");
                }
            }
            catch (Exception ex)
            {
                Utilities.ShowError(ex.Message);
            }
    }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RegisterResources();

        Collection cFolders = null;
        long subfolderid = -1;
        long locID = -1;
        long backID = -1;
        Collection cRecursive = null;
        bool rec = false;
        bool CanCreateContent = false;
        string AddType = "";
        string MenuTitle = "";
        string CachedId = "";
        bool canTraverse = true;

        CurrentUserID = AppUI.UserId;
        AppImgPath = AppUI.AppImgPath;
        AppPath = AppUI.AppPath;
        sitePath = AppUI.SitePath;
        MsgHelper = AppUI.EkMsgRef;

        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        } else {
            if (!string.IsNullOrEmpty(Convert.ToString(AppUI.GetCookieValue("LastValidLanguageID")))) {
                ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }
        AppUI.ContentLanguage = ContentLanguage;

        folderId = Convert.ToInt64(Request.QueryString["folderid"]);
        mpID = Convert.ToInt64(Request.QueryString["parentid"]);
        maID = Convert.ToInt64(Request.QueryString["ancestorid"]);
        if (!string.IsNullOrEmpty(Request.QueryString["SelTaxonomyID"]))
        {
            selTaxID = Convert.ToInt64(Request.QueryString["SelTaxonomyID"]);
        }

        if (CommonApi.GetEcmCookie().HasKeys)
        {
            CurrentUserID = Convert.ToInt64(CommonApi.GetEcmCookie()["user_id"]);
        }
        else
        {
            CurrentUserID = 0;
        }

        AddType = Strings.LCase(Request.QueryString["addto"]);
        if (string.IsNullOrEmpty(AddType))
        {
            AddType = "collection";
        }
        nID = Convert.ToInt64(Request.QueryString["nid"]);
        subfolderid = Convert.ToInt64(Request.QueryString["subfolderid"]);
        if ( !string.IsNullOrEmpty(Request.QueryString["cacheidentifier"]))
        {
            CachedId = "&cacheidentifier=" + Request.QueryString["cacheidentifier"];
        }
        if (subfolderid > 0)
        {
            locID = subfolderid;
        }
        else
        {
            locID = folderId;
        }

        gtObj = AppUI.EkContentRef;
        SiteObj = AppUI.EkSiteRef;
        cPerms = SiteObj.GetPermissions(locID, 0, "folder");
        canTraverse = Convert.ToBoolean(cPerms["TransverseFolder"]);
        if (ErrorString != "")
        {
            CanCreateContent = false;
        } else
        {
            CanCreateContent = Convert.ToBoolean(cPerms["Add"]);
        }

        if (AddType == "menu" || AddType == "submenu")
        {
            cRecursive = gtObj.GetMenuByID(nID, 0,false);
            if (string.IsNullOrEmpty(ErrorString))
            {
                if (cRecursive.Count > 0)
                {
                    MenuTitle = cRecursive["MenuTitle"].ToString();
                    rec = Convert.ToBoolean(cRecursive["Recursive"]);
                }
            }
        }
        else
        {
            cRecursive = gtObj.GetEcmCollectionByID(nID, false, false, ref ErrorString, true, false, true);
            if (string.IsNullOrEmpty(ErrorString))
            {
                if (cRecursive.Count > 0)
                {
                    CollectionTitle = cRecursive["CollectionTitle"].ToString();
                    rec = Convert.ToBoolean(cRecursive["Recursive"]);
                }
            }
            else
            {
                pnlError.Visible = true;
                pnlPage.Visible = false;
            }
        }
        if (!canTraverse)
        {
            rec = false;
        }
        if (rec && ErrorString == "")
        {
            cTmp = new Collection();
            cTmp.Add(Convert.ToInt64(locID), "ParentID",null,null);
            cTmp.Add("name", "OrderBy",null,null);
            cFolders = gtObj.GetAllViewableChildFoldersv2_0(cTmp);
        }
        if (ErrorString == "")
        {
            gtNavs = gtObj.GetFolderInfov2_0(locID);

            if(gtNavs.Count > 0)
            {
                FolderName = gtNavs["FolderName"].ToString();
                backID = Convert.ToInt64(gtNavs["ParentID"]);
            }

        }
        StringBuilder sb = new StringBuilder();
        //ToolBar
        sb.Append("<table width=\"100%\">").Append(Environment.NewLine);
        if(rec)
        {
            if(locID != 0)
            {
                sb.Append("<tr>").Append(Environment.NewLine);
                sb.Append("  <td>").Append(Environment.NewLine);
                sb.Append("     <a href=\"collectiontree.aspx?nId=").Append(nID).Append("&folderid=").Append(folderId).Append("&subfolderid=").Append(backID).Append("&addto=").Append(AddType).Append("&parentid=").Append(mpID).Append("&ancestorid=").Append(maID).Append("&SelTaxonomyID=").Append(selTaxID).Append("\" ").Append(Environment.NewLine);
                sb.Append("         title=\"").Append(MsgHelper.GetMessage("alt: generic previous dir text")).Append("\" > ").Append(Environment.NewLine);
                sb.Append("        <img src=\"").Append(AppPath + "images/UI/Icons/folderUp.png").Append("\" title=\"").Append(MsgHelper.GetMessage("alt: generic previous dir text")).Append("\"  alt=\"").Append(MsgHelper.GetMessage("alt: generic previous dir text")).Append("\" align=\"absbottom\"/>..").Append(Environment.NewLine);
                sb.Append("     </a>").Append(Environment.NewLine);
                sb.Append("  </td>").Append(Environment.NewLine);
                sb.Append("  <td>&nbsp;</td>").Append(Environment.NewLine);
                sb.Append("  <td>&nbsp;</td>").Append(Environment.NewLine);
                sb.Append("</tr>").Append(Environment.NewLine);
           }

            foreach( Collection folder in cFolders)
            {
                if(Convert.ToInt32(folder["FolderType"]) <= 1)
                {
                    sb.Append("<tr>").Append(Environment.NewLine);
                    sb.Append("    <td nowrap=\"true\">").Append(Environment.NewLine);
                    sb.Append("         <a href=\"collectiontree.aspx?nId=").Append(nID).Append("&folderid=").Append(folderId).Append("&subfolderid=").Append(folder["ID"]).Append("&addto=").Append(AddType).Append("&parentid=").Append(mpID).Append("&ancestorid=").Append(maID).Append("&SelTaxonomyID=").Append(selTaxID).Append("\" ").Append(Environment.NewLine);
                    sb.Append("           title=\"").Append(MsgHelper.GetMessage("alt: generic view folder content text")).Append("\">").Append(Environment.NewLine);
                    sb.Append("         <img src=\"").Append(AppImgPath).Append(Convert.ToInt32(folder["FolderType"]) == 1 ? "folders/blogfolderopen.gif": "folderclosed_1.gif").Append("\" title=\"").Append(MsgHelper.GetMessage("alt: generic view folder content text")).Append("\" alt=\"").Append(MsgHelper.GetMessage("alt: generic view folder content text")).Append("\" align=\"absbottom\"/>").Append(folder["Name"]).Append(Environment.NewLine);
                    sb.Append("     </a>").Append(Environment.NewLine);
                    sb.Append("  </td>").Append(Environment.NewLine);
                    sb.Append("  <td>&nbsp;</td>").Append(Environment.NewLine);
                    sb.Append("  <td>&nbsp;</td>").Append(Environment.NewLine);
                    sb.Append("</tr>").Append(Environment.NewLine);
                }
            }
        }

         sb.Append("<tr>").Append(Environment.NewLine);
         sb.Append("    <td align=\"center\" colspan=\"3\">").Append(Environment.NewLine);
         sb.Append("       <hr/>").Append(Environment.NewLine);
         sb.Append("    </td>").Append(Environment.NewLine);
         sb.Append("</tr>").Append(Environment.NewLine);

          sb.Append("<tr>").Append(Environment.NewLine);
         sb.Append("    <td align=\"center\" colspan=\"3\">").Append(Environment.NewLine);
         sb.Append("       First Pick the folder").Append(Environment.NewLine);
         sb.Append("    </td>").Append(Environment.NewLine);
         sb.Append("</tr>").Append(Environment.NewLine);

         sb.Append("<tr>").Append(Environment.NewLine);
         sb.Append("    <td align=\"center\" colspan=\"3\">").Append(Environment.NewLine);
         if(AddType == "submenu")
             sb.Append("    <input name=\"next\" type=\"button\" value=\"Next...\" onclick=\"javascript:location.href='collections.aspx?action=AddSubMenu&LangType=").Append(ContentLanguage).Append("&folderid=").Append(locID).Append("&nId=").Append(nID).Append("&parentid=").Append(mpID).Append("&ancestorid=").Append(maID).Append("&SelTaxonomyID=").Append(selTaxID).Append("'\" />").Append(Environment.NewLine);
         else
             sb.Append("    <input name=\"next\" type=\"button\" value=\"Next...\" onclick=\"javascript:location.href='editarea.aspx?LangType=").Append(ContentLanguage).Append("&type=add&id=").Append(locID).Append("&SelTaxonomyID=").Append(selTaxID).Append("&mycollection=").Append(nID).Append("&addto=").Append(AddType).Append(CachedId).Append("'\" />").Append(Environment.NewLine);
         sb.Append("    </td>").Append(Environment.NewLine);
         sb.Append("</tr>").Append(Environment.NewLine);

         sb.Append("</table>").Append(Environment.NewLine);
         ltrPage.Text  = sb.ToString();
    }
Exemplo n.º 11
0
 private void Process_DoEditPermission()
 {
     try
     {
         _EkContent = _ContentApi.EkContentRef;
         _PageData = new Collection();
         if (Request.Form[hmembershiptype.UniqueID] == "1")
         {
             if (Request.Form[frm_readonly.UniqueID] == "1")
             {
                 _PageData.Add(1, "ReadOnly", null, null);
             }
             else
             {
                 _PageData.Add(0, "ReadOnly", null, null);
             }
             if (Request.Form[frm_add.UniqueID] == "1")
             {
                 _PageData.Add(1, "Add", null, null);
             }
             else
             {
                 _PageData.Add(0, "Add", null, null);
             }
             if (Request.Form[frm_edit.UniqueID] == "1")
             {
                 _PageData.Add(1, "Edit", null, null);
             }
             else
             {
                 _PageData.Add(0, "Edit", null, null);
             }
             if (Request.Form[frm_delete.UniqueID] == "1")
             {
                 _PageData.Add(1, "Delete", null, null);
             }
             else
             {
                 _PageData.Add(0, "Delete", null, null);
             }
             _PageData.Add(0, "Restore", null, null);
             if (Request.Form[frm_addimages.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddToImageLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddToImageLib", null, null);
             }
             if (Request.Form[frm_addfiles.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddToFileLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddToFileLib", null, null);
             }
             _PageData.Add(0, "AddToHyperlinkLib", null, null);
             _PageData.Add(0, "OverwriteLib", null, null);
             _PageData.Add(0, "AddFolders", null, null);
             _PageData.Add(0, "EditFolders", null, null);
             _PageData.Add(0, "DeleteFolders", null, null);
             _PageData.Add(0, "Collections", null, null);
             _PageData.Add(0, "TransverseFolder", null, null);
             _PageData.Add(0, "EditApprovals", null, null);
             if (Request.Form[frm_libreadonly.UniqueID] == "1")
             {
                 _PageData.Add(1, "ReadOnlyLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "ReadOnlyLib", null, null);
             }
         }
         else
         {
             if (Request.Form[frm_readonly.UniqueID] == "1")
             {
                 _PageData.Add(1, "ReadOnly", null, null);
             }
             else
             {
                 _PageData.Add(0, "ReadOnly", null, null);
             }
             if (Request.Form[frm_edit.UniqueID] == "1")
             {
                 _PageData.Add(1, "Edit", null, null);
             }
             else
             {
                 _PageData.Add(0, "Edit", null, null);
             }
             if (Request.Form[frm_add.UniqueID] == "1")
             {
                 _PageData.Add(1, "Add", null, null);
             }
             else
             {
                 _PageData.Add(0, "Add", null, null);
             }
             if (Request.Form[frm_delete.UniqueID] == "1")
             {
                 _PageData.Add(1, "Delete", null, null);
             }
             else
             {
                 _PageData.Add(0, "Delete", null, null);
             }
             if (Request.Form[frm_restore.UniqueID] == "1")
             {
                 _PageData.Add(1, "Restore", null, null);
             }
             else
             {
                 _PageData.Add(0, "Restore", null, null);
             }
             if (Request.Form[frm_libreadonly.UniqueID] == "1")
             {
                 _PageData.Add(1, "ReadOnlyLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "ReadOnlyLib", null, null);
             }
             if (Request.Form[frm_addimages.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddToImageLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddToImageLib", null, null);
             }
             if (Request.Form[frm_addfiles.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddToFileLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddToFileLib", null, null);
             }
             if (Request.Form[frm_addhyperlinks.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddToHyperlinkLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddToHyperlinkLib", null, null);
             }
             if (Request.Form[frm_overwritelib.UniqueID] == "1")
             {
                 _PageData.Add(1, "OverwriteLib", null, null);
             }
             else
             {
                 _PageData.Add(0, "OverwriteLib", null, null);
             }
             if (Request.Form[frm_add_folders.UniqueID] == "1")
             {
                 _PageData.Add(1, "AddFolders", null, null);
             }
             else
             {
                 _PageData.Add(0, "AddFolders", null, null);
             }
             if (Request.Form[frm_edit_folders.UniqueID] == "1")
             {
                 _PageData.Add(1, "EditFolders", null, null);
             }
             else
             {
                 _PageData.Add(0, "EditFolders", null, null);
             }
             if (Request.Form[frm_delete_folders.UniqueID] == "1")
             {
                 _PageData.Add(1, "DeleteFolders", null, null);
             }
             else
             {
                 _PageData.Add(0, "DeleteFolders", null, null);
             }
             if (Request.Form[frm_transverse_folder.UniqueID] == "1")
             {
                 _PageData.Add(1, "TransverseFolder", null, null);
             }
             else
             {
                 _PageData.Add(0, "TransverseFolder", null, null);
             }
             if (Request.Form[frm_navigation.UniqueID] == "1")
             {
                 _PageData.Add(1, "Collections", null, null);
             }
             else
             {
                 _PageData.Add(0, "Collections", null, null);
             }
             if (!(Request.Form[frm_edit_preapproval.UniqueID] == null))
             {
                 if (Request.Form[frm_edit_preapproval.UniqueID] == "1")
                 {
                     _PageData.Add(1, "EditApprovals", null, null);
                 }
                 else
                 {
                     _PageData.Add(0, "EditApprovals", null, null);
                 }
             }
             else
             {
                 _PageData.Add(0, "EditApprovals", null, null);
             }
         }
         if (Request.Form[frm_type.UniqueID] == "folder")
         {
             _PageData.Add(Request.Form[frm_itemid.UniqueID], "FolderID", null, null);
             _PageData.Add("", "ContentID", null, null);
         }
         else
         {
             _PageData.Add(Request.Form[frm_itemid.UniqueID], "ContentID", null, null);
             _PageData.Add("", "FolderID", null, null);
         }
         if (Request.Form[frm_base.UniqueID] == "group")
         {
             _PageData.Add(Request.Form[frm_permid.UniqueID], "UserGroupID", null, null);
             _PageData.Add("", "UserID", null, null);
         }
         else
         {
             _PageData.Add(Request.Form[frm_permid.UniqueID], "UserID", null, null);
             _PageData.Add("", "UserGroupID", null, null);
         }
         _EkContent.UpdateItemPermissionv2_0(_PageData);
         Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewPermissions&id=" + Request.Form[frm_itemid.UniqueID] + "&type=" + Request.Form[frm_type.UniqueID] + "&membership=" + Request.Form[frm_membership.UniqueID]), false);
     }
     catch (Exception ex)
     {
         Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message)), false);
     }
 }
Exemplo n.º 12
0
    private void Process_DoAddFolderPermission()
    {
        string[] userID = null;
        string[] groupID = null;
        int _userIDs = 0;
        int _grpIDs = 0;
        string @base = Request.Form[frm_base.UniqueID];
        string strUserID = "";
        string strGroupID = "";
        frm_itemid.Value = _Id.ToString();
        string finalUserGroupID = "";

        if (!string.IsNullOrEmpty(Request.QueryString["userIds"]))
        {
            userID = Request.QueryString["userIds"].Split(',');
            _userIDs = userID.Length;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["groupIds"]))
        {
            groupID = Request.QueryString["groupIds"].Split(',');
            _grpIDs = groupID.Length;
        }
        if (_userIDs + _grpIDs == 1)
        {
            if (_userIDs == 1)
            {
                @base = "user";
                strUserID = Request.QueryString["userIds"];
            }
            else
            {
                @base = "group";
                strGroupID = Request.QueryString["groupIds"];
            }
        }
        string[] readOnlyPermission = Request.Form[frm_readonly.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] editPermission = Request.Form[frm_edit.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] addPermission = Request.Form[frm_add.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] deletePermission = Request.Form[frm_delete.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] readOnlyLibPermission = Request.Form[frm_libreadonly.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] addToImageLibPermission = Request.Form[frm_addimages.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] addToFileLibPermission = Request.Form[frm_addfiles.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] restorePermission = null;
        if (!(Request.Form[frm_restore.UniqueID] == null) && Request.Form[frm_restore.UniqueID] != "")
        {
            restorePermission = Request.Form[frm_restore.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }
        string[] addToHyperlinkLibPermission = null;
        if (!(Request.Form[frm_addhyperlinks.UniqueID] == null) && Request.Form[frm_addhyperlinks.UniqueID] != "")
        {
            addToHyperlinkLibPermission = Request.Form[frm_addhyperlinks.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }
        string[] overwriteLibPermission = null;
        if (!(Request.Form[frm_overwritelib.UniqueID] == null) && Request.Form[frm_overwritelib.UniqueID] != "")
        {
            overwriteLibPermission = Request.Form[frm_overwritelib.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }
        string[] addFoldersPermission = Request.Form[frm_add_folders.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] editFoldersPermission = Request.Form[frm_edit_folders.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] deleteFoldersPermission = Request.Form[frm_delete_folders.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        string[] transverseFoldersPermission = null;
        if (!(Request.Form[frm_transverse_folder.UniqueID] == null) && Request.Form[frm_transverse_folder.UniqueID] != "")
        {
            transverseFoldersPermission = Request.Form[frm_transverse_folder.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }
        string[] collectionsPermission = null;
        if (!(Request.Form[frm_navigation.UniqueID] == null) && Request.Form[frm_navigation.UniqueID] != "")
        {
            collectionsPermission = Request.Form[frm_navigation.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }

        string[] editApprovalssPermission = null;
        if (!(Request.Form[frm_edit_preapproval.UniqueID] == null))
        {
            editApprovalssPermission = Request.Form[frm_edit_preapproval.UniqueID].Remove(0, 1).Split(",".ToCharArray());
        }

        switch (@base)
        {
            case "":
                int userCount = 0;

                string[] userGroupId = new string[_userIDs + (_grpIDs - 1) + 1];
                if (_grpIDs > 0 && _userIDs > 0)
                {
                    groupID.CopyTo(userGroupId, 0);
                    userID.CopyTo(userGroupId, groupID.Length);
                }
                else if (_grpIDs > 0)
                {
                    groupID.CopyTo(userGroupId, 0);
                }
                else
                {
                    userID.CopyTo(userGroupId, 0);
                }
                for (userCount = 0; userCount <= userGroupId.Length - 1; userCount++)
                {
                    _EkContent = _ContentApi.EkContentRef;
                    _PageData = new Collection();
                    if (Request.Form[hmembershiptype.UniqueID] == "1")
                    {
                        if ((readOnlyPermission[userCount] == "1") || readOnlyPermission[userCount].ToString().ToLower() == "on")
                        {
                            _PageData.Add(1, "ReadOnly", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnly", null, null);
                        }
                        if ((editPermission[userCount] == "1") || (editPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Edit", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Edit", null, null);
                        }
                        if ((addPermission[userCount] == "1") || (addPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Add", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Add", null, null);
                        }
                        if ((deletePermission[userCount] == "1") || (deletePermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Delete", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Delete", null, null);
                        }
                        _PageData.Add(0, "Restore", null, null);
                        if ((readOnlyLibPermission[userCount] == "1") || (readOnlyLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "ReadOnlyLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnlyLib", null, null);
                        }
                        if ((addToImageLibPermission[userCount] == "1") || (addToImageLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "AddToImageLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToImageLib", null, null);
                        }
                        if ((addToFileLibPermission[userCount] == "1") || (addToFileLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "AddToFileLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToFileLib", null, null);
                        }
                        _PageData.Add(0, "AddToHyperlinkLib", null, null);
                        _PageData.Add(0, "OverwriteLib", null, null);
                        _PageData.Add(0, "AddFolders", null, null);
                        _PageData.Add(0, "EditFolders", null, null);
                        _PageData.Add(0, "DeleteFolders", null, null);
                        _PageData.Add(0, "Collections", null, null);
                        _PageData.Add(0, "TransverseFolder", null, null);
                        _PageData.Add(0, "EditApprovals", null, null);
                    }
                    else
                    {
                        if ((readOnlyPermission[userCount] == "1") || (readOnlyPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "ReadOnly", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnly", null, null);
                        }
                        if ((editPermission[userCount] == "1") || (editPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Edit", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Edit", null, null);
                        }
                        if ((addPermission[userCount] == "1") || (addPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Add", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Add", null, null);
                        }
                        if ((deletePermission[userCount] == "1") || (deletePermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "Delete", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Delete", null, null);
                        }
                        if (restorePermission != null && ((restorePermission[userCount] == "1") || (restorePermission[userCount].ToString().ToLower() == "on")))
                        {
                            _PageData.Add(1, "Restore", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Restore", null, null);
                        }
                        if ((readOnlyLibPermission[userCount] == "1") || (readOnlyLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "ReadOnlyLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnlyLib", null, null);
                        }
                        if ((addToImageLibPermission[userCount] == "1") || (addToImageLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "AddToImageLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToImageLib", null, null);
                        }
                        if ((addToFileLibPermission[userCount] == "1") || (addToFileLibPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "AddToFileLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToFileLib", null, null);
                        }
                        if (addToHyperlinkLibPermission != null && ((addToHyperlinkLibPermission[userCount] == "1") || (addToHyperlinkLibPermission[userCount].ToString().ToLower() == "on")))
                        {
                            _PageData.Add(1, "AddToHyperlinkLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToHyperlinkLib", null, null);
                        }
                        if (overwriteLibPermission != null && ((overwriteLibPermission[userCount] == "1") || (overwriteLibPermission[userCount].ToString().ToLower() == "on")))
                        {
                            _PageData.Add(1, "OverwriteLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "OverwriteLib", null, null);
                        }

                        if ((addFoldersPermission[userCount] == "1") || (addFoldersPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "AddFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddFolders", null, null);
                        }
                        if ((editFoldersPermission[userCount] == "1") || (editFoldersPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "EditFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "EditFolders", null, null);
                        }
                        if ((deleteFoldersPermission[userCount] == "1") || (deleteFoldersPermission[userCount].ToString().ToLower() == "on"))
                        {
                            _PageData.Add(1, "DeleteFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "DeleteFolders", null, null);
                        }
                        if (transverseFoldersPermission != null && ((transverseFoldersPermission[userCount] == "1") || (transverseFoldersPermission[userCount].ToString().ToLower() == "on")))
                        {
                            _PageData.Add(1, "TransverseFolder", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "TransverseFolder", null, null);
                        }
                        if (collectionsPermission != null && ((collectionsPermission[userCount] == "1") || (collectionsPermission[userCount].ToString().ToLower() == "on")))
                        {
                            _PageData.Add(1, "Collections", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Collections", null, null);
                        }

                        if (!(editApprovalssPermission == null))
                        {
                            if ((editApprovalssPermission[userCount] == "1") || (editApprovalssPermission[userCount].ToString().ToLower() == "on"))
                            {
                                _PageData.Add(1, "EditApprovals", null, null);
                            }
                            else
                            {
                                _PageData.Add(0, "EditApprovals", null, null);
                            }
                        }
                        else
                        {
                            _PageData.Add(0, "EditApprovals", null, null);
                        }
                    }

                    if (Request.Form[frm_type.UniqueID] == "folder")
                    {
                        _PageData.Add(Request.Form[frm_itemid.UniqueID], "FolderID", null, null);
                        _PageData.Add("", "ContentID", null, null);
                    }
                    else
                    {
                        _PageData.Add(Request.Form[frm_itemid.UniqueID], "ContentID", null, null);
                        _PageData.Add("", "FolderID", null, null);
                    }
                    if (userCount < _grpIDs)
                    {
                        _PageData.Add(userGroupId[userCount], "UserGroupID", null, null);
                        _PageData.Add("", "UserID", null, null);
                    }
                    else
                    {
                        _PageData.Add(userGroupId[userCount], "UserID", null, null);
                        _PageData.Add("", "UserGroupID", null, null);
                    }
                    bool m_bReturn;
                    m_bReturn = _EkContent.AddItemPermission(_PageData);
                }
                Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewPermissions&id=" + Request.Form[frm_itemid.UniqueID] + "&type=" + Request.Form[frm_type.UniqueID] + "&membership=" + Request.Form[frm_membership.UniqueID]), false);
                break;

            default:
                try
                {
                    _EkContent = _ContentApi.EkContentRef;
                    _PageData = new Collection();
                    if (Request.Form[hmembershiptype.UniqueID] == "1")
                    {
                        if ((Request.Form["frm_readonly"] == "1") || Request.Form["frm_readonly"].ToString().ToLower() == "on")
                        {
                            _PageData.Add(1, "ReadOnly", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnly", null, null);
                        }
                        if (Request.Form[frm_edit.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Edit", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Edit", null, null);
                        }
                        if (Request.Form[frm_add.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Add", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Add", null, null);
                        }
                        if (Request.Form[frm_delete.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Delete", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Delete", null, null);
                        }
                        _PageData.Add(0, "Restore", null, null);
                        if (Request.Form[frm_libreadonly.UniqueID] == "1")
                        {
                            _PageData.Add(1, "ReadOnlyLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnlyLib", null, null);
                        }
                        if (Request.Form[frm_addimages.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddToImageLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToImageLib", null, null);
                        }
                        if (Request.Form[frm_addfiles.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddToFileLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToFileLib", null, null);
                        }
                        _PageData.Add(0, "AddToHyperlinkLib", null, null);
                        _PageData.Add(0, "OverwriteLib", null, null);
                        _PageData.Add(0, "AddFolders", null, null);
                        _PageData.Add(0, "EditFolders", null, null);
                        _PageData.Add(0, "DeleteFolders", null, null);
                        _PageData.Add(0, "Collections", null, null);
                        _PageData.Add(0, "TransverseFolder", null, null);
                        _PageData.Add(0, "EditApprovals", null, null);
                    }
                    else
                    {
                        if (Request.Form[frm_readonly.UniqueID] == "1")
                        {
                            _PageData.Add(1, "ReadOnly", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnly", null, null);
                        }
                        if (Request.Form[frm_edit.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Edit", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Edit", null, null);
                        }
                        if (Request.Form[frm_add.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Add", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Add", null, null);
                        }
                        if (Request.Form[frm_delete.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Delete", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Delete", null, null);
                        }
                        if (Request.Form[frm_restore.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Restore", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Restore", null, null);
                        }
                        if (Request.Form[frm_libreadonly.UniqueID] == "1")
                        {
                            _PageData.Add(1, "ReadOnlyLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "ReadOnlyLib", null, null);
                        }
                        if (Request.Form[frm_addimages.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddToImageLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToImageLib", null, null);
                        }
                        if (Request.Form[frm_addfiles.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddToFileLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToFileLib", null, null);
                        }
                        if (Request.Form[frm_addhyperlinks.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddToHyperlinkLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddToHyperlinkLib", null, null);
                        }
                        if (Request.Form[frm_overwritelib.UniqueID] == "1")
                        {
                            _PageData.Add(1, "OverwriteLib", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "OverwriteLib", null, null);
                        }

                        if (Request.Form[frm_add_folders.UniqueID] == "1")
                        {
                            _PageData.Add(1, "AddFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "AddFolders", null, null);
                        }
                        if (Request.Form[frm_edit_folders.UniqueID] == "1")
                        {
                            _PageData.Add(1, "EditFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "EditFolders", null, null);
                        }
                        if (Request.Form[frm_delete_folders.UniqueID] == "1")
                        {
                            _PageData.Add(1, "DeleteFolders", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "DeleteFolders", null, null);
                        }
                        if (Request.Form[frm_transverse_folder.UniqueID] == "1")
                        {
                            _PageData.Add(1, "TransverseFolder", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "TransverseFolder", null, null);
                        }
                        if (Request.Form[frm_navigation.UniqueID] == "1")
                        {
                            _PageData.Add(1, "Collections", null, null);
                        }
                        else
                        {
                            _PageData.Add(0, "Collections", null, null);
                        }

                        if (!(Request.Form[frm_edit_preapproval.UniqueID] == null))
                        {
                            if (Request.Form[frm_edit_preapproval.UniqueID] == "1")
                            {
                                _PageData.Add(1, "EditApprovals", null, null);
                            }
                            else
                            {
                                _PageData.Add(0, "EditApprovals", null, null);
                            }
                        }
                        else
                        {
                            _PageData.Add(0, "EditApprovals", null, null);
                        }
                    }

                    if (Request.Form[frm_type.UniqueID] == "folder")
                    {
                        _PageData.Add(Request.Form[frm_itemid.UniqueID], "FolderID", null, null);
                        _PageData.Add("", "ContentID", null, null);
                    }
                    else
                    {
                        _PageData.Add(Request.Form[frm_itemid.UniqueID], "ContentID", null, null);
                        _PageData.Add("", "FolderID", null, null);
                    }
                    if (Request.Form[frm_base.UniqueID] == "")
                    {
                        if (Request.QueryString["groupIds"] == "")
                        {
                            finalUserGroupID = strUserID;
                        }
                        else
                        {
                            finalUserGroupID = strGroupID;
                        }
                    }
                    else
                    {
                        finalUserGroupID = Request.Form[frm_permid.UniqueID];
                    }

                    if (Request.Form[frm_base.UniqueID] == "group")
                    {
                        _PageData.Add(finalUserGroupID, "UserGroupID", null, null);
                        _PageData.Add("", "UserID", null, null);
                    }
                    else if (Request.Form[frm_base.UniqueID] == "user")
                    {
                        _PageData.Add(finalUserGroupID, "UserID", null, null);
                        _PageData.Add("", "UserGroupID", null, null);
                    }
                    else if (Request.QueryString["groupIds"] != "")
                    {
                        _PageData.Add(finalUserGroupID, "UserGroupID", null, null);
                        _PageData.Add("", "UserID", null, null);
                    }
                    else if (Request.QueryString["userIds"] != "")
                    {
                        _PageData.Add(finalUserGroupID, "UserID", null, null);
                        _PageData.Add("", "UserGroupID", null, null);
                    }

                    bool m_bReturn;
                    m_bReturn = _EkContent.AddItemPermission(_PageData);
                    Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewPermissions&id=" + Request.Form[frm_itemid.UniqueID] + "&type=" + Request.Form[frm_type.UniqueID] + "&membership=" + Request.Form[frm_membership.UniqueID]), false);
                }
                catch (Exception ex)
                {
                    Response.Redirect((string)("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message)), false);
                }
                break;
        }
    }
Exemplo n.º 13
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        cContent = m_refContentApi.EkContentRef;
        aAllBoards = (DiscussionBoard[])Array.CreateInstance(typeof(DiscussionBoard), 0);
        bIsAdmin = m_refContentApi.IsAdmin();
        base.Page_Load(sender, e);
        Ektron.Cms.CommonApi api = new Ektron.Cms.CommonApi();

        if (Request.QueryString["boardid"] != "")
        {
            m_iBoardID = Convert.ToInt64(Request.QueryString["boardid"]);
        }

        if (Convert.ToBoolean(api.RequestInformationRef.IsMembershipUser) || api.RequestInformationRef.UserId == 0)
        {
            Response.Redirect(api.SitePath + "login.aspx", true);
            return;
        }
        else if (!m_refContentApi.IsARoleMemberForFolder_FolderUserAdmin(m_iBoardID, api.RequestInformationRef.UserId, false) && !m_refContentApi.IsAdmin())
        {
            Utilities.ShowError(m_refMsg.GetMessage("com: user does not have permission"));
            return;
        }
        else
        {
            if (!string.IsNullOrEmpty(Request.QueryString["fromboard"]))
            {
                bfromboard = true;
            }

            SetLabels();

            switch (this.m_sPageAction)
            {
                case "edit":
                    if (Page.IsPostBack)
                    {
                        Process_AddEdit();
                    }
                    else
                    {
                        AddEdit();
                    }
                    break;
                case "view":
                    View();
                    break;
                case "delete":
                    Delete();
                    break;
                default: //display
                    Display();
                    break;
            }

            GenerateJS();
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(System.Object sender, System.EventArgs e)
    {
        m_refStyle = new StyleHelper();
        divPropertyText.Text = "Standard";
        divMetadataText.Text = "Advanced";
        checkAccess();
        g_isIEFlagInitialized = false;
        lngCompareCategoryID = 0;
        lngCompareTaskTypeID = 0;
        completedColor = "#ccffff";
        CommentKeyId = -1;
        RefType = "T";
        RefId = Convert.ToInt64(Request.QueryString["tid"]);
        CommentId = 0;
        iMaxContLength = "64000";
        localeFileString = "0000";
        if (!string.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            OrderBy = Request.QueryString["orderby"].ToString();
        }
        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }
        AppUI.ContentLanguage = ContentLanguage;
        currentUserID = AppUI.UserId;
        AppPath = AppUI.AppPath;
        AppImgPath = AppUI.AppImgPath;
        sitePath = AppUI.SitePath;
        AppeWebPath = AppUI.ApplicationPath + AppUI.AppeWebPath;
        AppName = AppUI.AppName;
        EnableMultilingual = AppUI.EnableMultilingual;
        gtSiteObj = AppUI.EkSiteRef;
        if (AppUI.EnableMultilingual == 1)
            colActiveLanguages = gtSiteObj.GetAllActiveLanguages();
        else
        {
            colActiveLanguages = gtSiteObj.GetLanguageByID(AppUI.DefaultContentLanguage);
            if (colActiveLanguages.Count > 0)
            {
                languageName = colActiveLanguages["Name"].ToString();
            }
        }
        strIs_Child = Strings.LCase(Strings.Trim(Convert.ToString(Server.HtmlEncode(Request.QueryString["is_child"]))));
        lngCategory_tmp = Convert.ToInt64(Request.QueryString["saved_task_category"]);
        lngType_tmp = Convert.ToInt64(Request.QueryString["saved_task_type"]);

        if (!string.IsNullOrEmpty(strIs_Child))
            is_child = Convert.ToBoolean("true" == strIs_Child);
        else
            is_child = false;

        if (Request.ServerVariables["HTTP_USER_AGENT"].IndexOf("Windows") + 1 > 0)
        {
            IsMac = 0;
        }
        else
        {
            IsMac = 1;
        }
        cContObj = AppUI.EkContentRef;
        canI = cContObj.CanIv2_0(-1, "tasks");
        //var1 = Request.ServerVariables["SERVER_NAME"].ToString();
        //string ty = null;
        //ty = "tasks";
        //var2 = cContObj.GetEditorVariablev2_0(0, ty);
        if (m_refContentApi.GetCookieValue("user_id") != "0")
        {
            m_EmailHelper.MakeEmailArea();
            MakeTaskTypeArea();
        }
        if (!string.IsNullOrEmpty(Request.QueryString["close"]))
        {
            closeOnFinish = "&close=true";
        }
        m_ekSite = AppUI.EkSiteRef;
        cDbRecs = m_ekSite.GetPermissions(0, 0, "folder");
        IsAdmin = Convert.ToBoolean(cDbRecs["IsAdmin"]);

        action = Server.HtmlEncode(Request.QueryString["action"]);
        actiontype = Server.HtmlEncode(Request.QueryString["ty"]);
        if ((string.IsNullOrEmpty(actiontype)))
        {
            actiontype = "both";
        }

        if (IsPostBack)
        {
            switch (Action)
            {
                case "AddTask":
                    Process_AddTask();
                    break;
                case "EditTask":
                    Process_EditTask();
                    break;
                case "DeleteAllTasks":
                    Process_DeleteAllTasks();
                    break;
                case "UpdateStatePurge":
                    Process_UpdateStatePurge();
                    break;
            }
        }
        else
        {
            switch (Action)
            {
                case "ApproveTask":
                    Process_ApproveTask();
                    break;
                case "EditTask":
                    Display_EditTask();
                    break;
                case "AddTask":
                    Display_AddTask();
                    break;
                case "ViewTasks":
                    Display_ViewTasks();
                    break;
                case "ViewTask":
                    Display_ViewTask();
                    break;
                case "viewcontenttask":
                    Display_ViewContentTask();
                    break;
                case "ViewTaskType":
                    Display_ViewTaskType();
                    break;
                case "DeleteAllTasks":
                    Display_DeleteAllTasks();
                    break;
                case "DeleteTask":
                    Process_DeleteTask();
                    break;
                case "EditTaskType":
                    Display_EditTaskType();
                    break;
                case "AddTaskType":
                    Display_AddTaskType();
                    break;
                case "DeleteTaskType":
                    Process_DeleteTaskType();
                    break;
                default:
                    Session["RedirectLnk"] = "tasks.aspx?" + Server.HtmlEncode(Request.QueryString.ToString());
                    Response.Redirect("login.aspx?fromLnkPg=1");
                    break;
            }

        }

        RegisterResources();
    }
Exemplo n.º 15
0
    public bool ViewContent()
    {
        if (!(Request.QueryString["id"] == null))
        {
            m_intId = Convert.ToInt64(Request.QueryString["id"]);
            if (m_intId == 0)
            {
                if (!(Request.QueryString["contentid"] == null))
                {
                    m_intId = Convert.ToInt64(Request.QueryString["contentid"]);
                }
            }
        }

        if (!(Request.QueryString["action"] == null))
        {
            m_strPageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim();
        }
        if (!(Request.QueryString["orderby"] == null))
        {
            m_strOrderBy = Convert.ToString(Request.QueryString["orderby"]);
        }
        if (!(Request.QueryString["LangType"] == null))
        {
            if (Request.QueryString["LangType"] != "")
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
            {
                ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
            }
        }
        if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
        {
            m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
        }
        else
        {
            m_refContentApi.ContentLanguage = ContentLanguage;
        }
        if (!(Request.QueryString["cancelaction"] == null))
        {
            if (Convert.ToString(Request.QueryString["cancelaction"]).ToLower() == "undocheckout")
            {
                bool retval = false;
                m_refContent = m_refContentApi.EkContentRef;
                retval = m_refContent.UndoCheckOutv2_0(m_intId);
            }
        }
        language_data = (new SiteAPI()).GetLanguageById(ContentLanguage);
        LanguageName = language_data.Name;
        m_refContent = m_refContentApi.EkContentRef;
        TaskExists = m_refContent.DoesTaskExistForContent(m_intId);

        CurrentUserId = m_refContentApi.UserId;
        AppImgPath = m_refContentApi.AppImgPath;
        SitePath = m_refContentApi.SitePath;
        EnableMultilingual = m_refContentApi.EnableMultilingual;
        if (!(Request.QueryString["callerpage"] == null))
        {
            CallerPage = AntiXss.UrlEncode(Request.QueryString["callerpage"]);
        }

        if (CallerPage == "")
        {
            if (!(Request.QueryString["calledfrom"] == null))
            {
                CallerPage = AntiXss.UrlEncode(Request.QueryString["calledfrom"]);
            }
        }
        if (!(Request.QueryString["folder_id"] == null))
        {
            if (Request.QueryString["folder_id"] != "")
            {
                m_intFolderId = Convert.ToInt64(Request.QueryString["folder_id"]);
            }
        }
        if (m_intFolderId == -1)
        {
            //let try again to get folder id
            if (!(Request.QueryString["fldid"] == null))
            {
                if (Request.QueryString["fldid"] != "")
                {
                    m_intFolderId = Convert.ToInt64(Request.QueryString["fldid"]);
                }
            }
        }
        Display_ViewContent();
        return true;
    }
Exemplo n.º 16
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        _MessageHelper = _ContentApi.EkMsgRef;
            if (!(Request.QueryString["id"] == null))
            {
                _Id = Convert.ToInt64(Request.QueryString["id"]);
            }
            if (!(Request.QueryString["action"] == null))
            {
                _PageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim();
            }
            if (!(Request.QueryString["orderby"] == null))
            {
                _OrderBy = Convert.ToString(Request.QueryString["orderby"]);
            }
            if ((!(Request.QueryString["showarchive"] == null)) && (Request.QueryString["showarchive"].ToString().ToLower() == "true"))
            {
                _ShowArchive = true;
            }
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    _ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    _ContentApi.SetCookieValue("LastValidLanguageID", _ContentLanguage.ToString());
                }
                else
                {
                    if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        _ContentLanguage = Convert.ToInt32(_ContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    _ContentLanguage = Convert.ToInt32(_ContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            if (Request.QueryString["currentpage"] != null)
            {
                _CurrentPageId = Convert.ToInt32(Request.QueryString["currentpage"]);
            }

            if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                _ContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                _ContentApi.ContentLanguage = _ContentLanguage;
            }
            _CurrentUserId = _ContentApi.UserId;
            _AppImgPath = _ContentApi.AppImgPath;
            _SitePath = _ContentApi.SitePath;
            _EkContent = _ContentApi.EkContentRef;
            _EnableMultilingual = _ContentApi.EnableMultilingual;
            contentids.Value = "";
            DeleteContentByCategory();
            isPostData.Value = "true";

            RegisterJS();
    }
Exemplo n.º 17
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        MsgHelper = AppUI.EkMsgRef;
        m_refLib = AppUI.EkLibraryRef;
        CurrentUserId = AppUI.UserId;
        AppImgPath = (string)AppUI.AppImgPath;
        sitePath = AppUI.SitePath;
        AppName = AppUI.AppName;
        AppeWebPath = AppUI.AppeWebPath;
        AppPath = (string)AppUI.AppPath;
        EnableMultilingual = AppUI.EnableMultilingual;
        catid = Convert.ToInt64(Request.QueryString["catid"]);
        if (AppUI.ContentLanguage == -1)
        {
            AppUI.ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("DefaultLanguage"));
        }

        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", Convert.ToString(ContentLanguage));
        }
        else
        {
            if (AppUI.GetCookieValue("LastValidLanguageID").ToString() != "")
            {
                ContentLanguage = System.Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }
        AppUI.ContentLanguage = ContentLanguage;

        RI = AppUI.RequestInformationRef;
        RI.CallerId = Convert.ToInt64(Request.QueryString["uid"]);
        RI.CookieSite = Request.QueryString["siteid"];
        RI.UserId = Convert.ToInt64(Request.QueryString["uid"]);
        m_refContent = new EkContent(RI);
        m_refLib = new Ektron.Cms.Library.EkLibrary(RI);
        m_refModule = new Ektron.Cms.Modules.EkModule(RI);

        action = Strings.Trim(Request.QueryString["action"]);

        if (action == "logintest")
        {
            username = Request.QueryString["u"];
            password = Request.QueryString["p"];
            domain = Request.QueryString["d"];
            Login(username, password, domain);
        }
        else if (action == "categories")
        {
            string[] TestArray = new string[] { };
            object loopnumber;
            loopnumber = 0;
            foldertype = Request.QueryString["foldertype"];
            cFolders = m_refContent.GetFolderInfov2_0(0);
            OutputContentFolders("", 0, ref TestArray);
            if (ErrString != "")
            {
                Response.Write("<count>" + ((TestArray.Length - 1) - 0 + "</count>"));
            }
            else
            {
                if (foldertype == "all")
                {
                    Response.Write("<count>" + ((TestArray.Length - 1) - 0 + 1) + "</count>");
                    Response.Write("<catid>0</catid><catname>\\</catname>");
                }
                else
                {
                    Response.Write("<count>" + ((TestArray.Length - 1) - 0 - 1) + "</count>");
                }

            }
            for (int g = 0; g <= (TestArray.Length - 1) - 1; g++)
            {
                Response.Write(TestArray[g]);
            }

        }
        else if (action == "content")
        {
            Collection cTmp = new Collection();
            int intTotalPages = 0;
            object[] ContentArray;
            ContentArray = new object[1];
            loopcount = 0;
            cTmp.Add(catid, "FolderID", null, null);
            cTmp.Add("Title", "OrderBy", null, null);
            EkContentCol datacCol = m_refContent.GetAllViewableChildContentInfoV5_0(cTmp, 1, 0, ref intTotalPages);
            foreach (ContentBase item in datacCol)
            {
                Array.Resize(ref ContentArray, loopcount + 1 + 1);
                ContentArray[loopcount] = "<id>" + item.Id + "</id>" + "<title>" + item.Title + "</title>";
                loopcount++;
            }
            Response.Write("<count>" + ((ContentArray.Length - 1) - 0 + "</count>"));
            for (int h = 0; h <= (ContentArray.Length - 1) - 1; h++)
            {
                Response.Write(ContentArray[h]);
            }
        }
        else if (action == "collections")
        {
            string orderby = "title";
            NavArray = new object[1];
            loopcount = 0;
            gtNavs = m_refContent.GetAllCollectionsInfo(catid, orderby);
            foreach (Collection tempLoopVar_gtNav in (IEnumerable)gtNavs)
            {
                gtNav = tempLoopVar_gtNav;
                Array.Resize(ref NavArray, loopcount + 1 + 1);
                NavArray[loopcount] = "<id>" + gtNav["CollectionID"] + "</id>" + "<title>" + gtNav["CollectionTitle"] + "</title>";
                loopcount++;
            }
            Response.Write("<count>" + ((NavArray.Length - 1) - 0 + "</count>"));
            for (int h = 0; h <= (NavArray.Length - 1) - 1; h++)
            {
                Response.Write(NavArray[h]);
            }
            gtNavs = null;
        }
        else if (action == "collections_all")
        {
            NavArray = new object[1];
            loopcount = 0;
            uid = Convert.ToInt64(Request.QueryString["uid"]);
            siteid = Request.QueryString["siteid"];
            gtNavs = m_refContent.GetCollectionsReport(ref ErrorString);
            foreach (Collection tempLoopVar_gtNav in (IEnumerable)gtNavs)
            {
                gtNav = tempLoopVar_gtNav;
                Array.Resize(ref NavArray, loopcount + 1 + 1);
                NavArray[loopcount] = "<id>" + gtNav["CollectionID"] + "</id>" + "<title>id=" + gtNav["CollectionID"] + ", " + gtNav["CollectionTitle"] + "</title>";
                loopcount++;
            }
            Response.Write("<count>" + ((NavArray.Length - 1) - 0 + "</count>"));
            for (int h = 0; h <= (NavArray.Length - 1) - 1; h++)
            {
                Response.Write(NavArray[h]);
            }
            gtNavs = null;
        }
        else if (action == "calendar")
        {
            NavArray = new object[1];
            loopcount = 0;
            gtNavs = m_refModule.GetAllCalendarInfo();
            foreach (Collection tempLoopVar_gtNav in (IEnumerable)gtNavs)
            {
                gtNav = tempLoopVar_gtNav;
                Array.Resize(ref NavArray, loopcount + 1 + 1);
                NavArray[loopcount] = "<id>" + gtNav["CalendarID"] + "</id>" + "<title>id=" + gtNav["CalendarID"] + ", " + gtNav["CalendarTitle"] + "</title>";
                loopcount++;
            }
            Response.Write("<count>" + ((NavArray.Length - 1) - 0 + "</count>"));
            for (int h = 0; h <= (NavArray.Length - 1) - 1; h++)
            {
                Response.Write(NavArray[h]);
            }
            gtNavs = null;
        }
        else if (action == "ecmforms")
        {
            object gtForms;

            NavArray = new object[1];
            loopcount = 0;
            gtForms = m_refModule.GetAllFormInfo();

            foreach (Collection gtForm in (IEnumerable)gtForms)
            {
                Array.Resize(ref NavArray, loopcount + 1 + 1);
                NavArray[loopcount] = "<id>" + gtForm["FormID"] + "</id>" + "<title>id=" + gtForm["FormID"] + ", " + gtForm["FormTitle"] + "</title>";
                loopcount++;
            }
            Response.Write("<count>" + ((NavArray.Length - 1) - 0 + "</count>"));
            for (int h = 0; h <= (NavArray.Length - 1) - 1; h++)
            {
                Response.Write(NavArray[h]);
            }
            gtNavs = null;
        }
        else if (action == "editcontent")
        {
            Collection cEContent;
            object myxmlstring;
            object PageInfo;
            object myhtmlcontent;
            object stylesheetpath = null;
            object mywhynoteditstring;
            Collection canI;

            PageInfo = "src=\"http://" + Request.ServerVariables["Server_name"] + "/";
            cid = Convert.ToInt64(Request.QueryString["cid"]);

            canI = m_refContent.CanIv2_0(cid, "content");
            if (Convert.ToBoolean(canI["CanIEdit"]))
            {
                cEContent = m_refContent.GetContentForEditingv2_0(cid);
                myhtmlcontent = cEContent["ContentHtml"];
                if (Strings.Trim((string)(cEContent["StyleSheet"])) != "")
                {
                    stylesheetpath = "http://" + Convert.ToString(Request.ServerVariables["Server_name"]) + sitePath + cEContent["StyleSheet"];
                }
                myxmlstring = "<ektron_head_html><!--   Do not remove these xml tags <ektron_head><ektron_edit>yes</ektron_edit><ektron_content_id>" + cid + "</ektron_content_id> <ektron_title>" + cEContent["ContentTitle"] + "</ektron_title> <ektron_content_comment>" + cEContent["Comment"] + "</ektron_content_comment> <ektron_content_stylesheet>" + stylesheetpath + "</ektron_content_stylesheet> <ektron_folder_id>" + cEContent["FolderID"] + "</ektron_folder_id> <ektron_content_language>" + cEContent["ContentLanguage"] + "</ektron_content_language> <ektron_go_live>" + cEContent["GoLive"] + "</ektron_go_live> <ektron_end_date>" + cEContent["EndDate"] + "</ektron_end_date> <ektron_MetadataNumber>" + ((Collection)cEContent["ContentMetadata"]).Count + "</ektron_MetadataNumber> <ektron_PreviousState>" + cEContent["CurrentContentStatus"] + "</ektron_PreviousState> <ektron_iMaxContLength>" + cEContent["MaxContentSize"] + "</ektron_iMaxContLength> <ektron_content_Path>" + cEContent["Path"] + "</ektron_content_Path></ektron_head> --> </ektron_head_html> ";
                myxmlstring = myxmlstring + "<ektron_body_html>" + myhtmlcontent + "</ektron_body_html>";
            }
            else
            {
                if (Convert.ToString(canI["ContentState"]) == "CheckedOut")
                {
                    mywhynoteditstring = "You can not edit this cotent, content is checked out to: " + canI["UserName"];
                }
                else
                {
                    mywhynoteditstring = "You can not edit this this content.  The content state is:  " + canI["ContentState"] + "; The user is " + canI["UserName"];
                }
                myxmlstring = "<ektron_head_html><!--   <ektron_edit>" + mywhynoteditstring + "</ektron_edit> --></ektron_head_html>";
            }
            Response.Write(myxmlstring);
            canI = null;

        }
        else if (action == "publish_update_content")
        {
            ErrorString = "";
            myerrormsg = "";
            cid = Convert.ToInt64(Request.QueryString["cid"]);

            Collection cCont = m_refContent.GetContentByIDv2_0(cid);

            cCont.Remove("ContentHtml");
            cCont.Add(Strings.Replace(Request.Form["ContentHTML"], "<myektronand/>", "&", 1, -1, 0), "ContentHtml", null, null);
            cCont.Remove("ContentTitle");
            cCont.Add(Request.Form["content_title"], "ContentTitle", null, null);
            cCont.Remove("Comment");
            cCont.Add(Request.Form["content_comment"], "Comment", null, null);
            cCont.Remove("ContentID");
            cCont.Add(Request.Form["ektron_content_id"], "ContentID", null, null);
            cCont.Remove("FolderID");
            cCont.Add(Request.Form["folder"], "FolderID", null, null);
            cCont.Remove("ContentLanguage");
            cCont.Add(Request.Form["ektron_content_language"], "ContentLanguage", null, null);
            //cCont.Remove("SearchText")
            cCont.Add(Strings.Replace(Request.Form["searchhtml"], "<myektronand/>", "&", 1, -1, 0), "SearchText", null, null);
            cCont.Remove("GoLive");
            cCont.Add(Request.Form["go_live"], "GoLive", null, null);
            cCont.Remove("EndDate");
            cCont.Add(Request.Form["end_date"], "EndDate", null, null);
            cCont.Remove("ContentType");
            cCont.Add(1, "ContentType", null, null);
            cCont.Remove("LockedContentLink");
            cCont.Add(true, "LockedContentLink", null, null);

            try
            {
                ret = m_refContent.SaveContentv2_0(cCont);
                if (ErrorString != "")
                {
                    myerrormsg = ErrorString;
                }
                else
                {
                    ContentID = Convert.ToInt64(Request.Form["ektron_content_id"]);
                    ret = m_refContent.CheckIn(ContentID, "");
                    if (ErrorString != "")
                    {
                        myerrormsg = ErrorString;
                    }
                    else
                    {
                        if (ret == false)
                        {
                            ret = m_refContent.SubmitForPublicationv2_0(ContentID, Convert.ToInt64(Request.Form["ektron_folder_id"]), 0, "");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                myerrormsg = ex.Message.ToString();
            }

            if (myerrormsg != "")
            {
                Response.Write(myerrormsg);
            }
            else
            {
                Response.Write("Content has been saved");
            }

        }
        else if (action == "add_new_content")
        {
            cCont = new Collection();
            try
            {
                cCont.Add((object)Strings.Replace(Convert.ToString(Request.Form["ContentHTML"]), "<myektronand/>", "&", 1, -1, 0), "ContentHtml", null, null);
                cCont.Add(Request.Form["content_title"], "ContentTitle", null, null);
                cCont.Add(Request.Form["content_comment"], "Comment", null, null);
                cCont.Add(System.Convert.ToInt32(Request.Form["folder"]), "FolderID", null, null);
                cCont.Add(Request.Form["ektron_content_language"], "ContentLanguage", null, null);
                cCont.Add(Strings.Replace(Request.Form["searchhtml"], "<myektronand/>", "&", 1, -1, 0), "SearchText", null, null);
                cCont.Add(Request.Form["go_live"], "GoLive", null, null);
                cCont.Add(Request.Form["end_date"], "EndDate", null, null);
                cCont.Add(true, "AddToQlink", null, null);
                cCont.Add(1, "ContentType", null, null);

                ErrorString = "";
                ContentID = m_refContent.AddNewContentv2_0(cCont);
            }
            catch (Exception ex)
            {
                ErrorString = ex.Message.ToString();
            }
            if (ErrorString != "")
            {
                myerrormsg = ErrorString;
            }
            else
            {
                ret = m_refContent.CheckIn(ContentID, "");
                if (ErrorString != "")
                {
                    myerrormsg = " Error CheckIn= " + ErrorString;
                }
                else
                {
                    if (ret == false)
                    {
                        ret = m_refContent.SubmitForPublicationv2_0(ContentID, Convert.ToInt64(Request.Form["ektron_folder_id"]), 0, "");
                        if (ErrorString != "")
                        {
                            myerrormsg = "Error SubmitForPublicationv2_0= " + ErrorString;
                        }
                    }
                }
            }
            if (myerrormsg != "")
            {
                Response.Write(myerrormsg);
            }
            else
            {
                Response.Write("Content has been saved");
            }

        }
        else if (action == "foldertypexml")
        {
            long folderid;
            folderid = Convert.ToInt64(Request.Form["folderid"]);
            myFolders = m_refContent.GetFolderInfov2_0(folderid, false, false);
            if (((Collection)myFolders["XmlConfiguration"]).Count == 0)
            {
                Response.Write("<XmlConfiguration>no</XmlConfiguration>");
            }
            else
            {
                Response.Write("<XmlConfiguration>yes</XmlConfiguration>");
            }
            myFolders = null;
        }
        else if (action == "canIsave")
        {
            cid = Convert.ToInt64(Request.Form["cid"]);

            cConts = m_refContent.GetContentByIDv2_0(cid);
            UserRights = m_refContent.CanIv2_0(cid, "content");
            if (Convert.ToString(cConts["ContentStatus"]) == "O" && Convert.ToBoolean(UserRights["CanIEdit"]))
            {
                Response.Write("<canISave>yes</canISave>");
            }
            else
            {
                if (Convert.ToString(cConts["ContentStatus"]) == "O")
                {
                    Response.Write("<canISave>Did not save!!!!,  Check out by " + Convert.ToString(UserRights["UserName"]) + "</canISave>");
                }
                else
                {
                    Response.Write("<canISave>Did not save!!!  Content is not checked out to you, Its status is Status=" + Convert.ToString(cConts["ContentStatus"]) + " The user associated with this is " + Convert.ToString(UserRights["UserName"]) + "</canISave>");
                }
            }

        }
        else if (action == "AddFolder")
        {
            object bRet1;
            object tmpPath;
            Collection libSettings;
            cFolder = new Collection();
            cFolder.Add(Request.Form["foldername"], "FolderName", null, null);
            cFolder.Add(Request.Form["folderdescription"], "FolderDescription", null, null);
            cFolder.Add(Request.Form["ParentID"], "ParentID", null, null);
            cFolder.Add(Request.Form["templatefilename"], "TemplateFileName", null, null);
            cFolder.Add(Request.Form["stylesheet"], "StyleSheet", null, null);
            libSettings = m_refLib.GetLibrarySettingsv2_0();

            tmpPath = libSettings["ImageDirectory"];
            cFolder.Add(getPhysicalPath(tmpPath), "AbsImageDirectory", null, null);
            tmpPath = libSettings["FileDirectory"];
            cFolder.Add(getPhysicalPath(tmpPath), "AbsFileDirectory", null, null);
            libSettings = null;
            bRet1 = addLBpaths(cFolder, uid, siteid);
            cFolder.Add(true, "XmlInherited", null, null);
            cFolder.Add(0, "XmlConfiguration", null, null);
            cFolder.Add(1, "InheritMetadata", null, null); //break inherit button is check.
            cFolder.Add(0, "InheritMetadataFrom", null, null);
            ret = m_refContent.AddContentFolderv2_0(ref cFolder);
            Response.Write("Folder added");
        }
        else if (action == "metadata")
        {
            int loopcounter = 0;
            object cMetadataTypes;
            object[] MetaDataArray;
            MetaDataArray = new object[1];
            cMetadataTypes = m_refContent.GetMetadataTypes("Name");
            foreach (Collection cMetadataType in (IEnumerable)cMetadataTypes)
            {
                Array.Resize(ref MetaDataArray, loopcounter + 1 + 1);
                MetaDataArray[loopcounter] = "<meta>" + (cMetadataType["MetaTypeName"]) + "</meta>";
                loopcounter++;
            }
            Response.Write("<count>" + ((MetaDataArray.Length - 1) - 0 + "</count>"));
            for (int j = 0; j <= (MetaDataArray.Length - 1) - 1; j++)
            {
                Response.Write(MetaDataArray[j]);
            }
        }
        else if (action == "ecmmenus")
        {
            object FolderID;
            FolderID = 0;
            Response.Write(GetMenuList(FolderID.ToString(), "Title"));
        }
        else if (action == "ecmxmconfig")
        {
            Response.Write(GetXmlConfigurationList(""));
        }
        else if (action == "ecmlanguages")
        {
            Response.Write(GetLanguages());
        }
        else
        {
            Response.Write("DreamWeaver - No Action parameter");
        }
    }
    private Approval CheckRequiresApproval(List <FolderData> folders)
    {
        if (folders.Any())
        {
            List <Approval> storedApprovals = new List <Approval>();

            // Couldn't find way to work around legacy APIs. If Approval calculation is desired, this must be run within the site.
            var       cwUtilities = new ContentWorkflowUtilities(CommonApi.Current.RequestInformationRef);
            EkContent _content    = new EkContent(CommonApi.Current.RequestInformationRef);

            int        chainSize = 0;
            long       wfid      = 0;
            Collection items     = null;

            foreach (FolderData f in folders)
            {
                chainSize = 0;
                wfid      = 0;

                items     = _content.GetApprovalInfov2_0(f.Id, "folder");
                chainSize = int.Parse(items[1].ToString());

                wfid = cwUtilities.GetInheritedWorkflowDefinitionId(0, f.Id, CommonApi.Current.RequestInformationRef.ContentLanguage);

                if (chainSize > 0 || wfid > 0)
                {
                    if (!storedApprovals.Contains(Approval.Yes))
                    {
                        storedApprovals.Add(Approval.Yes);
                    }
                }
                else
                {
                    if (!storedApprovals.Contains(Approval.No))
                    {
                        storedApprovals.Add(Approval.No);
                    }
                }

                if (storedApprovals.Contains(Approval.Yes) &&
                    storedApprovals.Contains(Approval.No))
                {
                    break;
                }
            }

            if (storedApprovals.Contains(Approval.Yes) &&
                storedApprovals.Contains(Approval.No))
            {
                return(Approval.Sometimes);
            }
            else if (storedApprovals.Contains(Approval.Yes))
            {
                return(Approval.Yes);
            }
            else
            {
                return(Approval.No);
            }
        }
        return(Approval.No);
    }
Exemplo n.º 19
0
    private void InitEnvironment()
    {
        m_strCmdAction = EkFunctions.HtmlEncode(Request.QueryString["Action"]);
            m_strActionType = EkFunctions.HtmlEncode(Request.QueryString["ty"]);
            m_iCommentKeyId = System.Convert.ToInt64(Request["commentkey_id"]);
            m_iCommentId = System.Convert.ToInt64(Request["Comment_Id"]);
            m_strCommentType = EkFunctions.HtmlEncode(Request["comment_type"]);
            m_strOrderBy = EkFunctions.HtmlEncode(Request["orderby"]);
            m_iRefId = System.Convert.ToInt64(Request["ref_id"]);
            m_strRefType = EkFunctions.HtmlEncode(Request["ref_type"]);
            m_strEditorName = EkFunctions.HtmlEncode(Request["editorName"]);
            m_strAppeWebPath = "";
            m_strLocaleFileString = "0000";
            m_objAppUI = new ApplicationAPI();
            m_objContentObj1 = m_objAppUI.EkContentRef;

            m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath;

            if (Request["LangType"] != "")
            {
                m_iContentLanguage = Convert.ToInt32(Request["LangType"]);
                m_objAppUI.SetCookieValue("LastValidLanguageID", m_iContentLanguage.ToString());
            }
            else
            {
                if (m_objAppUI.GetCookieValue("LastValidLanguageID") != "")
                {
                    m_iContentLanguage = int.Parse(m_objAppUI.GetCookieValue("LastValidLanguageID"));
                }
            }

            m_objAppUI.ContentLanguage = m_iContentLanguage;
            m_objContentObj1 = m_objAppUI.EkContentRef;
            m_iCurrentUserId = m_objAppUI.UserId;
            m_strAppeWebPath = m_objAppUI.ApplicationPath + m_objAppUI.AppeWebPath;
            m_strServerName = Request.ServerVariables["SERVER_NAME"];
            this.Page.Title = m_objAppUI.AppName + " Comments";

            m_strvar2 = m_objContentObj1.GetEditorVariablev2_0(0, "tasks");

            if ((Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("MOZILLA") > -1 && (Strings.UCase(Request.ServerVariables["http_user_agent"])).IndexOf("4.7") > -1 && (!(Strings.UCase(Request.ServerVariables["http_user_agent"]).IndexOf("GECKO") > -1)))
            {
              m_bNS4 = true;
            }
            else
            {
                m_bNS4 = false;
            }
    }
Exemplo n.º 20
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        //Put user code to initialize the page here
        RegisterResources();
        m_refContentApi = new ContentAPI();
        m_refMsg = m_refContentApi.EkMsgRef;
        AppImgPath = m_refContentApi.AppImgPath;
        ContentLanguage = m_refContentApi.ContentLanguage;
        m_refContent = m_refContentApi.EkContentRef;
        SetServerJSVariables();
        if (m_refContent.IsAllowed(0, 0, "users", "IsAdmin", 0) == true || m_refContent.IsARoleMember(11, m_refContent.RequestInformation.UserId, false) == true)
        {
            bIsAdmin = true;
        }

        if (Request.Browser.Platform.IndexOf("Win") == -1)
        {
            m_bIsMac = true;
        }
        else
        {
            m_bIsMac = false;
        }

        EnableMultilingual = m_refContentApi.EnableMultilingual;
        if (!(Request.QueryString["action"] == null))
        {
            m_strPageAction = Request.QueryString["action"];
            if (m_strPageAction.Length > 0)
            {
                m_strPageAction = m_strPageAction.ToLower();
            }
        }
        if (Request.QueryString["orderby"] != "")
        {
            m_strOrderBy = Request.QueryString["orderby"];
        }
    }
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        try
        {
            RegisterResources();
            if (!Utilities.ValidateUserLogin())
            {
                return;
            }
            if (!(m_refCommonApi.IsAdmin() || m_refContentApi.EkContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator, m_refCommonApi.RequestInformationRef.UserId, false) || m_refContentApi.EkContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, m_refCommonApi.RequestInformationRef.UserId, false)))
            {
                Utilities.ShowError(m_refCommonApi.EkMsgRef.GetMessage("User not authorized"));
                return;
            }

            ExtraQuery = "";
            if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            ExtraQuery = (string)("&LangType=" + ContentLanguage);
            string urlReferer = Request.UrlReferrer.ToString();

            if (urlReferer.IndexOf("taxonomy") != -1)
            {
                ltraliasOrTax.Text = "taxonomy";
            }
            else if (urlReferer.IndexOf("alias") != -1)
            {
                ltraliasOrTax.Text = "alias";
            }
            else
            {
                ltraliasOrTax.Text = aliasOrTax.Value;
            }

            if (!(Request.QueryString["WantXmlInfo"] == null))
            {
                ExtraQuery += "&WantXmlInfo=1";
                m_nWantXmlInfo = 1;
            }
            else
            {
                m_nWantXmlInfo = 0;
            }

            mode = Request.QueryString["mode"];

            m_refMsg = m_refContentApi.EkMsgRef;
            PageLabel.Text = PageLabel.ToolTip = m_refMsg.GetMessage("lbl pagecontrol page");
            OfLabel.Text = OfLabel.ToolTip = m_refMsg.GetMessage("lbl pagecontrol of");

            FirstPage.ToolTip = m_refMsg.GetMessage("lbl first page");
            PreviousPage1.ToolTip = m_refMsg.GetMessage("lbl previous page");
            NextPage.ToolTip = m_refMsg.GetMessage("lbl next page");
            LastPage.ToolTip = m_refMsg.GetMessage("lbl last page");

            FirstPage.Text = "[" + m_refMsg.GetMessage("lbl first page") + "]";
            PreviousPage1.Text = "[" + m_refMsg.GetMessage("lbl previous page") + "]";
            NextPage.Text = "[" + m_refMsg.GetMessage("lbl next page") + "]";
            LastPage.Text = "[" + m_refMsg.GetMessage("lbl last page") + "]";

            //Put user code to initialize the page here
            AppImgPath = m_refContentApi.AppImgPath;
            AppPath = m_refContentApi.AppPath;
            AppName = m_refContentApi.AppName;
            if ((!String.IsNullOrEmpty(Request.QueryString["FolderID"])) && Information.IsNumeric(Request.QueryString["FolderID"]))
            {
                FolderId = Convert.ToInt64(Request.QueryString["FolderID"]);
            }
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            if (!(Request.QueryString["listfolderfor"] == null))
            {
                ListFoldersFor = (string)(Request.QueryString["listfolderfor"].ToString().ToLower());
                ExtraQuery += (string)("&listfolderfor=" + ListFoldersFor);
            }
            m_refContent = m_refContentApi.EkContentRef;

            if ((!String.IsNullOrEmpty(Request.QueryString["noblogfolders"])) && Information.IsNumeric(Request.QueryString["noblogfolders"]))
            {
                m_bBlockBlogFolders = Convert.ToInt32(Request.QueryString["noblogfolders"]) > 0 ? true : false;
            }

            if (!(Request.QueryString["action"] == null))
            {
                strPageAction = Request.QueryString["action"];
            }

            if (!(Request.QueryString["from_page"] == null))
            {
                strRedirectFromReport = Request.QueryString["from_page"];
            }

            if (!(Request.QueryString["subfolderchk"] == null))
            {
                m_bSubFolder = System.Convert.ToBoolean("true" == Request.QueryString["subfolderchk"].ToLower());
            }
            if (Request.QueryString["aliasOrTax"] == null || Request.QueryString["aliasOrTax"] == "")
            {
                if (strPageAction == "movecopy")
                {
                    GenerateMoveCopyTaxonomyToolBar();
                }
                else if (mode == "Taxonomy")
                {
                    GenerateToolBar();

                }
                else
                {
                    GenerateToolBar();
                }
            }
            else if (Request.QueryString["aliasOrTax"] == "taxonomy")
            {
                GenerateMoveCopyTaxonomyToolBar();
            }
            else if (Request.QueryString["aliasOrTax"] == "alias")
            {
                GenerateToolBar();
            }

            if (!(Request.QueryString["pager"] == null))
            {
                Navigation_Change(Request.QueryString["pager"]);
            }
            else
            {
                DisplayPage();
            }
            SetServerJSVariables();

            isPostData.Value = "true";
            switch (strPageAction)
            {
                case "copy":
                    MoveCopyTaxonomy(false);
                    break;
                case "move":
                    MoveCopyTaxonomy(true);
                    break;
            }

        }
        catch (Exception ex)
        {

            Utilities.ShowError(ex.Message);
        }
    }
Exemplo n.º 22
0
 private void EditContent()
 {
     long lId;
         bool ret;
         string strPage = "";
         lId = long.Parse(Request.QueryString["id"]);
         try
         {
             strPage = Request.QueryString["page"];
             _EkContent = _CommonApi.EkContentRef;
             ret = System.Convert.ToBoolean(_EkContent.TakeOwnership(lId));
             Response.Redirect((string) ("edit.aspx?LangType=" + _CommonApi.ContentLanguage + "&id=" + lId + "&type=update&back_page=" + strPage), false);
         }
         catch (Exception ex)
         {
             Utilities.ShowError(ex.Message);
         }
 }
Exemplo n.º 23
0
    private void Display_ViewForm()
    {
        bool CanIAddLang = true;
            bool TaskExists = false;
            PermissionData security_task_data;
            m_refContent = m_refContentApi.EkContentRef;
            //Check  to see if it's passing it by content-id
            if (Request.QueryString["form_content_id"] != null && Request.QueryString["form_content_id"] != "")
            {
                m_intFormId = Convert.ToInt64(Request.QueryString["form_content_id"]);
                form_data = m_refContentApi.GetFormById(m_intFormId);
            }
            else
            {
                form_data = m_refContentApi.GetFormById(m_intFormId);
            }
            if (form_data == null)
            {
                throw (new Exception("Unable to view form. ID=" + m_intFormId));
            }

            if (Request.QueryString["staged"] != null && Request.QueryString["staged"] != "")
            {
                content_data = m_refContentApi.GetContentById(form_data.Id, ContentAPI.ContentResultType.Staged);
            }
            else
            {
                content_data = m_refContentApi.GetContentById(form_data.Id, 0);
            }
            TaskExists = m_refContent.DoesTaskExistForContent(form_data.Id);
            security_task_data = m_refContentApi.LoadPermissions(form_data.Id, "tasks", ContentAPI.PermissionResultType.Task);
            security_data = m_refContentApi.LoadPermissions(form_data.Id, "content", ContentAPI.PermissionResultType.All);
            security_data.CanAddTask = security_task_data.CanAddTask;
            security_data.CanDestructTask = security_task_data.CanDestructTask;
            security_data.CanRedirectTask = security_task_data.CanRedirectTask;
            security_data.CanDeleteTask = security_task_data.CanDeleteTask;
            CanIAddLang = security_data.CanAdd;
            // Replace [srcpath] with actual path. [srcpath] is used in calendar field.
            if (content_data.Html != null&& content_data.Html.Length > 0)
            {
                td_vf_content.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath);
                td_vf_content.InnerHtml = td_vf_content.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/");
            }
            else
            {
                td_vf_content.InnerHtml = content_data.Html;
            }
            if (content_data.Teaser.Length > 0)
            {
                td_vf_summary.InnerHtml = DisplayFormDesign(content_data.Teaser);
            }
            else
            {
                td_vf_summary.InnerHtml = "<p>" + m_refMsg.GetMessage("lbl place post back message here") + "</p>";
            }
            ViewToolBar();
            Populate_ViewForm(form_data);
    }
Exemplo n.º 24
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        objStyle = new StyleHelper();
            _SearchHelper = new SearchHelper();
            gtMess = m_refContentApi.EkMsgRef;
            AppPath = siteRef.AppPath;
            AppImgPath = siteRef.AppImgPath;
            CurrentUserId = siteRef.UserId;
            EnableMultilingual = siteRef.EnableMultilingual;

            ltrStyleSheet.Text = objStyle.GetClientScript();
            if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
            {
                 ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                 siteRef.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else if (!String.IsNullOrEmpty(siteRef.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(siteRef.GetCookieValue("LastValidLanguageID"));
            }

            RegisterResources();
            SetServerJSVariables();

            if (m_refContentApi.RequestInformationRef.IsMembershipUser == 1 || m_refContentApi.RequestInformationRef.UserId == 0 || ! m_refContentApi.EkUserRef.IsAllowed(m_refContentApi.UserId, 0, "users", "IsAdmin", 0))
            {
                Response.Redirect(m_refContentApi.ApplicationPath + "Login.aspx", true);
                return;
            }

            StringBuilder sb = new StringBuilder();
            action = Request.QueryString["action"];
            if ("SubmitIntegratedFolder" == action || "UpdateIntegratedFolder" == action || action == "DeleteIntegratedFolder")
            {
                try
                {
                    if (("SubmitIntegratedFolder" == action) || ("UpdateIntegratedFolder" == action))
                        {
                            cIntegratedFolder = new IntegratedFolderData();
                            cIntegratedFolder.TypeId = System.Convert.ToInt32(Request.Form["integrated_id"]);
                            cIntegratedFolder.DirectoryName = Request.Form["frm_directoryname"];
                            cIntegratedFolder.ExcludeFiles = Request.Form["frm_excludefiles"];
                            cIntegratedFolder.IncludeFiles = Request.Form["frm_includefiles"];
                            cIntegratedFolder.ExcludeDirs = Request.Form["frm_excludedirs"];
                            if (Strings.LCase(Request.Form["frm_recursive"]) == "on")
                            {
                                cIntegratedFolder.Recursive = true;
                            }
                            else
                            {
                                cIntegratedFolder.Recursive = false;
                            }
                            cIntegratedFolder.UserName = Request.Form["DomainUserName"];
                            cIntegratedFolder.Password = Request.Form["Password"];

                            if (Path.IsPathRooted(cIntegratedFolder.DirectoryName))
                            {
                                cIntegratedFolder.AbsolutePath = cIntegratedFolder.DirectoryName;
                            }
                            else
                            {
                                cIntegratedFolder.AbsolutePath = (string) (EnsureTrailingSlash(HttpContext.Current.Request.MapPath((string) ("/" + cIntegratedFolder.DirectoryName))).Replace("/", "\\\\"));
                                if (! Directory.Exists(cIntegratedFolder.AbsolutePath))
                                {
                                    cIntegratedFolder.AbsolutePath = (string) (EnsureTrailingSlash(HttpContext.Current.Request.MapPath((string) ("~/" + cIntegratedFolder.DirectoryName))).Replace("/", "\\\\"));
                                }
                            }

                            if ("AddIntegratedFolder" == action)
                            {
                                m_refContentApi.EkContentRef.AddIntegratedFolder(cIntegratedFolder);
                            }
                            else
                            {
                               m_refContentApi.EkContentRef.UpdateIntegratedFolderByID(cIntegratedFolder);
                            }

                            if ("AddIntegratedFolder" == action)
                            {
                                Response.Redirect("integratedsearch.aspx?action=ViewAllIntegratedFolders");
                            }
                            else
                            {
                                Response.Redirect((string) ("integratedsearch.aspx?action=ViewIntegratedFolder&id=" + Request.Form["integrated_id"]));
                            }

                        }
                        else if (action == "DeleteIntegratedFolder")
                        {
                            m_refContentApi.EkContentRef.DeleteIntegratedFolder(System.Convert.ToInt64(Request.QueryString["id"]));
                            Response.Redirect("integratedsearch.aspx?action=ViewAllIntegratedFolders");
                        }

                }
                catch (Exception ex)
                {
                    DebugErrLit.Text = ex.Message;
                }
            }
            else
            {
                if (action == "ViewAllIntegratedFolders")
                {
                    pnlViewAllIntegratedFolders.Visible = true;
                    pnlAddEditViewIntegratedFolder.Visible = false;
                    ContentObj = siteRef.EkContentRef;
                    cIntegratedFolderArray = ContentObj.GetIntegratedFolders();
                    foreach (IntegratedFolderData cTempIntFolder in cIntegratedFolderArray)
                    {
                        sb.Append("<tr>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append(Environment.NewLine);
                        sb.Append("     <a href=\"integratedsearch.aspx?action=ViewIntegratedFolder&id=").Append(cTempIntFolder.TypeId).Append("\" title=\"Click here to view Integrated Search Folder\">").Append(Environment.NewLine);
                        sb.Append(cTempIntFolder.DirectoryName).Append(Environment.NewLine);
                        sb.Append("     </a>").Append(Environment.NewLine);
                        sb.Append("  </td>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append(cTempIntFolder.TypeId).Append("</td>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append((cTempIntFolder.ExcludeFiles).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append((cTempIntFolder.IncludeFiles).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append((cTempIntFolder.ExcludeDirs).Replace(",", ", ")).Append("</td>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append(cTempIntFolder.UserName).Append("</td>").Append(Environment.NewLine);
                        sb.Append("</tr>").Append(Environment.NewLine);
                    }
                    ltrFolderList.Text = sb.ToString();
                }
                else if ("AddIntegratedFolder" == action || "EditIntegratedFolder" == action || "ViewIntegratedFolder" == action)
                {
                    pnlViewAllIntegratedFolders.Visible = false;
                    pnlAddEditViewIntegratedFolder.Visible = true;

                    bool bNew = false;
                    bool bEdit = false;
                    ContentObj = siteRef.EkContentRef;

                    bNew = ("AddIntegratedFolder" == action);
                    bEdit = ("EditIntegratedFolder" == action);
                    bView = ("ViewIntegratedFolder" == action);
                    if (bNew)
                    {
                        id = 0;
                        strTitleMsg = gtMess.GetMessage("alt Click here to add Integrated Search Folder");
                        cIntegratedFolder = new IntegratedFolderData();
                    }
                    else
                    {
                        id = Convert.ToInt64(Request.QueryString["id"]);
                        if (bEdit)
                        {
                            strTitleMsg = gtMess.GetMessage("alt Edit Integrated Search Folder");
                        }
                        else if (bView)
                        {
                            strTitleMsg = gtMess.GetMessage("alt View Integrated Search Folder");
                        }
                        cIntegratedFolder = ContentObj.GetIntegratedFolderByID(id);
                    }

                    if (bNew)
                    {
                        strAction = "SubmitIntegratedFolder";
                    }
                    else
                    {
                        strAction = "UpdateIntegratedFolder";
                        strTitleMsg = strTitleMsg + " \"" + cIntegratedFolder.DirectoryName + "\"";
                    }

                    if (!bView)
                        Ektron.Cms.API.JS.RegisterJS(this, m_refContentApi.ApplicationPath + "java/optiontransfer.js", "EktronOptionTransferJS");

                    //Toolbar
                    sb = new StringBuilder();
                    if (bNew)
                    {
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewAllIntegratedFolders", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/save.png", "#", gtMess.GetMessage("alt Click here to add this integrated search folder"), gtMess.GetMessage("btn save"), "Onclick=\"javascript:return SubmitForm('integratedform', 'VerifyIntegratedSearchForm()');\"", StyleHelper.SaveButtonCssClass, true));
                    }
                    else if (bEdit)
                    {
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/save.png", "#", gtMess.GetMessage("alt Click here to updated this integrated search folder"), gtMess.GetMessage("btn update"), "Onclick=\"javascript:return SubmitForm('integratedform', 'VerifyIntegratedSearchForm()');\"", StyleHelper.SaveButtonCssClass, true));
                    }
                    else if (bView)
                    {
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/back.png", "integratedsearch.aspx?action=ViewAllIntegratedFolders", gtMess.GetMessage("alt back button text"), gtMess.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/contentEdit.png", "integratedsearch.aspx?action=EditIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt Edit this integrated search folder"), gtMess.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass, true));
                        sb.Append(objStyle.GetButtonEventsWCaption(AppPath + "images/UI/Icons/delete.png", "integratedsearch.aspx?action=DeleteIntegratedFolder&id=" + id + "", gtMess.GetMessage("alt Delete this integrated search folder"), gtMess.GetMessage("btn delete"), "OnClick=\"return ConfirmDelete();\"", StyleHelper.DeleteButtonCssClass));
                    }
                    sb.Append(StyleHelper.ActionBarDivider);
                    sb.Append("<td>").Append(objStyle.GetHelpButton(action, "")).Append("</td>").Append(Environment.NewLine);
                    ltrToolBar.Text = sb.ToString();

                    //PageHolder
                    sb = new StringBuilder();
                    sb.Append("<table class=\"ektronForm\">	").Append(Environment.NewLine);
                    //tr
                    sb.Append("     <tr>").Append(Environment.NewLine);
                    sb.Append("         <td class=\"label\"><label for=\"DirectoryName\" title=\"Site Directory\">").Append(gtMess.GetMessage("lbl Site Directory")).Append("</label></td>").Append(Environment.NewLine);
                    if (bView)
                    {
                        sb.Append("     <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.DirectoryName).Append("\" >").Append(cIntegratedFolder.DirectoryName).Append("</td>").Append(Environment.NewLine);
                    }
                    else
                    {
                        sb.Append("     <td class=\"value\">").Append(Environment.NewLine);
                        sb.Append("         <input type=\"text\" title=\"Enter Directory Name here\" id=\"DirectoryName\" name=\"frm_directoryname\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode(cIntegratedFolder.DirectoryName)).Append("\" />").Append(Environment.NewLine);
                        sb.Append("         <div class=\"ektronCaption\" title=\"Directory or virtual directory relative to site root\">").Append(gtMess.GetMessage("alt Directory or virtual directory relative to site root")).Append("</div>").Append(Environment.NewLine);
                        if (bNew || bEdit)
                            sb.Append("     <span class=\"ektronCaption\" style=\"color:Red\" title=\"Please make sure you create virtual directory first before adding the virtual directory name\">").Append(gtMess.GetMessage("alt the virtual directory name")).Append("</span>").Append(Environment.NewLine);
                        sb.Append("     </td>").Append(Environment.NewLine);
                    }
                    sb.Append("     </tr>").Append(Environment.NewLine);
                    if (!bNew)
                    {
                        sb.Append("  <tr>").Append(Environment.NewLine);
                        sb.Append("     <td class=\"label\" title=\"ID\">").Append(gtMess.GetMessage("id label")).Append("</td>").Append(Environment.NewLine);
                        sb.Append("     <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.TypeId).Append("\" >").Append(cIntegratedFolder.TypeId).Append("</td>").Append(Environment.NewLine);
                        sb.Append("  </tr>").Append(Environment.NewLine);
                    }
                    //tr
                    sb.Append("  <tr>").Append(Environment.NewLine);
                    sb.Append("     <td class=\"label\"><label for=\"Recursive\" title=\"Recursive\">").Append(gtMess.GetMessage("lbl Recursive")).Append(":</label></td>").Append(Environment.NewLine);
                    if (bView)
                        sb.Append("   <td class=\"readOnlyValue\" title=\"").Append(_SearchHelper.BoolToYesNo(cIntegratedFolder.Recursive)).Append("\" >").Append(_SearchHelper.BoolToYesNo(cIntegratedFolder.Recursive)).Append("</td>").Append(Environment.NewLine);
                    else
                        sb.Append("  <td class=\"value\"><input type=\"checkbox\" title=\"Recursive Option\" id=\"Recursive\" name=\"frm_recursive\" ").Append(_SearchHelper.CheckedAttr(cIntegratedFolder.Recursive)).Append(" /></td>").Append(Environment.NewLine);
                    sb.Append("  </tr>").Append(Environment.NewLine);

                    //tr
                    sb.Append("  <tr>").Append(Environment.NewLine);
                    sb.Append("      <td class=\"label\"><label for=\"IncludeFiles\" title=\"Exclude Directories\">").Append(gtMess.GetMessage("lbl exclude directories")).Append("</label></td>").Append(Environment.NewLine);
                    if (bView)
                    {
                        sb.Append("  <td class=\"readOnlyValue\" title=\"").Append((cIntegratedFolder.ExcludeDirs).Replace(",", ", ")).Append("\" >").Append((cIntegratedFolder.ExcludeDirs).Replace(",", ", ")).Append(":</td>").Append(Environment.NewLine);
                    }
                    else
                    {
                        sb.Append("  <td class=\"value\">").Append(Environment.NewLine);
                        sb.Append("    <input type=\"text\" title=\"Enter Exclude Directories here\" id=\"ExcludeDirs\" name=\"frm_excludedirs\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.ExcludeDirs).Replace(",", ", "))).Append("\"/>").Append(Environment.NewLine);
                        sb.Append("    <div class=\"ektronCaption\" title=\"Sub directories not to include in search\" >").Append(gtMess.GetMessage("alt Sub directories not to include in search")).Append("</div>").Append(Environment.NewLine);
                        sb.Append("  </td>").Append(Environment.NewLine);
                    }
                    sb.Append("  </tr>").Append(Environment.NewLine);
                    //tr
                    sb.Append("  <tr>").Append(Environment.NewLine);
                    sb.Append("     <td class=\"label\"><label for=\"ExcludeFiles\" title=\"Exclude Extensions\">").Append(gtMess.GetMessage("lbl exclude extension")).Append(":</label></td>").Append(Environment.NewLine);
                    if (bView)
                    {
                        sb.Append("  <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.ExcludeFiles).Append("\" >").Append(cIntegratedFolder.ExcludeFiles).Append("</td>").Append(Environment.NewLine);
                    }
                    else
                    {
                        sb.Append("  <td class=\"value\">").Append(Environment.NewLine);
                        sb.Append("     <input type=\"text\" title=\"Enter Excluded File Extensions here\" id=\"ExcludeFiles\" name=\"frm_excludefiles\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.ExcludeFiles).Replace(",", ", "))).Append("\" />").Append(Environment.NewLine);
                        sb.Append("     <div class=\"ektronCaption\" title=\"Extensions not to include *.aspx,*.ascx\">").Append(gtMess.GetMessage("alt Extensions not to include *.aspx,*.ascx")).Append("</div>").Append(Environment.NewLine);
                        sb.Append("  <td>").Append(Environment.NewLine);
                    }
                    sb.Append("  </tr>").Append(Environment.NewLine);
                    //tr
                    sb.Append("  <tr>").Append(Environment.NewLine);
                    sb.Append("       <td class=\"label\"><label for=\"IncludeFiles\" title=\"Include Extensions\">").Append(gtMess.GetMessage("lbl include extensions")).Append(":</label></td>").Append(Environment.NewLine);
                    if (bView)
                    {
                        sb.Append("   <td class=\"readOnlyValue\" title=\"").Append(cIntegratedFolder.IncludeFiles).Append("\">").Append(cIntegratedFolder.IncludeFiles).Append("</td>").Append(Environment.NewLine);
                    }
                    else
                    {
                        sb.Append("   <td class=\"value\">").Append(Environment.NewLine);
                        sb.Append("     <input type=\"text\" title=\"Enter Included File Extensions here\" id=\"IncludeFiles\" name=\"frm_includefiles\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode((cIntegratedFolder.IncludeFiles).Replace(",", ", "))).Append("\"/>").Append(Environment.NewLine);
                        sb.Append("     <div class=\"ektronCaption\" title=\"*.html,*.doc exclude extensions is ignored if include is specified\">").Append(gtMess.GetMessage("alt extensions is ignored if include is specified")).Append("</div>").Append(Environment.NewLine);
                        sb.Append("   </td>").Append(Environment.NewLine);
                    }
                    sb.Append("  </tr>").Append(Environment.NewLine);
                    //tr
                    sb.Append("  <tr>").Append(Environment.NewLine);
                    sb.Append("     <td class=\"label\"><label title=\"Domain/User Name\" for=\"DomainUserName\">").Append(gtMess.GetMessage("lbl domain username")).Append(":</label></td>").Append(Environment.NewLine);
                    if (bView)
                    {
                        sb.Append("  <td class=\"readOnlyValue\">").Append(cIntegratedFolder.UserName).Append(Environment.NewLine);
                    }
                    else
                    {
                        sb.Append("  <td class=\"value\"><input type=\"text\" title=\"Enter Domain or User Name here\" id=\"DomainUserName\" name=\"DomainUserName\" maxlength=\"255\" value=\"").Append(EkFunctions.HtmlEncode(cIntegratedFolder.UserName)).Append("\"/>").Append(Environment.NewLine);
                    }
                    sb.Append("          <div class=\"ektronCaption\" title=\"Specify domain or username\">").Append(gtMess.GetMessage("alt domain username")).Append("</div>").Append(Environment.NewLine);
                    sb.Append("     </td>").Append(Environment.NewLine);
                    sb.Append("  </tr>").Append(Environment.NewLine);

                    if (bNew)
                    {
                        string integratedFolderNames = "";
                        cIntegratedFolderArray = ContentObj.GetIntegratedFolders();
                        foreach (IntegratedFolderData cTempIntFolder in cIntegratedFolderArray)
                        {
                            if (cTempIntFolder.DirectoryName != null && cTempIntFolder.DirectoryName.Length > 0)
                            {
                                if (integratedFolderNames.Length > 0)
                                {
                                    integratedFolderNames += ",";
                                }
                                integratedFolderNames += cTempIntFolder.DirectoryName;
                            }
                        }
                        sb.Append("<input type=\"hidden\" id=\"integrated_fol_names\" value=\"").Append(integratedFolderNames).Append("\" />").Append(Environment.NewLine);
                    }
                    ektronPageHolder.InnerHtml = sb.ToString();
                }
            }
    }
Exemplo n.º 25
0
    private void Page_Init(System.Object sender, System.EventArgs e)
    {
        char[] endSlash = new char[] { '/' };
        this.ApplicationPath = m_refContentApi.ApplicationPath.TrimEnd(endSlash.ToString().ToCharArray());
        this.SitePath = m_refContentApi.SitePath.TrimEnd(endSlash.ToString().ToCharArray());
        if ((Request.QueryString["thickbox"] != null) && Request.QueryString["thickbox"] == "true")
        {
            usesModal = true;
        }

        //Register Page Components
        this.RegisterCSS();
        this.RegisterJS();
        _EkContentRef = new EkContent(_cApi.RequestInformationRef);

        _Editor = (ContentDesignerWithValidator)LoadControl(m_refContentApi.ApplicationPath + "controls/Editor/ContentDesignerWithValidator.ascx");
        _Editor.Width = System.Web.UI.WebControls.Unit.Pixel(750);
        _Editor.Visible = false;
        _Editor.ID = "content_html";
        pnlTerms.Controls.Add(_Editor);
        ((Ektron.ContentDesignerWithValidator)(pnlTerms.Controls[0])).ToolsFile = m_refContentApi.ApplicationPath + "ContentDesigner/configurations/InterfaceBlog.aspx?Translate=False&EmoticonSelect=1&WMV=1";
    }
Exemplo n.º 26
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        RegisterResources();
            m_refMsg = m_refSiteApi.EkMsgRef;
            ContentLanguage = m_refSiteApi.ContentLanguage;
            if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || ContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
            {
                ContentLanguage = m_refSiteApi.DefaultContentLanguage;
            }
            language_data = m_refSiteApi.GetLanguageById(ContentLanguage);

            m_refContent = m_refSiteApi.EkContentRef;
            AppImgPath = m_refSiteApi.AppImgPath;

            if (Request.QueryString["id"] != null && Information.IsNumeric(Request.QueryString["id"]))
            {
                m_nId = Convert.ToInt64(Request.QueryString["id"]);
            }
            if (Request.QueryString["type"] != null)
            {
                m_nMetaTypeId = Convert.ToInt64(Request.QueryString["type"]);
            }
            if (Request.QueryString["tagtype"] != null)
            {
                m_nMetaTagType = Convert.ToInt32(Request.QueryString["tagtype"]);
            }
            if (Ektron.Cms.Common.EkConstants.MetaTagType_Menu == m_nMetaTagType)
            {
                _isMenu = true;
            }
            else if (Ektron.Cms.Common.EkConstants.MetaTagType_User == m_nMetaTagType)
            {
                _isUser = true;
                CollectSearchText();
            }
            else
            {
                _isCollection = true;
            }
            if (Request.QueryString["title"] != null)
            {
                m_strTitle = Request.QueryString["title"];
            }
            if (Request.QueryString["metadataformtagid"] != null)
            {
                m_nMetadataFormTagId = Convert.ToInt32(Request.QueryString["metadataformtagid"]);
            }

            ShowControls();
    }
Exemplo n.º 27
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        _MessageHelper = _Common.EkMsgRef;
            AppImgPath = _Common.AppImgPath;
            AppPath = _Common.AppPath;
            _PageAction = Request.QueryString["action"];

            if (!string.IsNullOrEmpty(Request.QueryString["reloadtrees"]))
            {
                reloadTree = true;
            }

            object refCommon = _Common as object;
            Utilities.SetLanguage(_Common);
            //Utilities.SetLanguage(_Common);
            RegisterResources();
            TaxonomyLanguage = _Common.ContentLanguage;
            TaxonomyId = Convert.ToInt64(Request.QueryString["taxonomyid"]);
            if (Request.QueryString["view"] != null)
            {
                _ViewItem = AntiXss.HtmlEncode(Request.QueryString["view"]);
            }
            taxonomy_request = new TaxonomyRequest();
            taxonomy_request.TaxonomyId = TaxonomyId;
            taxonomy_request.TaxonomyLanguage = TaxonomyLanguage;
            _Content = _Common.EkContentRef;
            taxonomy_request.PageSize = 99999999; // pagesize of 0 used to mean "all"
            TaxonomyBaseData[] taxcats;
            taxcats = _Content.ReadAllSubCategories(taxonomy_request);
            if (taxcats != null)
            {
                TaxonomyCategoryCount = taxcats.Length;
            }
            if (Page.IsPostBack && Request.Form[isPostData.UniqueID] != "")
            {
                if (Request.Form["submittedaction"] == "delete")
                {
                    _Content.DeleteTaxonomy(taxonomy_request);
                    //Response.Write("<script type=""text/javascript"">parent.CloseChildPage();</script>")
                    Response.Redirect("taxonomy.aspx?action=reload&rf=1&reloadtrees=Tax", true);
                }
                else if (Request.Form["submittedaction"] == "deleteitem")
                {
                    if (_ViewItem != "folder")
                    {
                        taxonomy_request.TaxonomyIdList = Request.Form["selected_items"];
                        if (_ViewItem.ToLower() == "cgroup")
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Group;
                        }
                        else if (_ViewItem.ToLower() == "user")
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.User;
                        }
                        else
                        {
                            taxonomy_request.TaxonomyItemType = EkEnumeration.TaxonomyItemType.Content;
                        }
                        _Content.RemoveTaxonomyItem(taxonomy_request);
                    }
                    else
                    {
                        TaxonomySyncRequest tax_folder = new TaxonomySyncRequest();
                        tax_folder.TaxonomyId = TaxonomyId;
                        tax_folder.TaxonomyLanguage = TaxonomyLanguage;
                        tax_folder.SyncIdList = Request.Form["selected_items"];
                        _Content.RemoveTaxonomyFolder(tax_folder);
                    }
                    if (Request.Params["ccp"] == null)
                    {
                        Response.Redirect("taxonomy.aspx?" + Request.ServerVariables["query_string"] + "&ccp=true", true);
                    }
                    else
                    {
                        Response.Redirect((string) ("taxonomy.aspx?" + Request.ServerVariables["query_string"]), true);
                    }
                }
            }
            else if (IsPostBack == false)
            {
                DisplayPage();
            }
            AssignTextStrings();
            isPostData.Value = "true";
            hdnSourceId.Value = TaxonomyId.ToString();
    }
Exemplo n.º 28
0
        protected override void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                base.Page_Load(sender, e);
                if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce))
                {
                    throw (new Exception(GetMessage("feature locked error")));
                }
                Util_ObtainValues();
                Util_CheckAccess();
                m_refCatalog = new Ektron.Cms.Commerce.CatalogEntry(m_refContentApi.RequestInformationRef);
                m_refCurrency = new Currency(m_refContentApi.RequestInformationRef);
                m_refContent = m_refContentApi.EkContentRef;
                hdn_defaultCurrency.Value = m_refContentApi.RequestInformationRef.CommerceSettings.DefaultCurrencyId.ToString();

                switch (this.m_sEditAction)
                {
                    case "add":
                    case "addlang":
                        m_iFolder = this.m_iID;
                        if (!Page.IsPostBack)
                        {
                            UserRights = m_refContentApi.LoadPermissions(m_iFolder, "folder", ContentAPI.PermissionResultType.Folder);
                            ContentMetaData[] defaultMeta;
                            Util_CheckFolderType();
                            if (m_sEditAction == "addlang")
                            {
                                entry_edit_data = m_refCatalog.GetItem(otherLangId, backLangType);
                                if (entry_edit_data.ProductType.Id > 0)
                                {
                                    m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
                                    prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);
                                    editorPackage = prod_type_data.PackageXslt;
                                    xid = prod_type_data.Id;
                                    Util_SetXmlId(xid);
                                    hdn_entrytype.Value = entry_edit_data.EntryType.ToString();
                                }
                            }
                            if (entry_edit_data == null)
                            {
                                Util_GetEntryType();
                            }
                            defaultMeta = m_refContentApi.GetMetaDataTypes("id");
                            if ((defaultMeta != null) && defaultMeta.Length > 0)
                            {
                                meta_data.AddRange(defaultMeta);
                            }
                            Display_ContentTab();
                            Display_SummaryTab();
                            Display_EntryTab();
                            Display_PricingTab();
                            Display_MediaTab();
                            Display_ItemTab();
                            Display_MetadataTab();
                            Display_ScheduleTab();
                            Display_TaxonomyTab();
                            Display_CommentTab();
                            Display_TemplateTab();
                            if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                            {
                                Display_AliasTab();
                            }
                            Util_SetLabels();
                        }
                        else
                        {
                            Process_Add();
                        }
                        break;
                    case "update":
                        if (!Page.IsPostBack)
                        {
                            UserRights = m_refContentApi.LoadPermissions(m_iID, "content", ContentAPI.PermissionResultType.Content);
                            if (PullApproval)
                                this.m_refContent.TakeOwnership(m_iID);
                            entry_edit_data = m_refCatalog.GetItemEdit(m_iID, m_refContentApi.RequestInformationRef.ContentLanguage, true);
                            if (entry_edit_data.ProductType.Id > 0)
                            {
                                m_refProductType = new ProductType(m_refContentApi.RequestInformationRef);
                                prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true);
                                editorPackage = prod_type_data.PackageXslt;
                                xid = prod_type_data.Id;
                                Util_SetXmlId(xid);
                                hdn_entrytype.Value = entry_edit_data.EntryType.ToString();
                            }
                            meta_data = entry_edit_data.Metadata;
                            m_iFolder = entry_edit_data.FolderId;
                            Util_CheckFolderType();
                            Display_ContentTab();
                            Display_SummaryTab();
                            Display_EntryTab();
                            Display_PricingTab();
                            Display_MediaTab();
                            Display_ItemTab();
                            Display_MetadataTab();
                            Display_ScheduleTab();
                            Display_TaxonomyTab();
                            Display_CommentTab();
                            Display_TemplateTab();
                            if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                            {
                                Display_AliasTab();
                            }
                            Util_SetLabels();
                        }
                        else
                        {
                            Process_Edit();
                        }
                        break;
                }
                Util_SetJS();

                if (prod_type_data != null)
                {
                    hdn_productType.Value = prod_type_data.EntryClass.ToString();
                }

                this.RegisterJs();
                this.RegisterCss();
                if (catalog_data != null)
                {
                    chk_searchable.Checked = catalog_data.IscontentSearchable;
                }

                //-------------------DisplayTabs Based on selected options from Folder properties----------------------------------
                if (((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && catalog_data.DisplaySettings != 0)
                {
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Summary) == (int)EkEnumeration.FolderTabDisplaySettings.Summary)
                    { divSummary.Visible = true; }
                    else
                    {
                        divSummary.Visible = false;
                        liSummary.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData)
                    { divMetadata.Visible = true; }
                    else
                    {
                        if (!metadataRequired)
                        {
                            divMetadata.Visible = false;
                            liMetadata.Visible = false;
                        }
                    }
                    if ((_urlAliasSettingApi.IsManualAliasEnabled || _urlAliasSettingApi.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                    {

                        if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing)
                        { divAlias.Visible = true; }
                        else
                        {
                            if (!catalog_data.AliasRequired)
                            {
                                divAlias.Visible = false;
                                liAlias.Visible = false;
                            }
                        }
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Schedule) == (int)EkEnumeration.FolderTabDisplaySettings.Schedule)
                    { divSchedule.Visible = true; }
                    else
                    {
                        divSchedule.Visible = false;
                        liSchedule.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Comment) == (int)EkEnumeration.FolderTabDisplaySettings.Comment)
                    { divComment.Visible = true; }
                    else
                    {
                        divComment.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Templates) == (int)EkEnumeration.FolderTabDisplaySettings.Templates)
                    { divTemplates.Visible = true; }
                    else
                    {
                        divTemplates.Visible = false;
                    }
                    if ((catalog_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy)
                    { divCategories.Visible = true; }
                    else
                    {
                        if (!catalog_data.IsCategoryRequired)
                        {
                            divCategories.Visible = false;
                            liCategory.Visible = false;
                        }
                    }
                }

                //-------------------DisplayTabs Based on selected options from Folder properties End------------------------------
            }
            catch (Exception ex)
            {

                Utilities.ShowError(ex.Message);

            }
        }
Exemplo n.º 29
0
 protected void Page_Init(System.Object sender, System.EventArgs e)
 {
     EnableMultilingual = AppUI.EnableMultilingual;
     cContObj = new EkContent(m_refContentApi.RequestInformationRef);
     objTask = new EkTask(m_refContentApi.RequestInformationRef);
     MsgHelper = new EkMessageHelper(m_refContentApi.RequestInformationRef);
     objTaskType = new Ektron.Cms.Content.EkTaskType(m_refContentApi.RequestInformationRef);
     usrObj = new Ektron.Cms.User.EkUser(m_refContentApi.RequestInformationRef);
     GenerateJS();
     ltrStyleHelper.Text = m_refStyle.GetClientScript();
     ltrEmailScript.Text = m_EmailHelper.EmailJS();
     FillLiterals();
     ctlEditor = (Ektron.ContentDesignerWithValidator)LoadControl("controls/Editor/ContentDesignerWithValidator.ascx");
     ctlEditor.ID = "description";
     ctlEditor.AllowScripts = true;
     ctlEditor.Height = new Unit(450, UnitType.Pixel);
     ctlEditor.Width = new Unit(100, UnitType.Percentage);
     ctlEditor.ToolsFile = m_refContentApi.ApplicationPath + "ContentDesigner/configurations/InterfaceTask.xml";
     ctlEditor.AllowFonts = true;
     ctlEditor.ShowHtmlMode = false;
     ctlEditor.Stylesheet = m_refContentApi.ApplicationPath + "csslib/ewebeditprostyles.css";
     RegularExpressionValidator ctlValidator = new RegularExpressionValidator();
     Ektron.Cms.Common.EkMessageHelper m_refMsg = m_refSiteApi.EkMsgRef;
     ctlValidator.ID = "RegExpValidator";
     ctlValidator.ControlToValidate = "description";
     ctlValidator.ErrorMessage = m_refMsg.GetMessage("content size exceeded");
     ctlValidator.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(int.Parse(iMaxContLength));
     Action = EkFunctions.HtmlEncode(Request.QueryString["action"]);
     if ("AddTask" == Action)
     {
         AddTaskValidatorHolder.Controls.Add(ctlValidator);
         AddTaskEditorHolder.Controls.Add(ctlEditor);
     }
     else if ("EditTask" == Action)
     {
         EditTaskValidatorHolder.Controls.Add(ctlValidator);
         EditTaskEditorHolder.Controls.Add(ctlEditor);
     }
     if (Request.QueryString["page"] != null)
     {
         CurrentPage = EkFunctions.ReadIntegerValue(Request.QueryString["page"], 1);
     }
 }
Exemplo n.º 30
0
    protected void Page_Load(System.Object sender, System.EventArgs e)
    {
        ApplicationAPI AppUI = new ApplicationAPI();
        EkContent cContObj = new EkContent(AppUI.RequestInformationRef);
        taskObj = new EkTask(AppUI.RequestInformationRef);
        long cid;
        string[] tasksArray;
        int lCounter;
        string RefType;
        long CurrentUserID;
        string AppPath;
        string AppImgPath;
        string SitePath;
        string AppeWebPath;
        long CommentKeyId = 0;
        long CommentId = 0;
        string Action;
        object ActionType;
        object IsMac;
        object platform;
        bool Flag;
        object retVal;
        object CommentText;
        object NS4;
        object OrderBy;
        object iMaxContLength;
        object localeFileString;
        object var1;
        object var2;
        string taskIDs;
        object height;
        object width;
        int EnableMultilingual;
        int ContentLanguage;
        Ektron.Cms.Common.EkMessageHelper MsgHelper;
        System.Text.StringBuilder sbScript = new System.Text.StringBuilder();

        MsgHelper = AppUI.EkMsgRef;
        AppPath = AppUI.AppPath;
        AppImgPath = AppUI.AppImgPath;
        SitePath = AppUI.SitePath;
        AppeWebPath = AppUI.AppeWebPath;
        AppPath = AppUI.AppPath;
        AppName = AppUI.AppName;
        EnableMultilingual = AppUI.EnableMultilingual;
        ContentLanguage = 1033; //set default value
        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        if (Convert.ToBoolean(AppUI.RequestInformationRef.IsMembershipUser))
        {
            Response.Redirect("reterror.aspx?info=" + MsgHelper.GetMessage("msg login cms user"), false);
            return;
        }
        if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
            AppUI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
        }
        else
        {
            if (!string.IsNullOrEmpty(AppUI.GetCookieValue("LastValidLanguageID")))
            {
                ContentLanguage = Convert.ToInt32(AppUI.GetCookieValue("LastValidLanguageID"));
            }
        }

        platform = Request.ServerVariables["HTTP_USER_AGENT"];
        if (platform.ToString().IndexOf("Windows") + 1 > 0)
        {
            IsMac = 0;
        }
        else
        {
            IsMac = 1;
        }

        RefType = "T";
        Flag = false;
        iMaxContLength = 65000;
        localeFileString = "0000";
        var1 = Request.ServerVariables["SERVER_NAME"];
        if (!string.IsNullOrEmpty(Request.QueryString["commentkey_id"]))
        {
            CommentKeyId = Convert.ToInt64(Request.QueryString["commentkey_id"]);
        }
        Action = Request.QueryString["action"];
        ActionType = Request.QueryString["ty"];
        OrderBy = Request.QueryString["orderby"];
        cid = Convert.ToInt64(Request.QueryString["id"]);
        if (!string.IsNullOrEmpty(Request.QueryString["Comment_Id"]))
        {
            CommentId = Convert.ToInt64(Request.QueryString["Comment_Id"]);
        }
        if (!string.IsNullOrEmpty((Request.QueryString["height"])))
        {
            height = Convert.ToDouble(Request.QueryString["height"]);
        }
        if (!string.IsNullOrEmpty((Request.QueryString["width"])))
        {
            width = Convert.ToDouble(Request.QueryString["width"]);
        }
        lCounter = 0;
        CurrentUserID = AppUI.UserId;

        ltrComments.Text = MsgHelper.GetMessage("lbl task comment") + ":";
        if (Request.QueryString["action"] != null && Request.QueryString["action"].ToString().ToLower() == "declinecontentaction")
            ltrComments.Text = MsgHelper.GetMessage("reason to decline");

        cContObj = AppUI.EkContentRef;

        if (Request.ServerVariables["http_user_agent"].ToString().IndexOf("Mozilla") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("4.7") + 1 > 0 && Request.ServerVariables["http_user_agent"].ToString().IndexOf("GECKO") < 0)
        {
            NS4 = true;
        }
        else
        {
            NS4 = false;
        }

        var2 = cContObj.GetEditorVariablev2_0(0, "tasks");
        ctlEditor.Validate();
        if (Action == "Add" && ctlEditor.IsValid)
        {
            CommentText = this.ctlEditor.Content;
            if (cid != 0)
            {
                //Get all tasks associated with the content and add same comment
                taskObj = AppUI.EkTaskRef;
                object strStates;
                strStates = EkEnumeration.TaskState.NotStarted.ToString() + "," + EkEnumeration.TaskState.Active.ToString() + "," + EkEnumeration.TaskState.AwaitingData.ToString() + "," + EkEnumeration.TaskState.OnHold.ToString() + "," + EkEnumeration.TaskState.Pending.ToString() + "," + EkEnumeration.TaskState.Reopened.ToString();
                taskIDs = taskObj.GetTaskIDs(cid, strStates, -1, (int)EkEnumeration.CMSTaskItemType.TasksByStateAndContentID);

                if (taskIDs != "")
                {
                    tasksArray = Strings.Split(taskIDs.ToString(), ",", -1, 0);
                    while (lCounter <= (tasksArray.Length - 1))
                    {
                        retVal = cContObj.AddComment(Convert.ToInt64(CommentKeyId), Convert.ToInt64(CommentId), Convert.ToInt64(tasksArray.GetValue(lCounter)), RefType, CurrentUserID, Strings.Replace(CommentText.ToString(), "\'", "\'\'", 1, -1, 0));
                        lCounter++;
                    }
                }

            }
            Flag = true;
        }
        if (true == Flag)
        {
            sbScript.Append("<script language=\"JavaScript\" type=\"text/javascript\">" + "\r\n");
            sbScript.Append("<!--");
            sbScript.Append("if (IsBrowserIE())");
            sbScript.Append("{");
            sbScript.Append("   parent.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + \"&id=\" + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );");
            sbScript.Append("}");
            sbScript.Append("else");
            sbScript.Append("{");
            sbScript.Append("   top.opener.ReturnChildValue(\"action=\" + document.getElementById(\"actionName\").value + " + ID == " + document.getElementById(\"cid\").value + \"&fldid=\" + document.getElementById(\"fldid\").value + \"&page=\" + document.getElementById(\"page\").value );");
            sbScript.Append("   close();");
            sbScript.Append("}");
            sbScript.Append("//-->");
            sbScript.Append("</script>" + "\r\n");
            ClosePanel.Text = sbScript.ToString();
        }

        if ((Request.QueryString["action"]) == "Add")
        {
            actionName.Value = Request.QueryString["actionName"];
        }
        else
        {
            actionName.Value = Request.QueryString["action"];
        }

        this.ctlEditor.AllowFonts = true;
        ctlEditor.ErrorMessage = MsgHelper.GetMessage("content size exceeded");
        ctlEditor.ValidationExpression = Utilities.BuildRegexToCheckMaxLength(System.Convert.ToInt32(iMaxContLength));
    }
Exemplo n.º 31
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        // register JS and CSS
        RegisterResources();
        try
        {
            _Msg = _ContentApi.EkMsgRef;
            CheckAccess();
            ExtraQuery = "";
            if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                _ContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = int.Parse(_ContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            ExtraQuery = (string)("&LangType=" + ContentLanguage);
            if (!(Request.QueryString["WantXmlInfo"] == null))
            {
                ExtraQuery += "&WantXmlInfo=1";
                m_nWantXmlInfo = 1;
            }
            else
            {
                m_nWantXmlInfo = 0;
            }

            if (!String.IsNullOrEmpty(Request.QueryString["FolderType"]))
            {
                FolderType = (EkEnumeration.FolderType)Enum.Parse(typeof(EkEnumeration.FolderType), EkFunctions.UrlEncode(Request.QueryString["FolderType"]), true);
                if (Information.IsNumeric(Request.QueryString["FolderType"]))
                {
                    ExtraQuery += (string)("&FolderType=" + FolderType);
                }
            }
            if (!(Request.QueryString["menuflag"] == null))
            {
                _menuFlag = System.Convert.ToBoolean(Request.QueryString["menuflag"].ToLower() == "true");
                ExtraQuery += (string)("&menuflag=" + Request.QueryString["menuflag"]);
            }

            _Msg = _ContentApi.EkMsgRef;
            //Put user code to initialize the page here
            AppImgPath = _ContentApi.AppImgPath;
            AppPath = _ContentApi.AppPath;
            AppName = _ContentApi.AppName;
            if ((!String.IsNullOrEmpty(Request.QueryString["FolderID"])) && Information.IsNumeric(Request.QueryString["FolderID"]))
            {
                FolderId = Convert.ToInt64(Request.QueryString["FolderID"]);
            }
            StyleSheetJS.Text = _Style.GetClientScript();
            if (!(Request.QueryString["listfolderfor"] == null))
            {
                ListFoldersFor = (string)(Request.QueryString["listfolderfor"].ToString().ToLower());
                ListFoldersFor = EkFunctions.UrlEncode(ListFoldersFor);
                ExtraQuery += (string)("&listfolderfor=" + ListFoldersFor);
            }

            _Content = _ContentApi.EkContentRef;
            gtNavs = _Content.GetFolderInfoWithPath(FolderId);
            currentFolderType = (EkEnumeration.FolderType)Enum.ToObject(typeof(EkEnumeration.FolderType), Convert.ToInt32(gtNavs["FolderType"]));
            FolderName = gtNavs["FolderName"];
            ParentFolderId = gtNavs["ParentID"];
            fPath = (string)(gtNavs["Path"]);
            m_nTargetFolderIsXml = ((Collection)gtNavs["XmlConfiguration"]).Count;

            cTmp = new Collection();
            cTmp.Add("name", "OrderBy", null, null);
            cTmp.Add(FolderId, "FolderID", null, null);
            cTmp.Add(FolderId, "ParentID", null, null);

            if ((!(Request.QueryString["noblogfolders"] == null)) && Information.IsNumeric(Request.QueryString["noblogfolders"]))
            {
                if (Convert.ToInt32(Request.QueryString["noblogfolders"]) > 0)
                    m_bBlockBlogFolders = true;
                else
                    m_bBlockBlogFolders = false;
            }
            cFolders = _Content.GetAllViewableChildFoldersv2_0(cTmp);

            if (!(Request.QueryString["action"] == null))
            {
                strPageAction = Request.QueryString["action"];
            }

            if (!(Request.QueryString["from_page"] == null))
            {
                strRedirectFromReport = Request.QueryString["from_page"];
            }

            if (!(Request.QueryString["subfolderchk"] == null))
            {
                m_bSubFolder = System.Convert.ToBoolean("true" == Request.QueryString["subfolderchk"].ToLower());
            }

            GenerateToolBar();

            // support for enhanced metadata (used with customfields.vb):
            if (!(Request.QueryString["metadataFormTagId"] == null))
            {
                ExtraQuery += (string)("&metadataFormTagId=" + EkFunctions.UrlEncode(Request.QueryString["metadataFormTagId"]));
                ExtraQuery += (string)("&separator=" + EkFunctions.UrlEncode(Request.QueryString["separator"]));
                frmFormTagId.Value = EkFunctions.UrlEncode(Request.QueryString["metadataFormTagId"]);
            }

            PopulateGridData();
            AssignJsTextStrings();
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }