Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Register the scripts
        ScriptHelper.RegisterLoader(Page);
        ScriptHelper.RegisterTooltip(Page);
        ScriptHelper.RegisterDialogScript(this);

        btnEditableContent.OnClientClick = "ShowEditableContent(); return false;";
        btnMessageBoards.OnClientClick   = "ShowMessageBoards(); return false;";
        btnForums.OnClientClick          = "ShowForums(); return false;";

        // Set default item value
        ctrlSiteSelectStyleSheet.AddDefaultRecord = false;
        ctrlSiteSelectStyleSheet.CurrentSelector.SpecialFields.AllowDuplicates = true;

        if (PortalContext.CurrentSiteStylesheet != null)
        {
            ctrlSiteSelectStyleSheet.CurrentSelector.SpecialFields.Add(new SpecialField {
                Text = GetString("general.defaultchoice"), Value = GetDefaultStylesheet()
            });
        }
        else
        {
            ctrlSiteSelectStyleSheet.CurrentSelector.AllowEmpty = true;
        }

        ctrlSiteSelectStyleSheet.ReturnColumnName = "StyleSheetID";
        ctrlSiteSelectStyleSheet.SiteId           = SiteContext.CurrentSiteID;

        if ((SiteContext.CurrentSite != null) && (usrOwner != null))
        {
            usrOwner.SetValue("SiteID", SiteContext.CurrentSite.SiteID);
        }

        int documentId = 0;

        StringBuilder script = new StringBuilder();

        TreeNode node = Node;

        if (node != null)
        {
            // Redirect to information page when no UI elements displayed
            if (((pnlUIAdvanced.IsHidden && pnlUICache.IsHidden && pnlUIDesign.IsHidden) || ShowContentOnlyProperties) && pnlUIOther.IsHidden && pnlUIOwner.IsHidden)
            {
                RedirectToUINotAvailable();
            }

            // Get strings for headings
            headOtherProperties.Text = ShowContentOnlyProperties ? GetString("content.ui.properties") : GetString("GeneralProperties.OtherGroup");

            if (PortalContext.CurrentSiteStylesheet != null)
            {
                script.Append(@"
var currentStyleSheetId;
// Function raised before opening the Edit dialog of the CSS style sheet control. When 'default' style sheet is chosen, translate this value to the default site style sheet id.
function US_GetEditedItemId_", ctrlSiteSelectStyleSheet.ValueElementID, @"(selectedValue) {
    currentStyleSheetId = selectedValue;
    if (selectedValue == ""default"") {
        return ", PortalContext.CurrentSiteStylesheet.StylesheetID, @";
    }

    return selectedValue;
}

// Function raised from New/Edit dialog after save action. When 'default' style is used, the new/edit dialog will try to choose a real style sheet id (which was edited), but it is necessary keep the selected value to be 'default'.
function US_GetNewItemId_", ctrlSiteSelectStyleSheet.ValueElementID, @"(newStyleSheetId) {
    if ((currentStyleSheetId == ""default"") && (newStyleSheetId == ", PortalContext.CurrentSiteStylesheet.StylesheetID, @")) {
        return currentStyleSheetId;
    }

    return newStyleSheetId;
}");
            }

            documentId   = node.DocumentID;
            canEditOwner = (MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.ModifyPermissions) == AuthorizationResultEnum.Allowed);
            ctrlSiteSelectStyleSheet.AliasPath = node.NodeAliasPath;

            ReloadData();

            // Check ad-hoc forum counts
            hasAdHocForum = (ModuleCommands.ForumsGetDocumentForumsCount(node.DocumentID) > 0);

            // Ad-Hoc message boards check
            hasAdHocBoard = (ModuleCommands.MessageBoardGetDocumentBoardsCount(node.DocumentID) > 0);

            script.Append("function ShowEditableContent() { modalDialog('", ResolveUrl("Advanced/EditableContent/default.aspx"), "?nodeid=", node.NodeID, "', 'EditableContent', '95%', '95%'); } \n");
        }

        // Generate executive script
        if (hasAdHocBoard)
        {
            plcAdHocBoards.Visible = true;
            script.Append("function ShowMessageBoards() { modalDialog('", ResolveUrl("~/CMSModules/MessageBoards/Content/Properties/default.aspx"), "?documentid=", documentId, "', 'MessageBoards', '95%', '95%'); } \n");
        }

        if (hasAdHocForum)
        {
            plcAdHocForums.Visible = true;
            script.Append("function ShowForums() { modalDialog('", ResolveUrl("~/CMSModules/Forums/Content/Properties/default.aspx"), "?documentid=", documentId, "', 'Forums', '95%', '95%'); } \n");
        }

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ModalDialogsToAdvancedSection", script.ToString(), true);

        // Reflect processing action
        pnlContent.Enabled = DocumentManager.AllowSave;

        if (chkCssStyle.Checked && (PortalContext.CurrentSiteStylesheet != null))
        {
            // Enable the edit button
            ctrlSiteSelectStyleSheet.ButtonEditEnabled = true;
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UIContext.PropertyTab = PropertyTabEnum.General;

        // Register the scripts
        ScriptHelper.RegisterProgress(Page);
        ScriptHelper.RegisterTooltip(Page);
        ScriptHelper.RegisterDialogScript(this);

        // Set user control properties
        usrOwner = Page.LoadUserControl("~/CMSModules/Membership/FormControls/Users/selectuser.ascx") as FormEngineUserControl;
        if (usrOwner != null)
        {
            usrOwner.ID         = "ctrlUsrOwner";
            usrOwner.IsLiveSite = false;
            usrOwner.SetValue("ShowSiteFilter", false);
            usrOwner.StopProcessing = pnlUIOwner.IsHidden;
            plcUsrOwner.Controls.Add(usrOwner);
        }

        // Init strings
        pnlDesign.GroupingText   = GetString("GeneralProperties.DesignGroup");
        pnlCache.GroupingText    = GetString("GeneralProperties.CacheGroup");
        pnlOther.GroupingText    = GetString("GeneralProperties.OtherGroup");
        pnlAdvanced.GroupingText = GetString("GeneralProperties.AdvancedGroup");
        pnlOwner.GroupingText    = GetString("GeneralProperties.OwnerGroup");

        // Advanced section
        mEditableContent = GetString("GeneralProperties.EditableContent");
        mForums          = GetString("PageProperties.AdHocForum");
        mMessageBoards   = GetString("PageProperties.MessageBoards");

        lnkEditableContent.OnClientClick = "ShowEditableContent(); return false;";
        lnkMessageBoards.OnClientClick   = "ShowMessageBoards(); return false;";
        lnkForums.OnClientClick          = "ShowForums(); return false;";

        imgEditableContent.ImageUrl = GetImageUrl("CMSModules/CMS_Content/EditableContent/editablecontent.png");
        imgMessageBoards.ImageUrl   = GetImageUrl("CMSModules/CMS_MessageBoards/module.png");
        imgForums.ImageUrl          = GetImageUrl("CMSModules/CMS_Forums/module.png");

        // Get strings for radio buttons
        lblCacheMinutes.Text = GetString("GeneralProperties.cacheMinutes");

        // Get strings for labels
        lblNameTitle.Text           = GetString("GeneralProperties.Name");
        lblNamePathTitle.Text       = GetString("GeneralProperties.NamePath");
        lblAliasPathTitle.Text      = GetString("GeneralProperties.AliasPath");
        lblTypeTitle.Text           = GetString("GeneralProperties.Type");
        lblNodeIDTitle.Text         = GetString("GeneralProperties.NodeID");
        lblLastModifiedByTitle.Text = GetString("GeneralProperties.LastModifiedBy");
        lblLastModifiedTitle.Text   = GetString("GeneralProperties.LastModified");
        lblLiveURLTitle.Text        = GetString("GeneralProperties.LiveURL");
        lblPreviewURLTitle.Text     = GetString("GeneralProperties.PreviewURL");
        lblGUIDTitle.Text           = GetString("GeneralProperties.GUID");
        lblDocGUIDTitle.Text        = GetString("GeneralProperties.DocumentGUID");
        lblDocIDTitle.Text          = GetString("GeneralProperties.DocumentID");
        lblCultureTitle.Text        = GetString("GeneralProperties.Culture");
        lblCreatedByTitle.Text      = GetString("GeneralProperties.CreatedBy");
        lblCreatedTitle.Text        = GetString("GeneralProperties.Created");
        lblOwnerTitle.Text          = GetString("GeneralProperties.Owner");
        lblCssStyle.Text            = GetString("PageProperties.CssStyle");
        lblPublishedTitle.Text      = GetString("PageProperties.Published");

        chkCssStyle.Text = GetString("Metadata.Inherit");
        pnlOnlineMarketing.GroupingText = GetString("general.onlinemarketing");

        // Set default item value
        string            defaultStyleSheet = "-1";
        CssStylesheetInfo cssInfo           = CMSContext.CurrentSiteStylesheet;

        // If current site default style sheet defined, choose it
        if (cssInfo != null)
        {
            defaultStyleSheet = "default";
        }
        ctrlSiteSelectStyleSheet.CurrentSelector.SpecialFields = new string[, ] {
            { GetString("general.defaultchoice"), defaultStyleSheet }
        };
        ctrlSiteSelectStyleSheet.ReturnColumnName = "StyleSheetID";
        ctrlSiteSelectStyleSheet.SiteId           = CMSContext.CurrentSiteID;

        if ((CMSContext.CurrentSite != null) && (usrOwner != null))
        {
            usrOwner.SetValue("SiteID", CMSContext.CurrentSite.SiteID);
        }

        int documentId = 0;

        string script = null;

        TreeNode node = Node;

        if (node != null)
        {
            // Create wireframe option
            if (node.NodeWireframeTemplateID <= 0)
            {
                mWireframe = GetString("Wireframe.Create");

                string createUrl = URLHelper.ResolveUrl(String.Format("~/CMSModules/Content/CMSDesk/Properties/CreateWireframe.aspx?nodeid={0}&culture={1}", node.NodeID, node.DocumentCulture));
                lnkWireframe.OnClientClick = "parent.location.replace('" + createUrl + "'); return false;";

                imgWireframe.ImageUrl = GetImageUrl("CMSModules/CMS_Content/EditMenu/createwireframe.png");
            }
            else
            {
                mWireframe            = GetString("Wireframe.Remove");
                imgWireframe.ImageUrl = GetImageUrl("CMSModules/CMS_Content/EditMenu/removewireframe.png");

                lnkWireframe.OnClientClick = "return confirm('" + GetString("Wireframe.ConfirmRemove") + "')";
                lnkWireframe.Click        += new EventHandler(lnkWireframe_Click);
            }

            plcWireframe.Visible = PortalHelper.IsWireframingEnabled(CMSContext.CurrentSiteName);

            documentId   = node.DocumentID;
            canEditOwner = (CMSContext.CurrentUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.ModifyPermissions) == AuthorizationResultEnum.Allowed);
            ctrlSiteSelectStyleSheet.AliasPath = node.NodeAliasPath;

            ReloadData();

            // Check ad-hoc forum counts
            hasAdHocForum = (ModuleCommands.ForumsGetDocumentForumsCount(node.DocumentID) > 0);

            // Ad-Hoc message boards check
            hasAdHocBoard = (ModuleCommands.MessageBoardGetDocumentBoardsCount(node.DocumentID) > 0);

            script += "function ShowEditableContent() { modalDialog('" + ResolveUrl("Advanced/EditableContent/default.aspx") + "?nodeid=" + node.NodeID + "', 'EditableContent', 1015, 700); } \n";
        }

        // Generate executive script
        if (hasAdHocBoard)
        {
            plcAdHocBoards.Visible = true;
            script += "function ShowMessageBoards() { modalDialog('" + ResolveUrl("~/CMSModules/MessageBoards/Content/Properties/default.aspx") + "?documentid=" + documentId + "', 'MessageBoards', 1020, 680); } \n";
        }

        if (hasAdHocForum)
        {
            plcAdHocForums.Visible = true;
            script += "function ShowForums() { modalDialog('" + ResolveUrl("~/CMSModules/Forums/Content/Properties/default.aspx") + "?documentid=" + documentId + "', 'Forums', 1130, 680); } \n";
        }

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ModalDialogsToAdvancedSection", ScriptHelper.GetScript(script));

        // Reflect processing action
        pnlContent.Enabled = DocumentManager.AllowSave;

        if (chkCssStyle.Checked)
        {
            // Enable the edit button
            ctrlSiteSelectStyleSheet.ButtonEditEnabled = true;
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SetPropertyTab(TAB_GENERAL);

        // Register the scripts
        ScriptHelper.RegisterLoader(Page);
        ScriptHelper.RegisterTooltip(Page);
        ScriptHelper.RegisterDialogScript(this);

        btnEditableContent.OnClientClick = "ShowEditableContent(); return false;";
        btnMessageBoards.OnClientClick   = "ShowMessageBoards(); return false;";
        btnForums.OnClientClick          = "ShowForums(); return false;";

        // Get strings for radio buttons
        lblCacheMinutes.Text = GetString("GeneralProperties.cacheMinutes");

        // Get strings for labels
        lblNameTitle.Text           = GetString("GeneralProperties.Name");
        lblNamePathTitle.Text       = GetString("GeneralProperties.NamePath");
        lblAliasPathTitle.Text      = GetString("GeneralProperties.AliasPath");
        lblTypeTitle.Text           = GetString("GeneralProperties.Type");
        lblNodeIDTitle.Text         = GetString("GeneralProperties.NodeID");
        lblLastModifiedByTitle.Text = GetString("GeneralProperties.LastModifiedBy");
        lblLastModifiedTitle.Text   = GetString("GeneralProperties.LastModified");
        lblLiveURLTitle.Text        = GetString("GeneralProperties.LiveURL");
        lblPreviewURLTitle.Text     = GetString("GeneralProperties.PreviewURL");
        lblGUIDTitle.Text           = GetString("GeneralProperties.GUID");
        lblDocGUIDTitle.Text        = GetString("GeneralProperties.DocumentGUID");
        lblDocIDTitle.Text          = GetString("GeneralProperties.DocumentID");
        lblCultureTitle.Text        = GetString("GeneralProperties.Culture");
        lblCreatedByTitle.Text      = GetString("GeneralProperties.CreatedBy");
        lblCreatedTitle.Text        = GetString("GeneralProperties.Created");
        lblOwnerTitle.Text          = GetString("GeneralProperties.Owner");
        lblCssStyle.Text            = GetString("PageProperties.CssStyle");
        lblPublishedTitle.Text      = GetString("PageProperties.Published");

        // Set default item value
        ctrlSiteSelectStyleSheet.AddDefaultRecord = false;
        ctrlSiteSelectStyleSheet.CurrentSelector.SpecialFields.AllowDuplicates = true;
        ctrlSiteSelectStyleSheet.CurrentSelector.SpecialFields.Add(new SpecialField {
            Text = GetString("general.defaultchoice"), Value = GetDefaultStylesheet()
        });

        ctrlSiteSelectStyleSheet.ReturnColumnName = "StyleSheetID";
        ctrlSiteSelectStyleSheet.SiteId           = SiteContext.CurrentSiteID;

        if ((SiteContext.CurrentSite != null) && (usrOwner != null))
        {
            usrOwner.SetValue("SiteID", SiteContext.CurrentSite.SiteID);
        }

        int documentId = 0;

        StringBuilder script = new StringBuilder();

        TreeNode node = Node;

        if (node != null)
        {
            if (PortalContext.CurrentSiteStylesheet != null)
            {
                script.Append(@"
var currentStyleSheetId;
// Function raised before opening the Edit dialog of the CSS style sheet control. When 'default' style sheet is chosen, translate this value to the default site style sheet id.
function US_GetEditedItemId_", ctrlSiteSelectStyleSheet.ValueElementID, @"(selectedValue) {
    currentStyleSheetId = selectedValue;
    if (selectedValue == ""default"") {
        return ", PortalContext.CurrentSiteStylesheet.StylesheetID, @";
    }

    return selectedValue;
}

// Function raised from New/Edit dialog after save action. When 'default' style is used, the new/edit dialog will try to choose a real style sheet id (which was edited), but it is necessary keep the selected value to be 'default'.
function US_GetNewItemId_", ctrlSiteSelectStyleSheet.ValueElementID, @"(newStyleSheetId) {
    if ((currentStyleSheetId == ""default"") && (newStyleSheetId == ", PortalContext.CurrentSiteStylesheet.StylesheetID, @")) {
        return currentStyleSheetId;
    }

    return newStyleSheetId;
}
"
                              );
            }

            // Create wireframe option
            if (node.NodeWireframeTemplateID <= 0)
            {
                btnWireframe.ResourceString = "Wireframe.Create";

                string createUrl = URLHelper.ResolveUrl(String.Format("~/CMSModules/Content/CMSDesk/Properties/CreateWireframe.aspx?nodeid={0}&culture={1}", node.NodeID, node.DocumentCulture));
                btnWireframe.OnClientClick = "parent.location.replace('" + createUrl + "'); return false;";
            }
            else
            {
                btnWireframe.ResourceString = "Wireframe.Remove";
                btnWireframe.OnClientClick  = "return confirm(" + ScriptHelper.GetLocalizedString("Wireframe.ConfirmRemove") + ")";
                btnWireframe.Click         += lnkWireframe_Click;
            }

            plcWireframe.Visible = PortalHelper.IsWireframingEnabled(SiteContext.CurrentSiteName);

            documentId   = node.DocumentID;
            canEditOwner = (MembershipContext.AuthenticatedUser.IsAuthorizedPerDocument(Node, NodePermissionsEnum.ModifyPermissions) == AuthorizationResultEnum.Allowed);
            ctrlSiteSelectStyleSheet.AliasPath = node.NodeAliasPath;

            ReloadData();

            // Check ad-hoc forum counts
            hasAdHocForum = (ModuleCommands.ForumsGetDocumentForumsCount(node.DocumentID) > 0);

            // Ad-Hoc message boards check
            hasAdHocBoard = (ModuleCommands.MessageBoardGetDocumentBoardsCount(node.DocumentID) > 0);

            script.Append("function ShowEditableContent() { modalDialog('", ResolveUrl("Advanced/EditableContent/default.aspx"), "?nodeid=", node.NodeID, "', 'EditableContent', '95%', '95%'); } \n");
        }

        // Generate executive script
        if (hasAdHocBoard)
        {
            plcAdHocBoards.Visible = true;
            script.Append("function ShowMessageBoards() { modalDialog('", ResolveUrl("~/CMSModules/MessageBoards/Content/Properties/default.aspx"), "?documentid=", documentId, "', 'MessageBoards', '95%', '95%'); } \n");
        }

        if (hasAdHocForum)
        {
            plcAdHocForums.Visible = true;
            script.Append("function ShowForums() { modalDialog('", ResolveUrl("~/CMSModules/Forums/Content/Properties/default.aspx"), "?documentid=", documentId, "', 'Forums', '95%', '95%'); } \n");
        }

        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ModalDialogsToAdvancedSection", script.ToString(), true);

        // Reflect processing action
        pnlContent.Enabled = DocumentManager.AllowSave;

        if (chkCssStyle.Checked && (PortalContext.CurrentSiteStylesheet != null))
        {
            // Enable the edit button
            ctrlSiteSelectStyleSheet.ButtonEditEnabled = true;
        }
    }
Beispiel #4
0
    private void ReloadData()
    {
        if (node != null)
        {
            // Check read permissions
            if (CMSContext.CurrentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Read) == AuthorizationResultEnum.Denied)
            {
                RedirectToAccessDenied(String.Format(GetString("cmsdesk.notauthorizedtoreaddocument"), node.NodeAliasPath));
            }
            else
            {
                // Log activities checkboxes
                if (!RequestHelper.IsPostBack())
                {
                    bool?logVisit = node.DocumentLogVisitActivity;
                    chkLogPageVisit.Checked     = (logVisit == true);
                    chkPageVisitInherit.Checked = (logVisit == null);
                    chkLogPageVisit.Enabled     = !chkPageVisitInherit.Checked;
                    if (logVisit == null)
                    {
                        chkPageVisitInherit_CheckedChanged(null, EventArgs.Empty);
                    }
                }

                // Show document group owner selector
                if (ModuleEntry.IsModuleLoaded(ModuleEntry.COMMUNITY) && canEditOwner && LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.Groups))
                {
                    plcOwnerGroup.Controls.Clear();
                    // Initialize table
                    TableRow  rowOwner     = new TableRow();
                    TableCell cellTitle    = new TableCell();
                    TableCell cellSelector = new TableCell();

                    // Initialize caption
                    LocalizedLabel lblOwnerGroup = new LocalizedLabel();
                    lblOwnerGroup.EnableViewState = false;
                    lblOwnerGroup.ResourceString  = "community.group.documentowner";
                    lblOwnerGroup.ID = "lblOwnerGroup";
                    cellTitle.Controls.Add(lblOwnerGroup);

                    // Initialize selector
                    fcDocumentGroupSelector                = (FormEngineUserControl)Page.LoadControl("~/CMSAdminControls/UI/Selectors/DocumentGroupSelector.ascx");
                    fcDocumentGroupSelector.ID             = "fcDocumentGroupSelector";
                    fcDocumentGroupSelector.StopProcessing = this.pnlUIOwner.IsHidden;
                    cellSelector.Controls.Add(fcDocumentGroupSelector);
                    fcDocumentGroupSelector.Value = ValidationHelper.GetInteger(node.GetValue("NodeGroupID"), 0);
                    fcDocumentGroupSelector.SetValue("siteid", CMSContext.CurrentSiteID);
                    fcDocumentGroupSelector.SetValue("nodeid", nodeId);

                    // Add controls to containers
                    rowOwner.Cells.Add(cellTitle);
                    rowOwner.Cells.Add(cellSelector);
                    plcOwnerGroup.Controls.Add(rowOwner);
                    plcOwnerGroup.Visible = true;
                }

                // Check modify permissions
                if (CMSContext.CurrentUser.IsAuthorizedPerDocument(node, NodePermissionsEnum.Modify) == AuthorizationResultEnum.Denied)
                {
                    // disable form editing
                    DisableFormEditing();

                    // show access denied message
                    lblInfo.Text    = String.Format(GetString("cmsdesk.notauthorizedtoeditdocument"), node.NodeAliasPath);
                    lblInfo.Visible = true;
                }

                // Show owner editing only when authorized to change the permissions
                if (canEditOwner)
                {
                    lblOwner.Visible = false;
                    usrOwner.Visible = true;
                    usrOwner.SetValue("AdditionalUsers", new int[] { node.NodeOwner });
                }
                else
                {
                    usrOwner.Visible = false;
                }

                if (!RequestHelper.IsPostBack())
                {
                    if (canEditOwner)
                    {
                        usrOwner.Value = node.GetValue("NodeOwner");
                    }

                    // Search
                    chkExcludeFromSearch.Checked = node.DocumentSearchExcluded;
                }

                // Load the data
                lblName.Text      = HttpUtility.HtmlEncode(node.DocumentName);
                lblNamePath.Text  = HttpUtility.HtmlEncode(Convert.ToString(node.GetValue("DocumentNamePath")));
                lblAliasPath.Text = Convert.ToString(node.NodeAliasPath);
                string typeName = DataClassInfoProvider.GetDataClass(node.NodeClassName).ClassDisplayName;
                lblType.Text   = HttpUtility.HtmlEncode(ResHelper.LocalizeString(typeName));
                lblNodeID.Text = Convert.ToString(node.NodeID);

                // Modifier
                SetUserLabel(lblLastModifiedBy, "DocumentModifiedByUserId");

                // Get modified time
                TimeZoneInfo usedTimeZone = null;
                DateTime     lastModified = ValidationHelper.GetDateTime(node.GetValue("DocumentModifiedWhen"), DateTimeHelper.ZERO_TIME);
                lblLastModified.Text = TimeZoneHelper.GetCurrentTimeZoneDateTimeString(lastModified, CMSContext.CurrentUser, CMSContext.CurrentSite, out usedTimeZone);
                ScriptHelper.AppendTooltip(lblLastModified, TimeZoneHelper.GetGMTLongStringOffset(usedTimeZone), "help");

                if (!canEditOwner)
                {
                    // Owner
                    SetUserLabel(lblOwner, "NodeOwner");
                }

                // Creator
                SetUserLabel(lblCreatedBy, "DocumentCreatedByUserId");
                DateTime createdWhen = ValidationHelper.GetDateTime(node.GetValue("DocumentCreatedWhen"), DateTimeHelper.ZERO_TIME);
                lblCreated.Text = TimeZoneHelper.GetCurrentTimeZoneDateTimeString(createdWhen, CMSContext.CurrentUser, CMSContext.CurrentSite, out usedTimeZone);
                ScriptHelper.AppendTooltip(lblCreated, TimeZoneHelper.GetGMTLongStringOffset(usedTimeZone), "help");


                // URL
                string liveUrl = node.IsLink ? CMSContext.GetUrl(node.NodeAliasPath, null) : CMSContext.GetUrl(node.NodeAliasPath, node.DocumentUrlPath);
                lnkLiveURL.Text        = ResolveUrl(liveUrl);
                lnkLiveURL.NavigateUrl = liveUrl;

                bool isRoot = (node.NodeClassName.ToLower() == "cms.root");

                // Preview URL
                if (!isRoot)
                {
                    plcPreview.Visible = true;
                    string path = canEdit ? "/CMSModules/CMS_Content/Properties/resetlink.png" : "/CMSModules/CMS_Content/Properties/resetlinkdisabled.png";
                    btnResetPreviewGuid.ImageUrl      = GetImageUrl(path);
                    btnResetPreviewGuid.ToolTip       = GetString("GeneralProperties.InvalidatePreviewURL");
                    btnResetPreviewGuid.ImageAlign    = ImageAlign.AbsBottom;
                    btnResetPreviewGuid.Click        += new ImageClickEventHandler(btnResetPreviewGuid_Click);
                    btnResetPreviewGuid.OnClientClick = "if(!confirm('" + GetString("GeneralProperties.GeneratePreviewURLConf") + "')){return false;}";

                    InitPreviewUrl();
                }

                lblGUID.Text    = Convert.ToString(node.NodeGUID);
                lblDocGUID.Text = (node.DocumentGUID == Guid.Empty) ? ResHelper.Dash : node.DocumentGUID.ToString();
                lblDocID.Text   = Convert.ToString(node.DocumentID);

                // Culture
                CultureInfo ci = CultureInfoProvider.GetCultureInfo(node.DocumentCulture);
                lblCulture.Text = ((ci != null) ?  ResHelper.LocalizeString(ci.CultureName) : node.DocumentCulture);

                lblPublished.Text = (node.IsPublished ? "<span class=\"DocumentPublishedYes\">" + GetString("General.Yes") + "</span>" : "<span class=\"DocumentPublishedNo\">" + GetString("General.No") + "</span>");

                if (!RequestHelper.IsPostBack())
                {
                    // Init radio buttons for cache settings
                    if (isRoot)
                    {
                        radInherit.Visible  = false;
                        chkCssStyle.Visible = false;
                        switch (node.NodeCacheMinutes)
                        {
                        case -1:
                            // Cache is off
                            radNo.Checked        = true;
                            radYes.Checked       = false;
                            radInherit.Checked   = false;
                            txtCacheMinutes.Text = "";
                            break;

                        case 0:
                            // Cache is off
                            radNo.Checked        = true;
                            radYes.Checked       = false;
                            radInherit.Checked   = false;
                            txtCacheMinutes.Text = "";
                            break;

                        default:
                            // Cache is enabled
                            radNo.Checked        = false;
                            radYes.Checked       = true;
                            radInherit.Checked   = false;
                            txtCacheMinutes.Text = node.NodeCacheMinutes.ToString();
                            break;
                        }
                    }
                    else
                    {
                        switch (node.NodeCacheMinutes)
                        {
                        case -1:
                            // Cache setting is inherited
                            radNo.Checked        = false;
                            radYes.Checked       = false;
                            radInherit.Checked   = true;
                            txtCacheMinutes.Text = "";
                            break;

                        case 0:
                            // Cache is off
                            radNo.Checked        = true;
                            radYes.Checked       = false;
                            radInherit.Checked   = false;
                            txtCacheMinutes.Text = "";
                            break;

                        default:
                            // Cache is enabled
                            radNo.Checked        = false;
                            radYes.Checked       = true;
                            radInherit.Checked   = false;
                            txtCacheMinutes.Text = node.NodeCacheMinutes.ToString();
                            break;
                        }
                    }

                    if (!radYes.Checked)
                    {
                        txtCacheMinutes.Enabled = false;
                    }
                }


                if (!RequestHelper.IsPostBack())
                {
                    if (node.GetValue("DocumentStylesheetID") == null)
                    {
                        // If default site not exist edit is set to -1 - disabled
                        if (CMSContext.CurrentSiteStylesheet != null)
                        {
                            ctrlSiteSelectStyleSheet.Value = "default";
                        }
                        else
                        {
                            ctrlSiteSelectStyleSheet.Value = -1;
                        }
                    }
                    else
                    {
                        // If stylesheet is inherited from parent document
                        if (ValidationHelper.GetInteger(node.GetValue("DocumentStylesheetID"), 0) == -1)
                        {
                            if (!isRoot)
                            {
                                chkCssStyle.Checked = true;

                                // Get parent stylesheet
                                string value = PageInfoProvider.GetParentProperty(CMSContext.CurrentSite.SiteID, node.NodeAliasPath, "(DocumentStylesheetID <> -1 OR DocumentStylesheetID IS NULL) AND DocumentCulture = N'" + SqlHelperClass.GetSafeQueryString(node.DocumentCulture, false) + "'", "DocumentStylesheetID");

                                if (String.IsNullOrEmpty(value))
                                {
                                    // If default site stylesheet not exist edit is set to -1 - disabled
                                    if (CMSContext.CurrentSiteStylesheet != null)
                                    {
                                        ctrlSiteSelectStyleSheet.Value = "default";
                                    }
                                    else
                                    {
                                        ctrlSiteSelectStyleSheet.Value = -1;
                                    }
                                }
                                else
                                {
                                    // Set parent stylesheet to current document
                                    ctrlSiteSelectStyleSheet.Value = value;
                                }
                            }
                        }
                        else
                        {
                            ctrlSiteSelectStyleSheet.Value = node.GetValue("DocumentStylesheetID");
                        }
                    }
                }

                // Disable new button if document inherit stylesheet
                if (!isRoot && chkCssStyle.Checked)
                {
                    ctrlSiteSelectStyleSheet.Enabled           = false;
                    ctrlSiteSelectStyleSheet.ButtonNew.Enabled = false;
                }

                // Initialize Rating control
                RefreshCntRatingResult();

                double rating = 0.0f;
                if (node.DocumentRatings > 0)
                {
                    rating = node.DocumentRatingValue / node.DocumentRatings;
                }
                ratingControl.MaxRating     = 10;
                ratingControl.CurrentRating = rating;
                ratingControl.Visible       = true;
                ratingControl.Enabled       = false;

                // Initialize Reset button for rating
                btnResetRating.Text          = GetString("general.reset");
                btnResetRating.OnClientClick = "if (!confirm(" + ScriptHelper.GetString(GetString("GeneralProperties.ResetRatingConfirmation")) + ")) return false;";

                object[] param = new object[1];
                param[0] = node.DocumentID;

                // Check ad-hoc forum counts
                hasAdHocForum = (ModuleCommands.ForumsGetDocumentForumsCount(node.DocumentID) > 0);

                // Ad-Hoc message boards check
                hasAdHocBoard = (ModuleCommands.MessageBoardGetDocumentBoardsCount(node.DocumentID) > 0);

                plcAdHocForums.Visible = hasAdHocForum;
                plcAdHocBoards.Visible = hasAdHocBoard;
            }
        }
        else
        {
            btnResetRating.Visible = false;
        }
    }