From 9678c7b845dfc8b4c1837101da5bbf8d55d0b2d4 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 5 Jan 2012 13:27:31 +1300 Subject: [PATCH] MDL-30979 output: Fixed up phpdocs for output components code --- lib/outputcomponents.php | 723 ++++++++++++++++++++++++++++----------- 1 file changed, 519 insertions(+), 204 deletions(-) diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index f87c4ac26ca..e4b13724f42 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -21,17 +21,19 @@ * Please see http://docs.moodle.org/en/Developement:How_Moodle_outputs_HTML * for an overview. * - * @package core - * @subpackage lib - * @copyright 2009 Tim Hunt - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @package core + * @subpackage output + * @copyright 2009 Tim Hunt + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Interface marking other classes as suitable for renderer_base::render() - * @author 2010 Petr Skoda (skodak) info@skodak.org + * @copyright 2010 Petr Skoda (skodak) info@skodak.org + * @package core + * @subpackage output */ interface renderable { // intentionally empty @@ -41,11 +43,34 @@ interface renderable { * Data structure representing a file picker. * * @copyright 2010 Dongsheng Cai - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class file_picker implements renderable { + + /** + * An object containing options for the file picker + * @var stdClass + */ public $options; + + /** + * Constructs a file picker object. + * + * The following are possible options for the filepicker: + * - accepted_types (*) + * - return_types (FILE_INTERNAL) + * - env (filepicker) + * - client_id (uniqid) + * - itemid (0) + * - maxbytes (-1) + * - maxfiles (1) + * - buttonname (false) + * + * @param stdClass $options An object containing options for the file picker. + */ public function __construct(stdClass $options) { global $CFG, $USER, $PAGE; require_once($CFG->dirroot. '/repository/lib.php'); @@ -97,51 +122,68 @@ class file_picker implements renderable { * Data structure representing a user picture. * * @copyright 2009 Nicolas Connault, 2010 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Modle 2.0 + * @package core + * @subpackage output */ class user_picture implements renderable { /** - * @var array List of mandatory fields in user record here. (do not include TEXT columns because it would break SELECT DISTINCT in MSSQL and ORACLE) + * List of mandatory fields in user record here. (do not include TEXT columns + * because it would break SELECT DISTINCT in MSSQL and ORACLE) + * @var array */ protected static $fields = array('id', 'picture', 'firstname', 'lastname', 'imagealt', 'email'); //TODO: add deleted /** - * @var object $user A user object with at least fields all columns specified in $fields array constant set. + * A user object with at least fields all columns specified in $fields array constant set. + * @var object $user */ public $user; + /** - * @var int $courseid The course id. Used when constructing the link to the user's profile, + * The course id. Used when constructing the link to the user's profile, * page course id used if not specified. + * @var int $courseid */ public $courseid; + /** - * @var bool $link add course profile link to image + * Add course profile link to image + * @var bool $link */ public $link = true; + /** - * @var int $size Size in pixels. Special values are (true/1 = 100px) and (false/0 = 35px) for backward compatibility + * Size in pixels. Special values are (true/1 = 100px) and (false/0 = 35px) + * for backward compatibility. + * @var int $size */ public $size = 35; + /** - * @var boolean $alttext add non-blank alt-text to the image. + * Add non-blank alt-text to the image. * Default true, set to false when image alt just duplicates text in screenreaders. + * @var boolean $alttext */ public $alttext = true; + /** - * @var boolean $popup Whether or not to open the link in a popup window. + * Whether or not to open the link in a popup window. + * @var boolean $popup */ public $popup = false; + /** - * @var string Image class attribute + * Image class attribute + * @var string */ public $class = 'userpicture'; /** * User picture constructor. * - * @param object $user user record with at least id, picture, imagealt, firstname and lastname set. - * @param array $options such as link, size, link, ... + * @param stdClass $user user record with at least id, picture, imagealt, firstname and lastname set. */ public function __construct(stdClass $user) { global $DB; @@ -228,7 +270,7 @@ class user_picture implements renderable { * @param string $fieldprefix prefix added to all columns in their aliases, does not apply to 'id' * @return stdClass object with unaliased user fields */ - public static function unalias(stdClass $record, array $extrafields=null, $idalias='id', $fieldprefix='') { + public static function unalias(stdClass $record, array $extrafields = null, $idalias = 'id', $fieldprefix = '') { if (empty($idalias)) { $idalias = 'id'; @@ -347,34 +389,44 @@ class user_picture implements renderable { * Data structure representing a help icon. * * @copyright 2009 Nicolas Connault, 2010 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class old_help_icon implements renderable { + /** - * @var string $helpidentifier lang pack identifier + * Lang pack identifier + * @var string $helpidentifier */ public $helpidentifier; + /** - * @var string $title A descriptive text for title tooltip + * A descriptive text for title tooltip + * @var string $title */ public $title = null; + /** - * @var string $component Component name, the same as in get_string() + * Component name, the same as in get_string() + * @var string $component */ public $component = 'moodle'; + /** - * @var string $linktext Extra descriptive text next to the icon + * Extra descriptive text next to the icon + * @var string $linktext */ public $linktext = null; /** * Constructor: sets up the other components in case they are needed + * * @param string $helpidentifier The keyword that defines a help page * @param string $title A descriptive text for accessibility only * @param string $component * @param bool $linktext add extra text to icon - * @return void */ public function __construct($helpidentifier, $title, $component = 'moodle') { if (empty($title)) { @@ -394,28 +446,37 @@ class old_help_icon implements renderable { * Data structure representing a help icon. * * @copyright 2010 Petr Skoda (info@skodak.org) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class help_icon implements renderable { + /** - * @var string $identifier lang pack identifier (without the "_help" suffix), - * both get_string($identifier, $component) and get_string($identifier.'_help', $component) - * must exist. + * lang pack identifier (without the "_help" suffix), + * both get_string($identifier, $component) and get_string($identifier.'_help', $component) + * must exist. + * @var string $identifier */ public $identifier; + /** - * @var string $component Component name, the same as in get_string() + * Component name, the same as in get_string() + * @var string $component */ public $component; + /** - * @var string $linktext Extra descriptive text next to the icon + * Extra descriptive text next to the icon + * @var string $linktext */ public $linktext = null; /** * Constructor - * @param string $identifier string for help page title, + * + * @param string $identifier string for help page title, * string with _help suffix is used for the actual help text. * string with _link suffix is used to create a link to further info (if it exists) * @param string $component @@ -444,16 +505,34 @@ class help_icon implements renderable { * Data structure representing an icon. * * @copyright 2010 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class pix_icon implements renderable { + + /** + * The icon name + * @var string + */ var $pix; + + /** + * The component the icon belongs to. + * @var string + */ var $component; + + /** + * An array of attributes to use on the icon + * @var array + */ var $attributes = array(); /** * Constructor + * * @param string $pix short icon name * @param string $alt The alt text to use for the icon * @param string $component component name @@ -477,7 +556,11 @@ class pix_icon implements renderable { /** * Data structure representing an emoticon image * - * @since Moodle 2.0 + * @copyright 2010 David Mudrak + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class pix_emoticon extends pix_icon implements renderable { @@ -500,45 +583,55 @@ class pix_emoticon extends pix_icon implements renderable { * Data structure representing a simple form with only one button. * * @copyright 2009 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class single_button implements renderable { + /** * Target url * @var moodle_url */ var $url; + /** * Button label * @var string */ var $label; + /** * Form submit method * @var string post or get */ var $method = 'post'; + /** * Wrapping div class * @var string - * */ + */ var $class = 'singlebutton'; + /** * True if button disabled, false if normal * @var boolean */ var $disabled = false; + /** * Button tooltip * @var string */ var $tooltip = null; + /** * Form id * @var string */ var $formid; + /** * List of attached actions * @var array of component_action @@ -547,7 +640,7 @@ class single_button implements renderable { /** * Constructor - * @param string|moodle_url $url + * @param moodle_url $url * @param string $label button text * @param string $method get or post submit method */ @@ -560,8 +653,8 @@ class single_button implements renderable { /** * Shortcut for adding a JS confirm dialog when the button is clicked. * The message must be a yes/no question. + * * @param string $message The yes/no confirmation question. If "Yes" is clicked, the original action will occur. - * @return void */ public function add_confirm_action($confirmmessage) { $this->add_action(new confirm_action($confirmmessage)); @@ -570,7 +663,6 @@ class single_button implements renderable { /** * Add action to the button. * @param component_action $action - * @return void */ public function add_action(component_action $action) { $this->actions[] = $action; @@ -583,78 +675,93 @@ class single_button implements renderable { * If JS not enabled small go button is printed too. * * @copyright 2009 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class single_select implements renderable { + /** * Target url - includes hidden fields * @var moodle_url */ var $url; + /** * Name of the select element. * @var string */ var $name; + /** - * @var array $options associative array value=>label ex.: - * array(1=>'One, 2=>Two) - * it is also possible to specify optgroup as complex label array ex.: - * array(array('Odd'=>array(1=>'One', 3=>'Three)), array('Even'=>array(2=>'Two'))) - * array(1=>'One', '--1uniquekey'=>array('More'=>array(2=>'Two', 3=>'Three'))) + * @var array $options associative array value=>label ex.: array(1=>'One, 2=>Two) + * it is also possible to specify optgroup as complex label array ex.: + * array(array('Odd'=>array(1=>'One', 3=>'Three)), array('Even'=>array(2=>'Two'))) + * array(1=>'One', '--1uniquekey'=>array('More'=>array(2=>'Two', 3=>'Three'))) */ var $options; + /** * Selected option * @var string */ var $selected; + /** * Nothing selected * @var array */ var $nothing; + /** * Extra select field attributes * @var array */ var $attributes = array(); + /** * Button label * @var string */ var $label = ''; + /** * Form submit method * @var string post or get */ var $method = 'get'; + /** * Wrapping div class * @var string * */ var $class = 'singleselect'; + /** * True if button disabled, false if normal * @var boolean */ var $disabled = false; + /** * Button tooltip * @var string */ var $tooltip = null; + /** * Form id * @var string */ var $formid = null; + /** * List of attached actions * @var array of component_action */ var $helpicon = null; + /** * Constructor * @param moodle_url $url form action target, includes hidden fields @@ -664,7 +771,7 @@ class single_select implements renderable { * @param array $nothing * @param string $formid */ - public function __construct(moodle_url $url, $name, array $options, $selected='', $nothing=array(''=>'choosedots'), $formid=null) { + public function __construct(moodle_url $url, $name, array $options, $selected = '', $nothing = array('' => 'choosedots'), $formid = null) { $this->url = $url; $this->name = $name; $this->options = $options; @@ -676,8 +783,8 @@ class single_select implements renderable { /** * Shortcut for adding a JS confirm dialog when the button is clicked. * The message must be a yes/no question. + * * @param string $message The yes/no confirmation question. If "Yes" is clicked, the original action will occur. - * @return void */ public function add_confirm_action($confirmmessage) { $this->add_action(new component_action('submit', 'M.util.show_confirm_dialog', array('message' => $confirmmessage))); @@ -685,8 +792,8 @@ class single_select implements renderable { /** * Add action to the button. + * * @param component_action $action - * @return void */ public function add_action(component_action $action) { $this->actions[] = $action; @@ -694,11 +801,11 @@ class single_select implements renderable { /** * Adds help icon. + * * @param string $page The keyword that defines a help page * @param string $title A descriptive text for accessibility only * @param string $component * @param bool $linktext add extra text to icon - * @return void */ public function set_old_help_icon($helppage, $title, $component = 'moodle') { $this->helpicon = new old_help_icon($helppage, $title, $component); @@ -706,10 +813,9 @@ class single_select implements renderable { /** * Adds help icon. + * * @param string $identifier The keyword that defines a help page * @param string $component - * @param bool $linktext add extra text to icon - * @return void */ public function set_help_icon($identifier, $component = 'moodle') { $this->helpicon = new help_icon($identifier, $component); @@ -717,79 +823,91 @@ class single_select implements renderable { /** * Sets select's label + * * @param string $label - * @return void */ public function set_label($label) { $this->label = $label; } } - /** * Simple URL selection widget description. + * * @copyright 2009 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class url_select implements renderable { /** - * @var array $urls associative array value=>label ex.: - * array(1=>'One, 2=>Two) - * it is also possible to specify optgroup as complex label array ex.: - * array(array('Odd'=>array(1=>'One', 3=>'Three)), array('Even'=>array(2=>'Two'))) - * array(1=>'One', '--1uniquekey'=>array('More'=>array(2=>'Two', 3=>'Three'))) + * @var array $urls associative array value=>label ex.: array(1=>'One, 2=>Two) + * it is also possible to specify optgroup as complex label array ex.: + * array(array('Odd'=>array(1=>'One', 3=>'Three)), array('Even'=>array(2=>'Two'))) + * array(1=>'One', '--1uniquekey'=>array('More'=>array(2=>'Two', 3=>'Three'))) */ var $urls; + /** * Selected option * @var string */ var $selected; + /** * Nothing selected * @var array */ var $nothing; + /** * Extra select field attributes * @var array */ var $attributes = array(); + /** * Button label * @var string */ var $label = ''; + /** * Wrapping div class * @var string * */ var $class = 'urlselect'; + /** * True if button disabled, false if normal * @var boolean */ var $disabled = false; + /** * Button tooltip * @var string */ var $tooltip = null; + /** * Form id * @var string */ var $formid = null; + /** * List of attached actions * @var array of component_action */ var $helpicon = null; + /** * @var string If set, makes button visible with given name for button */ var $showbutton = null; + /** * Constructor * @param array $urls list of options @@ -799,8 +917,7 @@ class url_select implements renderable { * @param string $showbutton Set to text of button if it should be visible * or null if it should be hidden (hidden version always has text 'go') */ - public function __construct(array $urls, $selected='', $nothing=array(''=>'choosedots'), - $formid=null, $showbutton=null) { + public function __construct(array $urls, $selected = '', $nothing = array('' => 'choosedots'), $formid = null, $showbutton = null) { $this->urls = $urls; $this->selected = $selected; $this->nothing = $nothing; @@ -810,11 +927,10 @@ class url_select implements renderable { /** * Adds help icon. + * * @param string $page The keyword that defines a help page * @param string $title A descriptive text for accessibility only * @param string $component - * @param bool $linktext add extra text to icon - * @return void */ public function set_old_help_icon($helppage, $title, $component = 'moodle') { $this->helpicon = new old_help_icon($helppage, $title, $component); @@ -822,10 +938,9 @@ class url_select implements renderable { /** * Adds help icon. + * * @param string $identifier The keyword that defines a help page * @param string $component - * @param bool $linktext add extra text to icon - * @return void */ public function set_help_icon($identifier, $component = 'moodle') { $this->helpicon = new help_icon($identifier, $component); @@ -833,37 +948,43 @@ class url_select implements renderable { /** * Sets select's label + * * @param string $label - * @return void */ public function set_label($label) { $this->label = $label; } } - /** * Data structure describing html link with special action attached. + * * @copyright 2010 Petr Skoda - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - * @since Moodle 2.0 + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class action_link implements renderable { + /** * Href url * @var moodle_url */ var $url; + /** * Link text * @var string HTML fragment */ var $text; + /** * HTML attributes * @var array */ var $attributes; + /** * List of actions attached to link * @var array of component_action @@ -872,14 +993,14 @@ class action_link implements renderable { /** * Constructor - * @param string|moodle_url $url + * @param moodle_url $url * @param string $text HTML fragment * @param component_action $action * @param array $attributes associative array of html link attributes + disabled */ - public function __construct(moodle_url $url, $text, component_action $action=null, array $attributes=null) { - $this->url = clone($url); - $this->text = $text; + public function __construct(moodle_url $url, $text, component_action $action = null, array $attributes = null) { + $this->url = clone($url); + $this->text = $text; $this->attributes = (array)$attributes; if ($action) { $this->add_action($action); @@ -888,13 +1009,17 @@ class action_link implements renderable { /** * Add action to the link. + * * @param component_action $action - * @return void */ public function add_action(component_action $action) { $this->actions[] = $action; } + /** + * Adds a CSS class to this action link object + * @param string $class + */ public function add_class($class) { if (empty($this->attributes['class'])) { $this->attributes['class'] = $class; @@ -904,15 +1029,20 @@ class action_link implements renderable { } } -// ==== HTML writer and helper classes, will be probably moved elsewhere ====== - /** * Simple html output class + * * @copyright 2009 Tim Hunt, 2010 Petr Skoda + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @since Moodle 2.0 + * @package core + * @subpackage output */ class html_writer { + /** * Outputs a tag with attributes and contents + * * @param string $tagname The name of tag ('a', 'img', 'span' etc.) * @param string $contents What goes between the opening and closing tags * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.) @@ -924,6 +1054,7 @@ class html_writer { /** * Outputs an opening tag with attributes + * * @param string $tagname The name of tag ('a', 'img', 'span' etc.) * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.) * @return string HTML fragment @@ -934,6 +1065,7 @@ class html_writer { /** * Outputs a closing tag + * * @param string $tagname The name of tag ('a', 'img', 'span' etc.) * @return string HTML fragment */ @@ -943,6 +1075,7 @@ class html_writer { /** * Outputs an empty tag with attributes + * * @param string $tagname The name of tag ('input', 'img', 'br' etc.) * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.) * @return string HTML fragment @@ -953,6 +1086,7 @@ class html_writer { /** * Outputs a tag, but only if the contents are not empty + * * @param string $tagname The name of tag ('a', 'img', 'span' etc.) * @param string $contents What goes between the opening and closing tags * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.) @@ -967,6 +1101,7 @@ class html_writer { /** * Outputs a HTML attribute and value + * * @param string $name The name of the attribute ('src', 'href', 'class' etc.) * @param string $value The value of the attribute. The value will be escaped with {@link s()} * @return string HTML fragment @@ -990,6 +1125,7 @@ class html_writer { /** * Outputs a list of HTML attributes and values + * * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.) * The values will be escaped with {@link s()} * @return string HTML fragment @@ -1005,8 +1141,11 @@ class html_writer { /** * Generates random html element id. - * @param string $base - * @return string + * + * @staticvar int $counter + * @staticvar type $uniq + * @param type $base + * @return type */ public static function random_id($base='random') { static $counter = 0; @@ -1022,6 +1161,7 @@ class html_writer { /** * Generates a simple html link + * * @param string|moodle_url $url * @param string $text link txt * @param array $attributes extra html attributes @@ -1034,7 +1174,8 @@ class html_writer { } /** - * generates a simple checkbox with optional label + * Generates a simple checkbox with optional label + * * @param string $name * @param string $value * @param bool $checked @@ -1067,10 +1208,11 @@ class html_writer { /** * Generates a simple select yes/no form field + * * @param string $name name of select element * @param bool $selected * @param array $attributes - html select element attributes - * @return string HRML fragment + * @return string HTML fragment */ public static function select_yes_no($name, $selected=true, array $attributes = null) { $options = array('1'=>get_string('yes'), '0'=>get_string('no')); @@ -1079,6 +1221,7 @@ class html_writer { /** * Generates a simple select form field + * * @param array $options associative array value=>label ex.: * array(1=>'One, 2=>Two) * it is also possible to specify optgroup as complex label array ex.: @@ -1090,7 +1233,7 @@ class html_writer { * @param array $attributes - html select element attributes * @return string HTML fragment */ - public static function select(array $options, $name, $selected = '', $nothing = array(''=>'choosedots'), array $attributes = null) { + public static function select(array $options, $name, $selected = '', $nothing = array('' => 'choosedots'), array $attributes = null) { $attributes = (array)$attributes; if (is_array($nothing)) { foreach ($nothing as $k=>$v) { @@ -1148,6 +1291,14 @@ class html_writer { return self::tag('select', $output, $attributes); } + /** + * Returns HTML to display a select box option. + * + * @param string $label The label to display as the option. + * @param string|int $value The value the option represents + * @param array $selected An array of selected options + * @return string HTML fragment + */ private static function select_option($label, $value, array $selected) { $attributes = array(); $value = (string)$value; @@ -1158,6 +1309,14 @@ class html_writer { return self::tag('option', $label, $attributes); } + /** + * Returns HTML to display a select box option group. + * + * @param string $groupname The label to use for the group + * @param array $options The options in the group + * @param array $selected An array of selected values. + * @return string HTML fragment. + */ private static function select_optgroup($groupname, $options, array $selected) { if (empty($options)) { return ''; @@ -1172,6 +1331,7 @@ class html_writer { /** * This is a shortcut for making an hour selector menu. + * * @param string $type The type of selector (years, months, days, hours, minutes) * @param string $name fieldname * @param int $currenttime A default timestamp in GMT @@ -1179,7 +1339,7 @@ class html_writer { * @param array $attributes - html select element attributes * @return HTML fragment */ - public static function select_time($type, $name, $currenttime=0, $step=5, array $attributes=null) { + public static function select_time($type, $name, $currenttime = 0, $step = 5, array $attributes = null) { if (!$currenttime) { $currenttime = time(); } @@ -1236,14 +1396,15 @@ class html_writer { /** * Shortcut for quick making of lists + * + * Note: 'list' is a reserved keyword ;-) + * * @param array $items - * @param string $tag ul or ol * @param array $attributes + * @param string $tag ul or ol * @return string */ public static function alist(array $items, array $attributes = null, $tag = 'ul') { - //note: 'list' is a reserved keyword ;-) - $output = ''; foreach ($items as $item) { @@ -1257,6 +1418,7 @@ class html_writer { /** * Returns hidden input fields created from url parameters. + * * @param moodle_url $url * @param array $exclude list of excluded parameters * @return string HTML fragment @@ -1280,7 +1442,7 @@ class html_writer { * Generate a script tag containing the the specified code. * * @param string $js the JavaScript code - * @param moodle_url|string optional url of the external script, $code ignored if specified + * @param moodle_url|string optional url of the external script, $code ignored if specified * @return string HTML, the code wrapped in