public static string RenderPopupLink(string actionConfigPagePathKey, string actionDefaultPagePath, NameValueCollection actionPageParams, CmsPage linkTargetPage, CmsLanguage langToRenderFor, string linkText, int popupWidth, int popupHeight)
            {
                string actionPagePath = CmsConfig.getConfigValue(actionConfigPagePathKey, actionDefaultPagePath);

                actionPageParams.Add("target", linkTargetPage.ID.ToString());
                string toggleEditUrl = CmsContext.getUrlByPagePath(actionPagePath, actionPageParams, langToRenderFor);

                return("<a href=\"" + toggleEditUrl + "\" onclick=\"EditMenuShowModal(this.href," + popupWidth + "," + popupHeight + "); return false;\">" + linkText + "</a>");
            }
            public static string RenderLink(string actionConfigPagePathKey, string actionDefaultPagePath, NameValueCollection actionPageParams, CmsPage linkTargetPage, CmsLanguage langToRenderFor, string linkText)
            {
                string actionPagePath = CmsConfig.getConfigValue(actionConfigPagePathKey, actionDefaultPagePath);

                actionPageParams.Add("target", linkTargetPage.ID.ToString());
                string toggleEditUrl = CmsContext.getUrlByPagePath(actionPagePath, actionPageParams, langToRenderFor);

                return("<a href=\"" + toggleEditUrl + "\">" + linkText + "</a>");
            }
            public static string Logoff(CmsPageEditMenuAction action, CmsPage pageToRenderFor, CmsLanguage langToRenderFor)
            {
                string actionPagePath         = CmsConfig.getConfigValue("LoginPath", "/_login");
                NameValueCollection paramList = new NameValueCollection();

                paramList.Add("action", "logoff");
                string actionUrl = CmsContext.getUrlByPagePath(actionPagePath, paramList, langToRenderFor);

                return("<a href=\"" + actionUrl + "\"><strong>Logoff</strong></a>");
            }
            public static string ExitFromEditing(CmsPageEditMenuAction action, CmsPage pageToRenderFor, CmsLanguage langToRenderFor)
            {
                // return RenderLink("GotoEditModePath", "/_admin/action/gotoView", pageToRenderFor, langToRenderFor, "<strong>Exit from editing</strong>");

                NameValueCollection paramList = new NameValueCollection();

                paramList.Add("target", pageToRenderFor.ID.ToString());
                string url = CmsContext.getUrlByPagePath(CmsConfig.getConfigValue("GotoViewModePath", "/_admin/action/gotoView"), paramList, langToRenderFor);

                return("<input type=\"button\" onclick=\"window.location = '" + url + "';\" value=\"Exit from editing\">");
            }
            public static string RemoveEditLock(CmsPageEditMenuAction action, CmsPage pageToRenderFor, CmsLanguage langToRenderFor)
            {
                CmsPageLockData     lockData  = pageToRenderFor.getCurrentPageLockData();
                NameValueCollection paramList = new NameValueCollection();
                StringBuilder       html      = new StringBuilder();

                // -- Kill lock link
                if (lockData.LockedByUsername == CmsContext.currentWebPortalUser.UserName || CmsContext.currentUserIsSuperAdmin)
                {
                    paramList.Clear();
                    paramList.Add("target", pageToRenderFor.ID.ToString());
                    paramList.Add("action", "logoff");
                    string killLockLink = CmsContext.getUrlByPagePath(CmsConfig.getConfigValue("KillLockPath", "/_admin/actions/killLock"), paramList);
                    html.Append("<a href=\"#\" onclick=\"EditMenuConfirmModal('Do you really want to remove the edit lock?','" + killLockLink + "',300, 300);\"><strong>Remove</strong> edit lock</a><br />");
                }
                return(html.ToString());
            }
            public static string DeleteThisPage(CmsPageEditMenuAction action, CmsPage pageToRenderFor, CmsLanguage langToRenderFor)
            {
                NameValueCollection paramList = new NameValueCollection();

                paramList.Add("target", pageToRenderFor.ID.ToString());

                string confirmText      = "Do you really want to delete this page?";
                int    numPagesToDelete = pageToRenderFor.getLinearizedPages().Keys.Count;

                if (numPagesToDelete > 1)
                {
                    confirmText = "Do you really want to delete this page and all " + (numPagesToDelete - 1) + " sub-pages?";
                }

                string deletePageUrl = CmsContext.getUrlByPagePath(CmsConfig.getConfigValue("DeletePagePath", "/_admin/actions/deletePage"), paramList, langToRenderFor);

                return("<a href=\"#\" onclick=\"EditMenuConfirmModal('" + confirmText + "','" + deletePageUrl + "',300, 300);\"><strong>Delete</strong> this page</a>");
            }