aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/main.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-07-01 10:16:30 +0000
committerplegall <plg@piwigo.org>2011-07-01 10:16:30 +0000
commitc97377ea8700519ef7cbad77269ec533ddcad287 (patch)
tree297fab01d96f0bdc8acd0857670a35c25f6de33e /plugins/LocalFilesEditor/main.inc.php
parentd6ec70d97076bf487fee1ada58fe6130d922b7ef (diff)
feature 2372 added: shortcut to edit CSS file from the themes page. If plugin
LocalFiles Editor is active, a link "CSS" is displayed under each active theme and goes directly to the CSS edition page. git-svn-id: http://piwigo.org/svn/trunk@11586 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/LocalFilesEditor/main.inc.php')
-rw-r--r--plugins/LocalFilesEditor/main.inc.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/plugins/LocalFilesEditor/main.inc.php b/plugins/LocalFilesEditor/main.inc.php
index 74c4d5942..cc468ce41 100644
--- a/plugins/LocalFilesEditor/main.inc.php
+++ b/plugins/LocalFilesEditor/main.inc.php
@@ -46,6 +46,28 @@ function localfiles_admin_menu($menu)
return $menu;
}
-add_event_handler('get_admin_plugin_menu_links', 'localfiles_admin_menu');
+function localfiles_css_link()
+{
+ global $template;
+
+ $template->set_prefilter('themes', 'localfiles_css_link_prefilter');
+}
+function localfiles_css_link_prefilter($content, &$smarty)
+{
+ $search = '#{if isset\(\$theme.admin_uri\)}.*?{/if}#s';
+ $replacement = '
+{if isset($theme.admin_uri)}
+ <br><a href="{$theme.admin_uri}" title="{\'Configuration\'|@translate}">{\'Configuration\'|@translate}</a>
+ | <a href="admin.php?page=plugin-LocalFilesEditor-css&amp;theme={$theme.id}">CSS</a>
+{else}
+ <br><a href="admin.php?page=plugin-LocalFilesEditor-css&amp;theme={$theme.id}">CSS</a>
+{/if}
+';
+
+ return preg_replace($search, $replacement, $content);
+}
+
+add_event_handler('get_admin_plugin_menu_links', 'localfiles_admin_menu');
+add_event_handler('loc_begin_admin', 'localfiles_css_link');
?> \ No newline at end of file