aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/LocalFilesEditor/include/css.inc.php4
-rw-r--r--plugins/LocalFilesEditor/main.inc.php24
2 files changed, 27 insertions, 1 deletions
diff --git a/plugins/LocalFilesEditor/include/css.inc.php b/plugins/LocalFilesEditor/include/css.inc.php
index 83c479029..7fa129049 100644
--- a/plugins/LocalFilesEditor/include/css.inc.php
+++ b/plugins/LocalFilesEditor/include/css.inc.php
@@ -10,6 +10,10 @@ elseif (isset($_POST['edited_file']))
{
$edited_file = $_POST['edited_file'];
}
+elseif (isset($_GET['theme']) and in_array($_GET['theme'], array_keys(get_pwg_themes())))
+{
+ $edited_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . 'css/'.$_GET['theme'].'-rules.css';
+}
else
{
$edited_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR . 'css/'.get_default_theme().'-rules.css';
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