/// <summary>
    /// Initializes the control properties.
    /// </summary>
    protected void SetupControl()
    {
        if (StopProcessing)
        {
            // Do not process
        }
        else
        {
            var uinfo = MembershipContext.AuthenticatedUser;

            if (uinfo.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Admin) || !DisplayOnlyToGlobalAdministrator)
            {
                // Create new string builder for links
                StringBuilder sb = new StringBuilder();

                // Store current site name
                string curSiteName = SiteContext.CurrentSiteName;
                // Get default user name
                string queryStringKey  = (string.IsNullOrEmpty(DefaultUserName)) ? null : "?username="******"~/Admin/");
                    if (!string.IsNullOrEmpty(DefaultUserName))
                    {
                        url = URLHelper.AddParameterToUrl(url, "username", DefaultUserName);
                    }

                    sb.AppendFormat(CMSDeskText, string.Concat("<a href=\"", HTMLHelper.EncodeForHtmlAttribute(url), "\">", CMSDeskLinkText, "</a>"));

                    separatorNeeded = true;
                }

                // If edit document link is shown
                if (ShowEditDocumentLink && (!CheckPermissions || (uinfo.CheckPrivilegeLevel(UserPrivilegeLevelEnum.Editor, curSiteName) && CMSPage.IsUserAuthorizedPerContent() && (uinfo.IsAuthorizedPerDocument(DocumentContext.CurrentDocument, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Allowed))))
                {
                    // Check if separator needed
                    if (separatorNeeded)
                    {
                        sb.Append(" " + Separator + " ");
                    }

                    string url = HTMLHelper.EncodeForHtmlAttribute(DocumentUIHelper.GetDocumentEditUrl(DocumentContext.CurrentDocument.NodeID, DocumentContext.CurrentDocumentCulture.CultureCode));
                    if (PreferOnSiteEdit && PortalHelper.IsOnSiteEditingEnabled(CurrentSiteName))
                    {
                        url = UrlResolver.ResolveUrl(PortalHelper.OnSiteEditRelativeURL);

                        string retUrl = RequestContext.CurrentURL;
                        // handle default alias path
                        if ((ViewMode == CMS.PortalEngine.ViewModeEnum.LiveSite) && (URLRewritingContext.CurrentPageInfoSource == PageInfoSource.DefaultAliasPath))
                        {
                            string aliasPath = PageInfoProvider.GetDefaultAliasPath(RequestContext.CurrentDomain, SiteContext.CurrentSiteName);
                            if (!String.IsNullOrEmpty(aliasPath))
                            {
                                string query = URLHelper.GetQuery(retUrl);
                                retUrl = UrlResolver.ResolveUrl(DocumentURLProvider.GetUrl(aliasPath));
                                retUrl = URLHelper.AppendQuery(retUrl, query);
                            }
                        }

                        url = URLHelper.UpdateParameterInUrl(url, "editurl", HttpUtility.UrlEncode(retUrl));
                    }

                    sb.AppendFormat(EditDocumentText, string.Concat("<a href=\"", HTMLHelper.EncodeForHtmlAttribute(url), "\">", EditDocumentLinkText, "</a>"));
                }

                ltlAdminActions.Text = sb.ToString();
            }
        }
    }