From 253d4b48ec708eb42033862dc15c8576f44a48ed Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 15:32:05 +0200 Subject: more PHPDocs, unused var, small bit code reformatting --- lib/plugins/config/settings/extra.class.php | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) (limited to 'lib/plugins/config/settings/extra.class.php') diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php index 02171fb77..232a8177f 100644 --- a/lib/plugins/config/settings/extra.class.php +++ b/lib/plugins/config/settings/extra.class.php @@ -6,8 +6,15 @@ */ if (!class_exists('setting_sepchar')) { + /** + * Class setting_sepchar + */ class setting_sepchar extends setting_multichoice { + /** + * @param string $key + * @param array|null $param array with metadata of setting + */ function setting_sepchar($key,$param=null) { $str = '_-.'; for ($i=0;$i_choices[] = $str{$i}; @@ -19,8 +26,19 @@ if (!class_exists('setting_sepchar')) { } if (!class_exists('setting_savedir')) { + /** + * Class setting_savedir + */ class setting_savedir extends setting_string { + /** + * update changed setting with user provided value $input + * - if changed value fails error check, save it to $this->_input (to allow echoing later) + * - if changed value passes error check, set $this->_local to the new value + * + * @param mixed $input the new value + * @return boolean true if changed, false otherwise (also on error) + */ function update($input) { if ($this->is_protected()) return false; @@ -40,9 +58,20 @@ if (!class_exists('setting_savedir')) { } if (!class_exists('setting_authtype')) { + /** + * Class setting_authtype + */ class setting_authtype extends setting_multichoice { + /** + * Receives current values for the setting $key + * + * @param mixed $default default setting value + * @param mixed $local local setting value + * @param mixed $protected protected setting value + */ function initialize($default,$local,$protected) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; // retrieve auth types provided by plugins @@ -53,7 +82,16 @@ if (!class_exists('setting_authtype')) { parent::initialize($default,$local,$protected); } + /** + * update changed setting with user provided value $input + * - if changed value fails error check, save it to $this->_input (to allow echoing later) + * - if changed value passes error check, set $this->_local to the new value + * + * @param mixed $input the new value + * @return boolean true if changed, false otherwise (also on error) + */ function update($input) { + /** @var $plugin_controller Doku_Plugin_Controller */ global $plugin_controller; // is an update possible/requested? @@ -92,8 +130,19 @@ if (!class_exists('setting_authtype')) { } if (!class_exists('setting_im_convert')) { + /** + * Class setting_im_convert + */ class setting_im_convert extends setting_string { + /** + * update changed setting with user provided value $input + * - if changed value fails error check, save it to $this->_input (to allow echoing later) + * - if changed value passes error check, set $this->_local to the new value + * + * @param mixed $input the new value + * @return boolean true if changed, false otherwise (also on error) + */ function update($input) { if ($this->is_protected()) return false; @@ -115,8 +164,18 @@ if (!class_exists('setting_im_convert')) { } if (!class_exists('setting_disableactions')) { + /** + * Class setting_disableactions + */ class setting_disableactions extends setting_multicheckbox { + /** + * Build html for label and input of setting + * + * @param DokuWiki_Plugin $plugin object of config plugin + * @param bool $echo true: show inputted value, when error occurred, otherwise the stored setting + * @return array with content array(string $label_html, string $input_html) + */ function html(&$plugin, $echo=false) { global $lang; @@ -134,10 +193,20 @@ if (!class_exists('setting_disableactions')) { } if (!class_exists('setting_compression')) { + /** + * Class setting_compression + */ class setting_compression extends setting_multichoice { var $_choices = array('0'); // 0 = no compression, always supported + /** + * Receives current values for the setting $key + * + * @param mixed $default default setting value + * @param mixed $local local setting value + * @param mixed $protected protected setting value + */ function initialize($default,$local,$protected) { // populate _choices with the compression methods supported by this php installation @@ -150,10 +219,20 @@ if (!class_exists('setting_compression')) { } if (!class_exists('setting_license')) { + /** + * Class setting_license + */ class setting_license extends setting_multichoice { var $_choices = array(''); // none choosen + /** + * Receives current values for the setting $key + * + * @param mixed $default default setting value + * @param mixed $local local setting value + * @param mixed $protected protected setting value + */ function initialize($default,$local,$protected) { global $license; @@ -169,10 +248,20 @@ if (!class_exists('setting_license')) { if (!class_exists('setting_renderer')) { + /** + * Class setting_renderer + */ class setting_renderer extends setting_multichoice { var $_prompts = array(); var $_format = null; + /** + * Receives current values for the setting $key + * + * @param mixed $default default setting value + * @param mixed $local local setting value + * @param mixed $protected protected setting value + */ function initialize($default,$local,$protected) { $format = $this->_format; @@ -189,6 +278,13 @@ if (!class_exists('setting_renderer')) { parent::initialize($default,$local,$protected); } + /** + * Build html for label and input of setting + * + * @param DokuWiki_Plugin $plugin object of config plugin + * @param bool $echo true: show inputted value, when error occurred, otherwise the stored setting + * @return array with content array(string $label_html, string $input_html) + */ function html(&$plugin, $echo=false) { // make some language adjustments (there must be a better way) -- cgit v1.2.3