summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-17 11:16:17 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-17 11:16:17 +0200
commit82f9aff6a65b1acaeec6cfde9a2848cb9cb92e03 (patch)
tree8f9d5c2130d2a6b2b5e517c82c65c96b954592f6 /lib/plugins
parent831864db51ec2c0cd8b86aaee1f1c160df91087d (diff)
downloadrpg-82f9aff6a65b1acaeec6cfde9a2848cb9cb92e03.tar.gz
rpg-82f9aff6a65b1acaeec6cfde9a2848cb9cb92e03.tar.bz2
started to localize the styler plugin
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/styler/admin.php37
-rw-r--r--lib/plugins/styler/lang/en/intro.txt2
-rw-r--r--lib/plugins/styler/lang/en/lang.php9
-rw-r--r--lib/plugins/styler/script.js2
4 files changed, 38 insertions, 12 deletions
diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styler/admin.php
index bb9426e12..bfc6cd32b 100644
--- a/lib/plugins/styler/admin.php
+++ b/lib/plugins/styler/admin.php
@@ -26,6 +26,15 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
}
/**
+ * @param string $language
+ * @return string
+ */
+ public function getMenuText($language) {
+ $js = $this->getLang('js');
+ return $js['menu'];
+ }
+
+ /**
* handle the different actions (also called from ajax)
*/
public function handle() {
@@ -41,6 +50,7 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
*/
public function html() {
echo '<div id="plugin__styler">';
+ ptln('<h1>'.$this->getMenuText('').'</h1>');
$this->form(false);
echo '</div>';
}
@@ -63,15 +73,13 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
$target = wl($ID, array('do' => 'admin', 'page' => 'styler'));
}
- ptln('<h1>'.$this->getLang('menu').'</h1>');
-
if(empty($replacements)) {
- echo '<p class="error">Sorry, this template does not support this functionality.</p>';
+ echo '<p class="error">'.$this->getLang('error').'</p>';
} else {
- echo '<p>Intro blah... for the currently active template ("'.$tpl.'")... not all variables preview...</p>';
+ echo $this->locale_xhtml('intro');
echo '<form class="styler" method="post" action="'.$target.'">';
- echo '<h2>Template variables</h2>';
+
echo '<table>';
foreach($replacements as $key => $value) {
echo '<tr>';
@@ -80,11 +88,22 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin {
echo '</tr>';
}
echo '</table>';
- echo '<input type="submit" name="run[preview]" value="preview">';
- echo '<input type="submit" name="run[reset]" value="reset current">'; #FIXME only if preview.ini exists
- echo '<input type="submit" name="run[revert]" value="revert to original">'; #FIXME only if local.ini exists
- echo '<input type="submit" name="run[save]" value="save">';
+
+ echo '<p class="center">';
+ echo '<input type="submit" name="run[preview]" value="'.$this->getLang('btn_preview').'">';
+ echo '<input type="submit" name="run[reset]" value="'.$this->getLang('btn_reset').'">'; #FIXME only if preview.ini exists
+ echo '</p>';
+
+ echo '<p class="center">';
+ echo '<input type="submit" name="run[save]" value="'.$this->getLang('btn_save').'">';
+ echo '</p>';
+
+ echo '<p class="center">';
+ echo '<input type="submit" name="run[revert]" value="'.$this->getLang('btn_revert').'">'; #FIXME only if local.ini exists
+ echo '</p>';
+
echo '</form>';
+
}
}
diff --git a/lib/plugins/styler/lang/en/intro.txt b/lib/plugins/styler/lang/en/intro.txt
new file mode 100644
index 000000000..bb9e3ff33
--- /dev/null
+++ b/lib/plugins/styler/lang/en/intro.txt
@@ -0,0 +1,2 @@
+This tool allows you to change certain style settings of your currently selected template
+all changes are stored in a local configuration file and are upgrade safe. \ No newline at end of file
diff --git a/lib/plugins/styler/lang/en/lang.php b/lib/plugins/styler/lang/en/lang.php
index dfb472f11..2dd7921b0 100644
--- a/lib/plugins/styler/lang/en/lang.php
+++ b/lib/plugins/styler/lang/en/lang.php
@@ -6,10 +6,15 @@
*/
// menu entry for admin plugins
-// $lang['menu'] = 'Your menu entry';
+$lang['js']['menu'] = 'Template Style Settings';
// custom language strings for the plugin
-// $lang['fixme'] = 'FIXME';
+$lang['error'] = 'Sorry, this template does not support this functionality.';
+
+$lang['btn_preview'] = 'Preview your changes';
+$lang['btn_save'] = 'Save your changes';
+$lang['btn_reset'] = 'Reset your current changes';
+$lang['btn_revert'] = 'Revert all styles back to the template\'s default';
diff --git a/lib/plugins/styler/script.js b/lib/plugins/styler/script.js
index b3cadfd5e..d472c4fe7 100644
--- a/lib/plugins/styler/script.js
+++ b/lib/plugins/styler/script.js
@@ -23,7 +23,7 @@ jQuery(function () {
// open the dialog
$dialog.dialog({
- 'title': 'Template Variables',
+ 'title': LANG.plugins.styler.menu,
'width': 500,
'top': 50,
'position': { 'my': 'left top', 'at': 'left top', 'of': window },