allow the config file to add article edit menu items
authorTony Cook <tony@develop-help.com>
Thu, 25 Aug 2011 04:27:56 +0000 (14:27 +1000)
committerTony Cook <tony@develop-help.com>
Thu, 25 Aug 2011 04:27:56 +0000 (14:27 +1000)
MANIFEST
site/docs/config.pod
site/templates/admin/edit_1.tmpl
site/templates/admin/include/article_menu.tmpl [new file with mode: 0644]

index 32a9340..386538e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -521,6 +521,7 @@ site/templates/admin/filelist.tmpl
 site/templates/admin/grouplist.tmpl
 site/templates/admin/helpicon.tmpl     Help icon template for admin templates
 site/templates/admin/image_edit.tmpl   Edit a single image
+site/templates/admin/include/article_menu.tmpl
 site/templates/admin/include/auditentry.tmpl
 site/templates/admin/include/audithead.tmpl
 site/templates/admin/include/edit_common.tmpl
index e1a33b4..d493745 100644 (file)
@@ -2565,6 +2565,43 @@ name - name of the article category.
 Other keys may be used as desired, eg. to make it simpler to configure
 article behaviour based on the category.
 
+=head2 [article menu]
+
+This section can be used to add new menu items to the menu displayed
+on article edit pages.
+
+The keys are used for sorting only.
+
+The value is comma-separated:
+
+=over
+
+=item *
+
+target script name
+
+=item *
+
+target identifier, to be set to 1 on making a request to the script.
+
+=item *
+
+the label for the item in the menu.
+
+=back
+
+eg.
+
+  sample,a_foo,Sample Item
+
+will generate a link like:
+
+  <a href="/cgi-bin/admin/sample.pl?id=10&amp;a_foo=1">Sample Item</a>
+
+where 10 is the id of the article being edited.
+
+Keys with a prefix of C<bse_> are reserved for BSE internal use.
+
 =head1 AUTHOR
 
 Tony Cook <tony@develop-help.com>
index 14716e2..7f8aadc 100644 (file)
@@ -3,16 +3,7 @@
 <:if Message:> 
 <div id="message" <:ifError:>class="error"<:or:><:eif:>><:message:></div>
 <:or Message:><:eif Message:> 
-<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifNew:><:or:><:if Eq
-   [article id] [cfg articles shop]:><a href="<:article admin:>">See shop</a><:or
-    Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
-  <:if Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/shopadmin.pl">Manage
-   catalogs</a> |<:or Eq:><:eif Eq:><:if New:><:or New:> <a href="<:script:>?id=<:article id:>&amp;_t=steps">Manage
-    step children/parents</a> | 
-<a href="<:script:>?id=<:article id:>&amp;_t=groups">Manage access</a> |
-<a href="<:script:>?id=<:article id:>&amp;_t=img"><b>Manage Images</b></a> |
-<a href="<:script:>?id=<:article id:>&amp;_t=file"><b>Manage Files</b></a> |
-<:eif New:></p>
+<:include admin/include/article_menu.tmpl:>
 
   <h2><:articleType:> Details</h2>
 
diff --git a/site/templates/admin/include/article_menu.tmpl b/site/templates/admin/include/article_menu.tmpl
new file mode 100644 (file)
index 0000000..30695e5
--- /dev/null
@@ -0,0 +1,17 @@
+<p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | <:ifNew:><:or:><:if Eq
+   [article id] [cfg articles shop]:><a href="<:article admin:>">See shop</a><:or
+    Eq:><a href="<:article admin:>">See article</a><:eif Eq:> | <:eif:><:editParent:> 
+  <:if Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/shopadmin.pl">Manage
+   catalogs</a> |<:or Eq:><:eif Eq:><:if New:><:or New:> <a href="<:script:>?id=<:article id:>&amp;_t=steps">Manage
+    step children/parents</a> | 
+<a href="<:script:>?id=<:article id:>&amp;_t=groups">Manage access</a> |
+<a href="<:script:>?id=<:article id:>&amp;_t=img">Manage Images</a> |
+<a href="<:script:>?id=<:article id:>&amp;_t=file">Manage Files</a> |
+<:iterator begin cfgsection "article menu" sort=key:>
+<:if Match [cfgentry value] "^\w+,[^,]*,.+$" :>
+<a href="<:adminurl [match [cfgentry value] "^(\w+),[^,]*,.*$" $1] id [article id]:><:match [cfgentry value] "^\w+,([^,]+)," "&$1=1":>"><:match [cfgentry value] "^\w+,[^,]*,(.*)$" $1:></a> |
+<:or Match:>
+Bad [article menu] value "<:cfgentry value:>" for key "<:cfgentry key:>".
+<:eif Match:>
+<:iterator end cfgsection:>
+<:eif New:></p>