diff --git a/lib/plugins/styler/admin.php b/lib/plugins/styler/admin.php index bb9426e129625df4e41ca6a6d05283537d94cc96..bfc6cd32b9c8ac9a0f4cc03d0a72f0241ce8a08c 100644 --- a/lib/plugins/styler/admin.php +++ b/lib/plugins/styler/admin.php @@ -25,6 +25,15 @@ class admin_plugin_styler extends DokuWiki_Admin_Plugin { return true; } + /** + * @param string $language + * @return string + */ + public function getMenuText($language) { + $js = $this->getLang('js'); + return $js['menu']; + } + /** * handle the different actions (also called from ajax) */ @@ -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 0000000000000000000000000000000000000000..bb9e3ff3380d4df8285cc9028cc8a76026a6bfa0 --- /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 dfb472f11be3b79fe717e42e370dc4c561a1f946..2dd7921b08a022d18288e968ab0c14ad9e057d52 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 b3cadfd5ed5ced89e2686d14e44090bbca62ee81..d472c4fe7fcbbc62c5b8bc0396ae1a846e5defe7 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 },