From d7410643d8e3db12a76845370d8eee2508fa6115 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 4 Aug 2013 19:46:02 +0200 Subject: added tab navigation --- lib/plugins/extension/helper/gui.php | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 lib/plugins/extension/helper/gui.php (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php new file mode 100644 index 000000000..eba5fbc7f --- /dev/null +++ b/lib/plugins/extension/helper/gui.php @@ -0,0 +1,71 @@ + + */ + +// must be run within Dokuwiki +if(!defined('DOKU_INC')) die(); + +/** + * Class helper_plugin_extension_list takes care of the overall GUI + */ +class helper_plugin_extension_gui extends DokuWiki_Plugin { + + protected $tabs = array('plugins', 'templates', 'search'); + + /** + * Print the tab navigation + * + * @fixme style active one + */ + public function tabNavigation() { + echo ''; + } + + /** + * Return the currently selected tab + * + * @return string + */ + public function currentTab() { + global $INPUT; + + $tab = $INPUT->str('tab', 'plugins', true); + if(!in_array($tab, $this->tabs)) $tab = 'plugins'; + return $tab; + } + + /** + * Create an URL inside the extension manager + * + * @param string $tab tab to load, empty for current tab + * @param array $params associative array of parameter to set + * + * @return string + */ + public function tabURL($tab = '', $params = array()) { + global $ID; + + if(!$tab) $tab = $this->currentTab(); + $defaults = array( + 'do' => 'admin', + 'page' => 'extension', + 'tab' => $tab, + ); + return wl($ID, array_merge($defaults, $params)); + } + +} -- cgit v1.2.3 From 5d7f3164ea4199d7cf1215a1a8a5785218c9e149 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 4 Aug 2013 20:08:30 +0200 Subject: moved display stuff to gui class, added template list --- lib/plugins/extension/helper/gui.php | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index eba5fbc7f..41afc2069 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -16,6 +16,43 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { protected $tabs = array('plugins', 'templates', 'search'); + + public function pluginList(){ + /* @var Doku_Plugin_Controller $plugin_controller */ + global $plugin_controller; + + $pluginlist = $plugin_controller->getList('', true); + /* @var helper_plugin_extension_extension $extension */ + $extension = $this->loadHelper('extension_extension'); + /* @var helper_plugin_extension_list $list */ + $list = $this->loadHelper('extension_list'); + $list->start_form(); + foreach ($pluginlist as $name) { + $extension->setExtension($name, false); + $list->add_row($extension, $name == $this->infoFor); + } + $list->end_form(); + $list->render(); + } + + public function templateList(){ + // FIXME do we have a real way? + $tpllist = glob(DOKU_INC.'lib/tpl/*', GLOB_ONLYDIR); + $tpllist = array_map('basename', $tpllist); + + /* @var helper_plugin_extension_extension $extension */ + $extension = $this->loadHelper('extension_extension'); + /* @var helper_plugin_extension_list $list */ + $list = $this->loadHelper('extension_list'); + $list->start_form(); + foreach ($tpllist as $name) { + $extension->setExtension($name, true); + $list->add_row($extension, $name == $this->infoFor); + } + $list->end_form(); + $list->render(); + } + /** * Print the tab navigation * -- cgit v1.2.3 From 1dd40c86eb47f24a2e7c7022592fd9cd25ff07f2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 4 Aug 2013 20:24:19 +0200 Subject: added intros --- lib/plugins/extension/helper/gui.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 41afc2069..7c83a3854 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -16,11 +16,15 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { protected $tabs = array('plugins', 'templates', 'search'); - - public function pluginList(){ + /** + * display the plugin tab + */ + public function tabPlugins(){ /* @var Doku_Plugin_Controller $plugin_controller */ global $plugin_controller; + echo $this->locale_xhtml('intro_plugins'); + $pluginlist = $plugin_controller->getList('', true); /* @var helper_plugin_extension_extension $extension */ $extension = $this->loadHelper('extension_extension'); @@ -35,7 +39,12 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { $list->render(); } - public function templateList(){ + /** + * Display the template tab + */ + public function tabTemplates(){ + echo $this->locale_xhtml('intro_templates'); + // FIXME do we have a real way? $tpllist = glob(DOKU_INC.'lib/tpl/*', GLOB_ONLYDIR); $tpllist = array_map('basename', $tpllist); @@ -53,6 +62,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { $list->render(); } + /** + * Display the search tab + */ + public function tabSearch(){ + echo $this->locale_xhtml('intro_search'); + } + /** * Print the tab navigation * -- cgit v1.2.3 From 55332151e03b99bbfd15e0fbaae391aae454d9eb Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Aug 2013 13:43:35 +0200 Subject: some initial go at the search tab --- lib/plugins/extension/helper/gui.php | 49 ++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 7c83a3854..cf5b8a347 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -16,10 +16,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { protected $tabs = array('plugins', 'templates', 'search'); + /** @var string the extension that should have an open info window FIXME currently broken*/ + protected $infofor = ''; + /** * display the plugin tab */ - public function tabPlugins(){ + public function tabPlugins() { /* @var Doku_Plugin_Controller $plugin_controller */ global $plugin_controller; @@ -31,8 +34,8 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /* @var helper_plugin_extension_list $list */ $list = $this->loadHelper('extension_list'); $list->start_form(); - foreach ($pluginlist as $name) { - $extension->setExtension($name, false); + foreach($pluginlist as $name) { + $extension->setExtension($name); $list->add_row($extension, $name == $this->infoFor); } $list->end_form(); @@ -42,7 +45,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /** * Display the template tab */ - public function tabTemplates(){ + public function tabTemplates() { echo $this->locale_xhtml('intro_templates'); // FIXME do we have a real way? @@ -54,8 +57,8 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /* @var helper_plugin_extension_list $list */ $list = $this->loadHelper('extension_list'); $list->start_form(); - foreach ($tpllist as $name) { - $extension->setExtension($name, true); + foreach($tpllist as $name) { + $extension->setExtension("template:$name"); $list->add_row($extension, $name == $this->infoFor); } $list->end_form(); @@ -65,8 +68,34 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /** * Display the search tab */ - public function tabSearch(){ + public function tabSearch() { + global $INPUT; echo $this->locale_xhtml('intro_search'); + + $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'))); + $form->addElement(form_makeTextField('q', $INPUT->str('q'), 'Search')); + $form->addElement(form_makeButton('submit', '', 'Search')); + $form->printForm(); + + if(!$INPUT->bool('q')) return; + + + /* @var helper_plugin_extension_repository $repository FIXME should we use some gloabl instance? */ + $repository = $this->loadHelper('extension_repository'); + $result = $repository->search($INPUT->str('q')); + + /* @var helper_plugin_extension_extension $extension */ + $extension = $this->loadHelper('extension_extension'); + /* @var helper_plugin_extension_list $list */ + $list = $this->loadHelper('extension_list'); + $list->start_form(); + foreach($result as $name) { + $extension->setExtension($name); + $list->add_row($extension, $name == $this->infoFor); + } + $list->end_form(); + $list->render(); + } /** @@ -106,10 +135,10 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { * * @param string $tab tab to load, empty for current tab * @param array $params associative array of parameter to set - * + * @param string $sep seperator to build the URL * @return string */ - public function tabURL($tab = '', $params = array()) { + public function tabURL($tab = '', $params = array(), $sep = '&') { global $ID; if(!$tab) $tab = $this->currentTab(); @@ -118,7 +147,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { 'page' => 'extension', 'tab' => $tab, ); - return wl($ID, array_merge($defaults, $params)); + return wl($ID, array_merge($defaults, $params), false, $sep); } } -- cgit v1.2.3 From ea9f3f904d439e9af84bdbed8e1a0bba3ed286b2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Aug 2013 15:31:45 +0200 Subject: added 4th tab for manual install --- lib/plugins/extension/helper/gui.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index cf5b8a347..09cea7fcb 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -14,7 +14,7 @@ if(!defined('DOKU_INC')) die(); */ class helper_plugin_extension_gui extends DokuWiki_Plugin { - protected $tabs = array('plugins', 'templates', 'search'); + protected $tabs = array('plugins', 'templates', 'search', 'install'); /** @var string the extension that should have an open info window FIXME currently broken*/ protected $infofor = ''; @@ -98,6 +98,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { } + /** + * Display the template tab + */ + public function tabInstall() { + echo $this->locale_xhtml('intro_install'); + } + /** * Print the tab navigation * @@ -105,7 +112,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { */ public function tabNavigation() { echo '
    '; - foreach(array('plugins', 'templates', 'search') as $tab) { + foreach($this->tabs as $tab) { $url = $this->tabURL($tab); if($this->currentTab() == $tab) { $class = 'class="active"'; -- cgit v1.2.3 From 341cc636324f216ddc217fc03f02004b8423b9f0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Aug 2013 21:38:31 +0200 Subject: sort plugins --- lib/plugins/extension/helper/gui.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 09cea7fcb..57dfefab3 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -29,6 +29,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo $this->locale_xhtml('intro_plugins'); $pluginlist = $plugin_controller->getList('', true); + sort($pluginlist); /* @var helper_plugin_extension_extension $extension */ $extension = $this->loadHelper('extension_extension'); /* @var helper_plugin_extension_list $list */ @@ -51,6 +52,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { // FIXME do we have a real way? $tpllist = glob(DOKU_INC.'lib/tpl/*', GLOB_ONLYDIR); $tpllist = array_map('basename', $tpllist); + sort($tpllist); /* @var helper_plugin_extension_extension $extension */ $extension = $this->loadHelper('extension_extension'); -- cgit v1.2.3 From 75e063084d865a011e074c29c5edb8569fe2cfe1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Aug 2013 22:58:01 +0200 Subject: made info mechanism work again --- lib/plugins/extension/helper/gui.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 57dfefab3..6a0cdb22e 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -17,7 +17,18 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { protected $tabs = array('plugins', 'templates', 'search', 'install'); /** @var string the extension that should have an open info window FIXME currently broken*/ - protected $infofor = ''; + protected $infoFor = ''; + + /** + * Constructor + * + * initializes requested info window + */ + public function __construct(){ + global $INPUT; + $this->infoFor = $INPUT->str('info'); + } + /** * display the plugin tab @@ -37,7 +48,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { $list->start_form(); foreach($pluginlist as $name) { $extension->setExtension($name); - $list->add_row($extension, $name == $this->infoFor); + $list->add_row($extension, $extension->getID() == $this->infoFor); } $list->end_form(); $list->render(); @@ -61,7 +72,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { $list->start_form(); foreach($tpllist as $name) { $extension->setExtension("template:$name"); - $list->add_row($extension, $name == $this->infoFor); + $list->add_row($extension, $extension->getID() == $this->infoFor); } $list->end_form(); $list->render(); @@ -93,7 +104,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { $list->start_form(); foreach($result as $name) { $extension->setExtension($name); - $list->add_row($extension, $name == $this->infoFor); + $list->add_row($extension, $extension->getID() == $this->infoFor); } $list->end_form(); $list->render(); @@ -149,12 +160,14 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { */ public function tabURL($tab = '', $params = array(), $sep = '&') { global $ID; + global $INPUT; if(!$tab) $tab = $this->currentTab(); $defaults = array( 'do' => 'admin', 'page' => 'extension', 'tab' => $tab, + 'q' => $INPUT->str('q') ); return wl($ID, array_merge($defaults, $params), false, $sep); } -- cgit v1.2.3 From fee60c9e19860de9edb1dd146ec7063bb9eda392 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 10 Aug 2013 10:23:04 +0200 Subject: manual install tab now works --- lib/plugins/extension/helper/gui.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 6a0cdb22e..8577a1696 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -16,7 +16,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { protected $tabs = array('plugins', 'templates', 'search', 'install'); - /** @var string the extension that should have an open info window FIXME currently broken*/ + /** @var string the extension that should have an open info window FIXME currently broken */ protected $infoFor = ''; /** @@ -24,12 +24,11 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { * * initializes requested info window */ - public function __construct(){ + public function __construct() { global $INPUT; $this->infoFor = $INPUT->str('info'); } - /** * display the plugin tab */ @@ -92,10 +91,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { if(!$INPUT->bool('q')) return; - /* @var helper_plugin_extension_repository $repository FIXME should we use some gloabl instance? */ $repository = $this->loadHelper('extension_repository'); - $result = $repository->search($INPUT->str('q')); + $result = $repository->search($INPUT->str('q')); /* @var helper_plugin_extension_extension $extension */ $extension = $this->loadHelper('extension_extension'); @@ -116,6 +114,12 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { */ public function tabInstall() { echo $this->locale_xhtml('intro_install'); + + $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data')); + $form->addElement(form_makeTextField('installurl', '', 'Install from URL:', '', 'block')); + $form->addElement(form_makeFileField('installfile', 'Upload Extension:', '', 'block')); + $form->addElement(form_makeButton('submit', '', 'Install')); + $form->printForm(); } /** -- cgit v1.2.3 From df7751c6c456e0107b11d547c159266b470470d9 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 10 Aug 2013 10:45:29 +0200 Subject: nicer tabs --- lib/plugins/extension/helper/gui.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 8577a1696..7ad238af4 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -36,7 +36,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /* @var Doku_Plugin_Controller $plugin_controller */ global $plugin_controller; + echo '
    '; echo $this->locale_xhtml('intro_plugins'); + echo '
    '; $pluginlist = $plugin_controller->getList('', true); sort($pluginlist); @@ -57,7 +59,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { * Display the template tab */ public function tabTemplates() { + echo '
    '; echo $this->locale_xhtml('intro_templates'); + echo '
    '; // FIXME do we have a real way? $tpllist = glob(DOKU_INC.'lib/tpl/*', GLOB_ONLYDIR); @@ -82,7 +86,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { */ public function tabSearch() { global $INPUT; + echo '
    '; echo $this->locale_xhtml('intro_search'); + echo '
    '; $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'))); $form->addElement(form_makeTextField('q', $INPUT->str('q'), 'Search')); @@ -113,7 +119,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { * Display the template tab */ public function tabInstall() { + echo '
    '; echo $this->locale_xhtml('intro_install'); + echo '
    '; $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data')); $form->addElement(form_makeTextField('installurl', '', 'Install from URL:', '', 'block')); -- cgit v1.2.3 From 32fdfac2cd446733436dc1b344d7f73b78655cb1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 10 Aug 2013 11:11:14 +0200 Subject: changed exception handling, redirect after post actions --- lib/plugins/extension/helper/gui.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 7ad238af4..2c2a19bf8 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -168,9 +168,10 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { * @param string $tab tab to load, empty for current tab * @param array $params associative array of parameter to set * @param string $sep seperator to build the URL + * @param bool $absolute create absolute URLs? * @return string */ - public function tabURL($tab = '', $params = array(), $sep = '&') { + public function tabURL($tab = '', $params = array(), $sep = '&', $absolute=false) { global $ID; global $INPUT; @@ -181,7 +182,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { 'tab' => $tab, 'q' => $INPUT->str('q') ); - return wl($ID, array_merge($defaults, $params), false, $sep); + return wl($ID, array_merge($defaults, $params), $absolute, $sep); } } -- cgit v1.2.3 From f910b299e4bbc59cfbe4e68af5d34ea2e5815574 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 10 Aug 2013 14:29:40 +0200 Subject: updated styles RTL styles need to be readded --- lib/plugins/extension/helper/gui.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 2c2a19bf8..139a1a16a 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -90,9 +90,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo $this->locale_xhtml('intro_search'); echo ''; - $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'))); - $form->addElement(form_makeTextField('q', $INPUT->str('q'), 'Search')); - $form->addElement(form_makeButton('submit', '', 'Search')); + $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'class' => 'search')); + $form->addElement(form_makeTextField('q', $INPUT->str('q'), $this->getLang('search_for'))); + $form->addElement(form_makeButton('submit', '', $this->getLang('search'))); $form->printForm(); if(!$INPUT->bool('q')) return; @@ -123,7 +123,7 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo $this->locale_xhtml('intro_install'); echo ''; - $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data')); + $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data', 'class' => 'install')); $form->addElement(form_makeTextField('installurl', '', 'Install from URL:', '', 'block')); $form->addElement(form_makeFileField('installfile', 'Upload Extension:', '', 'block')); $form->addElement(form_makeButton('submit', '', 'Install')); @@ -165,13 +165,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /** * Create an URL inside the extension manager * - * @param string $tab tab to load, empty for current tab - * @param array $params associative array of parameter to set - * @param string $sep seperator to build the URL + * @param string $tab tab to load, empty for current tab + * @param array $params associative array of parameter to set + * @param string $sep seperator to build the URL * @param bool $absolute create absolute URLs? * @return string */ - public function tabURL($tab = '', $params = array(), $sep = '&', $absolute=false) { + public function tabURL($tab = '', $params = array(), $sep = '&', $absolute = false) { global $ID; global $INPUT; -- cgit v1.2.3 From 2e308c3608bea50e07aacf51b232eaedbda6eb20 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 11 Aug 2013 12:14:44 +0200 Subject: only carry the q to search tab --- lib/plugins/extension/helper/gui.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 139a1a16a..76651515c 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -180,8 +180,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { 'do' => 'admin', 'page' => 'extension', 'tab' => $tab, - 'q' => $INPUT->str('q') ); + if($tab == 'search') $defaults['q'] = $INPUT->str('q'); + return wl($ID, array_merge($defaults, $params), $absolute, $sep); } -- cgit v1.2.3 From c837868af892ada4c25333bec46583a0d42a240d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 8 Jan 2014 20:29:17 +0100 Subject: added missing localization --- lib/plugins/extension/helper/gui.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 76651515c..953d50fa6 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -124,9 +124,9 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { echo ''; $form = new Doku_Form(array('action' => $this->tabURL('', array(), '&'), 'enctype' => 'multipart/form-data', 'class' => 'install')); - $form->addElement(form_makeTextField('installurl', '', 'Install from URL:', '', 'block')); - $form->addElement(form_makeFileField('installfile', 'Upload Extension:', '', 'block')); - $form->addElement(form_makeButton('submit', '', 'Install')); + $form->addElement(form_makeTextField('installurl', '', $this->getLang('install_url'), '', 'block')); + $form->addElement(form_makeFileField('installfile', $this->getLang('install_upload'), '', 'block')); + $form->addElement(form_makeButton('submit', '', $this->getLang('btn_install'))); $form->printForm(); } -- cgit v1.2.3 From b1e758012b3d801d5ab266e53e830fb7091508a2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 8 Jan 2014 20:38:23 +0100 Subject: show a message when search returns no results --- lib/plugins/extension/helper/gui.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper/gui.php') diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 953d50fa6..3a0f0c589 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -106,9 +106,13 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { /* @var helper_plugin_extension_list $list */ $list = $this->loadHelper('extension_list'); $list->start_form(); - foreach($result as $name) { - $extension->setExtension($name); - $list->add_row($extension, $extension->getID() == $this->infoFor); + if($result){ + foreach($result as $name) { + $extension->setExtension($name); + $list->add_row($extension, $extension->getID() == $this->infoFor); + } + } else { + $list->nothing_found(); } $list->end_form(); $list->render(); -- cgit v1.2.3