summaryrefslogtreecommitdiff
path: root/lib/plugins/styler/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/styler/admin.php')
-rw-r--r--lib/plugins/styler/admin.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styler/admin.php
index bfc6cd32b..8d44ac6f5 100644
--- a/lib/plugins/styler/admin.php
+++ b/lib/plugins/styler/admin.php
@@ -84,7 +84,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
foreach($replacements as $key => $value) {
echo '<tr>';
echo '<td>'.$key.'</td>';
- echo '<td><input name="tpl['.hsc($key).']" value="'.hsc($value).'" />';
+ echo '<td><input name="tpl['.hsc($key).']" value="'.hsc($value).'" '.$this->colorClass($key).' />';
echo '</tr>';
}
echo '</table>';
@@ -108,6 +108,32 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
}
/**
+ * set the color class attribute
+ */
+ protected function colorClass($key) {
+ static $colors = array(
+ 'text',
+ 'background',
+ 'text_alt',
+ 'background_alt',
+ 'text_neu',
+ 'background_neu',
+ 'border',
+ 'highlight',
+ 'background_site',
+ 'link',
+ 'existing',
+ 'missing',
+ );
+
+ if(preg_match('/colou?r/', $key) || in_array(trim($key,'_'), $colors)) {
+ return 'class="color"';
+ } else {
+ return '';
+ }
+ }
+
+ /**
* saves the preview.ini
*/
protected function run_preview() {