From 7e8500eea1e53b1de0e0f70400664afa442cd08d Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 2 Oct 2014 14:55:24 +0200 Subject: PHPDocs and some improvements --- lib/plugins/admin.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/plugins/admin.php') diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php index 9a1fb9fdc..d063af612 100644 --- a/lib/plugins/admin.php +++ b/lib/plugins/admin.php @@ -14,6 +14,10 @@ if(!defined('DOKU_INC')) die(); */ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { + /** + * @param string $language language code + * @return string + */ function getMenuText($language) { $menutext = $this->getLang('menu'); if (!$menutext) { @@ -23,10 +27,14 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { return $menutext; } + /** + * @return int + */ function getMenuSort() { return 1000; } + function handle() { trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING); } @@ -35,10 +43,16 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { trigger_error('html() not implemented in '.get_class($this), E_USER_WARNING); } + /** + * @return bool + */ function forAdminOnly() { return true; } + /** + * @return array + */ function getTOC(){ return array(); } -- cgit v1.2.3 From 52a281e8549d1a9269ce7ced1336a567086962c5 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 10 Dec 2014 12:49:43 +0100 Subject: Some PHPDocs media and admin plugin --- lib/plugins/admin.php | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'lib/plugins/admin.php') diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php index d063af612..39dece453 100644 --- a/lib/plugins/admin.php +++ b/lib/plugins/admin.php @@ -15,10 +15,13 @@ if(!defined('DOKU_INC')) die(); class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { /** + * Return the text that is displayed at the main admin menu + * (Default localized language string 'menu' is returned, override this function for setting another name) + * * @param string $language language code - * @return string + * @return string menu string */ - function getMenuText($language) { + public function getMenuText($language) { $menutext = $this->getLang('menu'); if (!$menutext) { $info = $this->getInfo(); @@ -28,32 +31,47 @@ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { } /** + * Determine position in list in admin window + * Lower values are sorted up + * * @return int */ - function getMenuSort() { + public function getMenuSort() { return 1000; } - - function handle() { + /** + * Carry out required processing + */ + public function handle() { trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING); } - function html() { + /** + * Output html of the admin page + */ + public function html() { trigger_error('html() not implemented in '.get_class($this), E_USER_WARNING); } /** + * Return true for access only by admins (config:superuser) or false if managers are allowed as well + * * @return bool */ - function forAdminOnly() { + public function forAdminOnly() { return true; } /** + * Return array with ToC items. Items can be created with the html_mktocitem() + * + * @see html_mktocitem() + * @see tpl_toc() + * * @return array */ - function getTOC(){ + public function getTOC(){ return array(); } } -- cgit v1.2.3