Esempio 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();
    }
Esempio n. 2
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");
        }
    }
Esempio n. 3
0
    //END: blog - SK
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        string fldid;
        m_refMsg = m_refAPI.EkMsgRef;
        m_sPage = Request.QueryString["page"];
        aprId = System.Convert.ToInt64(Request.QueryString["id"]);
        CurrentUserId = m_refAPI.UserId;
        SitePath = m_refAPI.SitePath;
        RegisterResources();

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

        if (Request.QueryString["content"] == "published")
        {
            m_cCont = m_refContent.GetContentByIDv2_0(aprId);
            toggle = "staged";
        }
        else
        {
            m_cCont = m_refContent.GetStagedContByIDv2_0(aprId);
            toggle = "published";
            if (m_cCont.Count == 0)
            {
                m_cCont = null;
                m_cCont = m_refContent.GetContentByIDv2_0(aprId);
                toggle = "staged";
                if (m_sPage == "workarea")
                {
                    Response.Redirect((string)("approval.aspx?action=viewApprovalList&id=" + Request.QueryString["fldid"]), false);
                }
                else
                {
                    Response.Write("<script language=\"Javascript\">" + "top.opener.location.reload(true);" + "top.close();" + "</script>");
                }
            }
        }
        m_meObj = m_refContent.CanIv2_0(aprId, "content");
        fldid = m_cCont["FolderID"].ToString();

        cApprovals = m_refContent.GetCurrentApprovalInfoByIDv1_1(aprId);

        m_TaskExists = m_refContent.DoesTaskExistForContent(Convert.ToInt64(m_cCont["ContentID"]));
        ViewContent();
    }