/// <summary>Defines a toolbar link.</summary>
 /// <param name="title">The text displayed in the toolbar.</param>
 /// <param name="name">The name of this plugin (must be unique).</param>
 /// <param name="urlFormat">The url format for the url for this plugin where {selected} is the rewritten url of the currently selected item, {memory} is a cut or copied page url {action} is either move or copy.</param>
 /// <param name="area">The area to put the link.</param>
 /// <param name="target">The target of the link.</param>
 /// <param name="iconUrl">An url to an icon.</param>
 /// <param name="sortOrder">The order of this link</param>
 public ToolbarPluginAttribute(string title, string name, string urlFormat, ToolbarArea area, string target, string iconUrl, int sortOrder)
     : this(title, name, urlFormat, area)
 {
     Target    = target;
     IconUrl   = iconUrl;
     SortOrder = sortOrder;
 }
示例#2
0
 /// <summary>Defines a toolbar link.</summary>
 /// <param name="title">The text displayed in the toolbar.</param>
 /// <param name="name">The name of this plugin (must be unique).</param>
 /// <param name="urlFormat">The url format for the url for this plugin where {selected} is the rewritten url of the currently selected item, {memory} is a cut or copied page url {action} is either move or copy.</param>
 /// <param name="area">The area to put the link.</param>        
 /// <param name="target">The target of the link.</param>    
 /// <param name="iconUrl">An url to an icon.</param>
 /// <param name="sortOrder">The order of this link</param>
 public ToolbarPluginAttribute(string title, string name, string urlFormat, ToolbarArea area, string target, string iconUrl, int sortOrder)
     : this(title, name, urlFormat, area)
 {
     Target = target;
     IconUrl = iconUrl;
     SortOrder = sortOrder;
 } 
 /// <summary>Defines a toolbar link.</summary>
 /// <param name="title">The text displayed in the toolbar.</param>
 /// <param name="name">The name of this plugin (must be unique).</param>
 /// <param name="urlFormat">The url format for the url for this plugin where {selected} is the rewritten url of the currently selected item, {memory} is a cut or copied page url {action} is either move or copy.</param>
 /// <param name="area">The area to put the link.</param>
 public ToolbarPluginAttribute(string title, string name, string urlFormat, ToolbarArea area)
 {
     Title     = title;
     Name      = name;
     UrlFormat = urlFormat;
     Area      = area;
 }
示例#4
0
 /// <summary>Defines a toolbar link.</summary>
 /// <param name="title">The text displayed in the toolbar.</param>
 /// <param name="name">The name of this plugin (must be unique).</param>
 /// <param name="urlFormat">The url format for the url for this plugin where {selected} is the rewritten url of the currently selected item, {memory} is a cut or copied page url {action} is either move or copy.</param>
 /// <param name="area">The area to put the link.</param>        
 public ToolbarPluginAttribute(string title, string name, string urlFormat, ToolbarArea area)
 {
     Title = title;
     Name = name;
     UrlFormat = urlFormat;
     Area = area;
 }
示例#5
0
        protected string GetRefreshScript(ContentItem item, ToolbarArea area)
        {
            string format;

            if (area == ToolbarArea.Both)
            {
                format = RefreshBothFormat;
            }
            else if (area == ToolbarArea.Preview)
            {
                format = RefreshPreviewFormat;
            }
            else
            {
                format = RefreshNavigationFormat;
            }

            string script = string.Format(format,
                                          Engine.ManagementPaths.GetEditInterfaceUrl(), // 0
                                          GetNavigationUrl(item),                       // 1
                                          GetPreviewUrl(item),                          // 2
                                          item.ID,                                      // 3
                                          item.Path,                                    // 4
                                          NodeAdapter(item).GetMaximumPermission(item)
                                          );

            return(script);
        }
示例#6
0
		/// <summary>Referesh the selected frames after loading the page.</summary>
		/// <param name="item"></param>
		/// <param name="area"></param>
		public static void RefreshFrames(this Page page, ContentItem item, ToolbarArea area, bool force = true)
		{
			string script = GetRefreshFramesScript(page, item, area, force);

			page.ClientScript.RegisterClientScriptBlock(
				typeof(EditExtensions),
				"RefreshFramesScript",
				script, true);
		}
示例#7
0
        /// <summary>Referesh the selected frames after loading the page.</summary>
        /// <param name="item"></param>
        /// <param name="area"></param>
        public static void RefreshFrames(this Page page, ContentItem item, ToolbarArea area, bool force = true)
        {
            string script = GetRefreshFramesScript(page, item, area, force);

            page.ClientScript.RegisterClientScriptBlock(
                typeof(EditExtensions),
                "RefreshFramesScript",
                script, true);
        }
示例#8
0
        /// <summary>Referesh the selected frames after loading the page.</summary>
        /// <param name="item"></param>
        /// <param name="area"></param>
        protected virtual void Refresh(ContentItem item, ToolbarArea area)
        {
            string script = GetRefreshScript(item, area);

            ClientScript.RegisterClientScriptBlock(
                typeof(EditPage),
                "RefreshFramesScript",
                script, true);
        }
示例#9
0
        public static string GetRefreshFramesScript(this Page page, ContentItem item, ToolbarArea area, bool force = true)
        {
            var engine = N2.Context.Current;

            string format;
            if (area == ToolbarArea.Both)
                format = EditExtensions.RefreshBothFormat;
            else if (area == ToolbarArea.Preview)
                format = RefreshPreviewFormat;
            else
                format = RefreshNavigationFormat;

            string script = string.Format(format,
                engine.ManagementPaths.GetEditInterfaceUrl(), // 0
                engine.ManagementPaths.GetNavigationUrl(item), // 1
                GetPreviewUrl(page, engine, item), // 2
                item.ID, // 3
                item.Path, // 4
                engine.ResolveAdapter<NodeAdapter>(item).GetMaximumPermission(item), // 5
                force.ToString().ToLower() // 6
                );
            return script;
        }
示例#10
0
 protected string GetRefreshScript(ContentItem item, ToolbarArea area, bool force = true)
 {
     return(Page.GetRefreshFramesScript(item, area, force));
 }
示例#11
0
 /// <summary>Referesh the selected frames after loading the page.</summary>
 /// <param name="item"></param>
 /// <param name="area"></param>
 protected virtual void Refresh(ContentItem item, ToolbarArea area, bool force = true)
 {
     Page.RefreshFrames(item, area, force);
 }
示例#12
0
        public static string GetRefreshFramesScript(this Page page, ContentItem item, ToolbarArea area, bool force = true)
        {
            var engine = N2.Context.Current;

            string format;

            if (area == ToolbarArea.Both)
            {
                format = EditExtensions.RefreshBothFormat;
            }
            else if (area == ToolbarArea.Preview)
            {
                format = RefreshPreviewFormat;
            }
            else
            {
                format = RefreshNavigationFormat;
            }

            string script = string.Format(format,
                                          engine.ManagementPaths.GetEditInterfaceUrl(),                         // 0
                                          engine.ManagementPaths.GetNavigationUrl(item),                        // 1
                                          GetPreviewUrl(page, engine, item),                                    // 2
                                          item.ID,                                                              // 3
                                          item.Path,                                                            // 4
                                          engine.ResolveAdapter <NodeAdapter>(item).GetMaximumPermission(item), // 5
                                          force.ToString().ToLower(),                                           // 6
                                          item.VersionIndex,
                                          item.GetVersionKey()
                                          );

            return(script);
        }
示例#13
0
 /// <summary>Referesh the selected frames after loading the page.</summary>
 /// <param name="item"></param>
 /// <param name="area"></param>
 protected virtual void Refresh(ContentItem item, ToolbarArea area, bool force = true)
 {
     Page.RefreshFrames(item, area, force);
 }