Example #1
0
        protected virtual IDictionary <string, MetaInfo> GetMetaInformation(ContentItem item)
        {
            var mi = new Dictionary <string, MetaInfo>();

            if (Languages.IsLanguageRoot(item) && Languages.GetLanguage(item) != null)
            {
                mi["language"] = new MetaInfo {
                    Text = Languages.GetLanguage(item).LanguageCode
                }
            }
            ;

            if (!item.IsPage)
            {
                mi["zone"] = new MetaInfo {
                    Text = item.ZoneName
                }
            }
            ;

            if (!item.Visible)
            {
                mi["hidden"] = new MetaInfo {
                    Text = "", ToolTip = "Hidden"
                }
            }
            ;

            if (item.AlteredPermissions != Permission.None && item.AuthorizedRoles != null && item.AuthorizedRoles.Count > 0)
            {
                mi["locked"] = new MetaInfo {
                    Text = "", ToolTip = "Locked"
                }
            }
            ;

            if (Host.IsStartPage(item))
            {
                mi["authority"] = new MetaInfo {
                    Text = string.IsNullOrEmpty(Host.GetSite(item).Authority) ? "*" : Host.GetSite(item).Authority
                }
            }
            ;

            if (item.Parent == null)
            {
                mi["root"] = new MetaInfo {
                    Text = ""
                }
            }
            ;

            var draftInfo = Drafts.GetDraftInfo(item);

            if (draftInfo != null && draftInfo.Saved > item.Updated)
            {
                mi["draft"] = new MetaInfo {
                    Text = "&nbsp;", ToolTip = draftInfo.SavedBy + ": " + draftInfo.Saved
                }
            }
            ;

            if (item is ISystemNode)
            {
                mi["system"] = new MetaInfo {
                    ToolTip = Definitions.GetDefinition(item).Title
                }
            }
            ;

            return(mi);
        }
Example #2
0
		protected virtual IDictionary<string, MetaInfo> GetMetaInformation(ContentItem item)
		{
			var mi = new Dictionary<string, MetaInfo>();

			if (Languages.IsLanguageRoot(item) && Languages.GetLanguage(item) != null)
				mi["language"] = new MetaInfo { Text = Languages.GetLanguage(item).LanguageCode };

			if (!item.IsPage)
				mi["zone"] = new MetaInfo { Text = item.ZoneName };

			if (!item.Visible)
				mi["hidden"] = new MetaInfo { Text = "", ToolTip = "Hidden" };

			if (item.AlteredPermissions != Permission.None && item.AuthorizedRoles != null && item.AuthorizedRoles.Count > 0)
				mi["locked"] = new MetaInfo { Text = "", ToolTip = "Locked" };

			if (Host.IsStartPage(item))
				mi["authority"] = new MetaInfo { Text = string.IsNullOrEmpty(Host.GetSite(item).Authority) ? "*" : Host.GetSite(item).Authority };

			if (item.Parent == null)
				mi["root"] = new MetaInfo { Text = "" };

			var draftInfo = Drafts.GetDraftInfo(item);
			if (draftInfo != null && draftInfo.Saved > item.Updated)
				mi["draft"] = new DraftMetaInfo(draftInfo);
			else if (item.State <= ContentState.Draft && item.VersionIndex == 0)
				mi["draft"] = new DraftMetaInfo(item);

			if (item is ISystemNode)
				mi["system"] = new MetaInfo { ToolTip = Definitions.GetDefinition(item).Title };

			return mi;
		}
Example #3
0
		protected virtual IDictionary<string, MetaInfo> GetMetaInformation(ContentItem item)
		{
			var mi = new Dictionary<string, MetaInfo>();

			if (Languages.IsLanguageRoot(item) && Languages.GetLanguage(item) != null)
				mi["language"] = new MetaInfo { Text = Languages.GetLanguage(item).LanguageCode };
			
			if(!item.IsPage)
				mi["zone"] = new MetaInfo { Text = item.ZoneName };

			if (Host.IsStartPage(item))
				mi["authority"] = new MetaInfo { Text = string.IsNullOrEmpty(Host.GetSite(item).Authority) ? "*" : Host.GetSite(item).Authority };

			if (item.Parent == null)
				mi["root"] = new MetaInfo { Text = "" };

			var draftInfo = Drafts.GetDraftInfo(item);
			if (draftInfo != null && draftInfo.Saved > item.Updated)
				mi["draft"] = new MetaInfo { Text = "&nbsp;", ToolTip = draftInfo.SavedBy + ": " + draftInfo.Saved };

			return mi;
		}