Exemplo n.º 1
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.º 2
0
        private void Display_MetadataTab()
        {
            StringBuilder sbAttrib = new StringBuilder();
            StringBuilder sbResult = new StringBuilder();
            string strResult;
            string strAttrResult;
            string strImage = "";

            //Dim enhancedMetadataScript As New Literal
            //enhancedMetadataScript.Text = Replace(CustomFields.GetEnhancedMetadataScript(), "src=""java/", "src=""../java/")
            //Me.Page.Header.Controls.Add(enhancedMetadataScript)
            EnhancedMetadataArea.Text = CustomFields.GetEnhancedMetadataArea();
            if ((meta_data != null) || (prod_type_data != null))
            {
                m_refSite = new Ektron.Cms.Site.EkSite(this.m_refContentApi.RequestInformationRef);
                Hashtable hPerm = m_refSite.GetPermissions(m_iFolder, 0, "folder");
                if (meta_data != null)
                {
                    sbResult = CustomFields.WriteFilteredMetadataForEdit(meta_data.ToArray(), false, m_sEditAction, m_iFolder, ref lValidCounter, hPerm);
                    if (sbResult.ToString().Contains("<span style=\"color:red\">"))
                        metadataRequired = true;
                }
                if (prod_type_data != null)
                {

                    if (Util_IsEditable())
                    {

                        sbAttrib = CustomFields.WriteFilteredAttributesForEdit(entry_edit_data.Attributes, m_sEditAction, xid, prod_type_data.Attributes, ref lValidCounter, hPerm);
                    }
                    else
                    {
                        sbAttrib.Append(CustomFields.WriteFilteredAttributesForView(entry_edit_data.Attributes, xid, false, prod_type_data.Attributes));
                    }
                }
            }
            if (m_sEditAction == "update")
            {
                strImage = entry_edit_data.Image;
                string strThumbnailPath = entry_edit_data.ImageThumbnail;
                if (entry_edit_data.ImageThumbnail == "")
                {
                    strThumbnailPath = m_refContentApi.AppImgPath + "spacer.gif";
                }
                else
                {
                    strThumbnailPath = m_refContentApi.SitePath + strThumbnailPath;
                }
                if (System.IO.Path.GetExtension(strThumbnailPath).ToLower().IndexOf(".gif") != -1 && strThumbnailPath.ToLower().IndexOf("spacer.gif") == -1)
                {
                    strThumbnailPath = strThumbnailPath.Replace(".gif", ".png");
                }
                // sbResult.Append("<fieldset><legend>Image Data:</legend><table><tr><td class=""info"" align=""left"">Image:</td><td><span id=""sitepath""" & Me.m_refContentApi.SitePath & "</span><input type=""textbox"" size=""30"" readonly=""true"" id=""entry_image"" name=""entry_image"" value=""" & strImage & """ /> <a href=""#"" onclick=""PopUpWindow('../mediamanager.aspx?scope=images&upload=true&retfield=entry_image&showthumb=false&autonav=" & catalog_data.Id & "', 'Meadiamanager', 790, 580, 1,1);return false;"">Change</a>&nbsp;<a href=""#"" onclick=""RemoveEntryImage('" & m_refContentApi.AppImgPath & "spacer.gif');return false"">Remove</a></td></tr><tr><td colomnspan=""2""><img id=""entry_image_thumb"" src=""" & strThumbnailPath & """ /></td></tr></table></fieldset>")
            }
            else
            {
                // sbResult.Append("<fieldset><legend>Image Data:</legend><table><tr><td class=""info"" align=""left"">Image:</td><td><span id=""sitepath""" & Me.m_refContentApi.SitePath & "</span><input type=""textbox"" size=""30"" readonly=""true"" id=""entry_image"" name=""entry_image"" value=""" & strImage & """ /> <a href=""#"" onclick=""PopUpWindow('../mediamanager.aspx?scope=images&upload=true&retfield=entry_image&showthumb=false&autonav=" & catalog_data.Id & "', 'Meadiamanager', 790, 580, 1,1);return false;"">Change</a>&nbsp;<a href=""#"" onclick=""RemoveEntryImage('" & m_refContentApi.AppImgPath & "spacer.gif');return false"">Remove</a></td></tr><tr><td colomnspan=""2""><img id=""entry_image_thumb"" src=""" & m_refContentApi.AppImgPath & "spacer.gif"" /></td></tr></table></fieldset>")
            }

            if (this.m_sEditAction == "addlang")
            {
                sbResult.Append("<input type=\"hidden\" id=\"entry_image\" name=\"entry_image\" value=\"" + entry_edit_data.Image + "\" />");
            }

            strAttrResult = (string)(sbAttrib.ToString().Trim());
            strAttrResult = strAttrResult.Replace("src=\"java/", "src=\"../java/");
            strAttrResult = strAttrResult.Replace("src=\"images/", "src=\"../images/");

            strResult = sbResult.ToString().Trim();
            strResult = Util_FixPath(strResult);
            strResult = strResult.Replace("src=\"java/", "src=\"../java/");
            strResult = strResult.Replace("src=\"images/", "src=\"../images/");

            ltr_meta.Text = strResult;
            ltr_attrib.Text = strAttrResult;
        }
Exemplo n.º 3
0
    private StringBuilder CaptureMetadata(long contentId, long folderId)
    {
        StringBuilder metadataOutput = new StringBuilder();
        ContentAPI myContentAPI = new ContentAPI();
        ContentData myContentEditData = new ContentData();
        ContentMetaData[] myContentMetadata;
        string myType = "update";
        int myCounter = 0;
        Ektron.Cms.Site.EkSite myEkSite = new Ektron.Cms.Site.EkSite();

        int ContentLanguage = EkConstants.CONTENT_LANGUAGES_UNDEFINED;

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

        if (ContentLanguage == EkConstants.CONTENT_LANGUAGES_UNDEFINED)
        {
            myContentAPI.ContentLanguage = EkConstants.ALL_CONTENT_LANGUAGES;
        }
        else
        {
            myContentAPI.ContentLanguage = ContentLanguage;
        }

        if (contentId != -1)
        {
            myEkSite = myContentAPI.EkSiteRef;
            myContentEditData = myContentAPI.GetContentById(contentId, 0);
            myContentMetadata = myContentEditData.MetaData;

            if (myContentMetadata.Length > 0)
            {
                metadataOutput = Ektron.Cms.CustomFields.WriteFilteredMetadataForEdit(myContentMetadata, false, myType, folderId, ref myCounter, myEkSite.GetPermissions(folderId, 0, "folder"));
                if (metadataOutput.Length > 0)
                {
                    ltrShowMetadata.Text = "<li><a id=\"metadataAnchor\" href=\"#\" onclick=\"dmsMetadataShowHideCategory(\'metadata\');return false;\" title=\"View Metadata\" class=\"selected\">" + myContentAPI.EkMsgRef.GetMessage("metadata text") + "</a></li>";
                }
            }
        }

        return metadataOutput;
    }