summaryrefslogtreecommitdiff
path: root/lib/plugins/styler/admin.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-17 15:37:50 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-17 15:37:50 +0200
commite422a60a9672c993b6872e856b9172dbd8135b56 (patch)
tree0f81c26007a369be2199e02c74e099c6f63badf0 /lib/plugins/styler/admin.php
parent82f9aff6a65b1acaeec6cfde9a2848cb9cb92e03 (diff)
downloadrpg-e422a60a9672c993b6872e856b9172dbd8135b56.tar.gz
rpg-e422a60a9672c993b6872e856b9172dbd8135b56.tar.bz2
added color picker support
I'm not too hapy with it
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() {