|
Moodle
2.2.1
http://www.collinsharper.com
|
Static Public Member Functions | |
| static | tag ($tagname, $contents, array $attributes=null) |
| static | start_tag ($tagname, array $attributes=null) |
| static | end_tag ($tagname) |
| static | empty_tag ($tagname, array $attributes=null) |
| static | nonempty_tag ($tagname, $contents, array $attributes=null) |
| static | attribute ($name, $value) |
| static | attributes (array $attributes=null) |
| static | random_id ($base='random') |
| static | link ($url, $text, array $attributes=null) |
| static | checkbox ($name, $value, $checked=true, $label= '', array $attributes=null) |
| static | select_yes_no ($name, $selected=true, array $attributes=null) |
| static | select (array $options, $name, $selected= '', $nothing=array(''=>'choosedots'), array $attributes=null) |
| static | select_time ($type, $name, $currenttime=0, $step=5, array $attributes=null) |
| static | alist (array $items, array $attributes=null, $tag= 'ul') |
| static | input_hidden_params (moodle_url $url, array $exclude=null) |
| static | script ($jscode, $url=null) |
| static | table (html_table $table) |
| static | label ($text, $for, $colonize=true, array $attributes=array()) |
Simple html output class
Definition at line 913 of file outputcomponents.php.
Shortcut for quick making of lists
| array | $items | |
| string | $tag | ul or ol |
| array | $attributes |
Definition at line 1244 of file outputcomponents.php.


| static attribute | ( | $ | name, |
| $ | value | ||
| ) | [static] |
Outputs a HTML attribute and value
| string | $name | The name of the attribute ('src', 'href', 'class' etc.) |
| string | $value | The value of the attribute. The value will be escaped with s() |
Definition at line 974 of file outputcomponents.php.


| static attributes | ( | array $ | attributes = null | ) | [static] |
Outputs a list of HTML attributes and values
| array | $attributes | The tag attributes (array('src' => $url, 'class' => 'class1') etc.) The values will be escaped with s() |
Definition at line 997 of file outputcomponents.php.


| static checkbox | ( | $ | name, |
| $ | value, | ||
| $ | checked = true, |
||
| $ | label = '', |
||
| array $ | attributes = null |
||
| ) | [static] |
generates a simple checkbox with optional label
| string | $name | |
| string | $value | |
| bool | $checked | |
| string | $label | |
| array | $attributes |
Definition at line 1045 of file outputcomponents.php.


Outputs an empty tag with attributes
| string | $tagname | The name of tag ('input', 'img', 'br' etc.) |
| array | $attributes | The tag attributes (array('src' => $url, 'class' => 'class1') etc.) |
Definition at line 950 of file outputcomponents.php.

| static end_tag | ( | $ | tagname | ) | [static] |
Outputs a closing tag
| string | $tagname | The name of tag ('a', 'img', 'span' etc.) |
Definition at line 940 of file outputcomponents.php.
| static input_hidden_params | ( | moodle_url $ | url, |
| array $ | exclude = null |
||
| ) | [static] |
Returns hidden input fields created from url parameters.
| moodle_url | $url | |
| array | $exclude | list of excluded parameters |
Definition at line 1264 of file outputcomponents.php.


Renders form element label
By default, the label is suffixed with a label separator defined in the current language pack (colon by default in the English lang pack). Adding the colon can be explicitly disabled if needed. Label separators are put outside the label tag itself so they are not read by screenreaders (accessibility).
Parameter $for explicitly associates the label with a form control. When set, the value of this attribute must be the same as the value of the id attribute of the form control in the same document. When null, the label being defined is associated with the control inside the label element.
| string | $text | content of the label tag |
| string | null | $for | id of the element this label is associated with, null for no association |
| bool | $colonize | add label separator (colon) to the label text, if it is not there yet |
| array | $attributes | to be inserted in the tab, for example array('accesskey' => 'a') |
Definition at line 1548 of file outputcomponents.php.


Generates a simple html link
| string | moodle_url | $url | |
| string | $text | link txt |
| array | $attributes | extra html attributes |
Definition at line 1030 of file outputcomponents.php.

| static nonempty_tag | ( | $ | tagname, |
| $ | contents, | ||
| array $ | attributes = null |
||
| ) | [static] |
Outputs a tag, but only if the contents are not empty
| string | $tagname | The name of tag ('a', 'img', 'span' etc.) |
| string | $contents | What goes between the opening and closing tags |
| array | $attributes | The tag attributes (array('src' => $url, 'class' => 'class1') etc.) |
Definition at line 961 of file outputcomponents.php.


| static random_id | ( | $ | base = 'random' | ) | [static] |
Generates random html element id.
| string | $base |
Definition at line 1011 of file outputcomponents.php.

| static script | ( | $ | jscode, |
| $ | url = null |
||
| ) | [static] |
Generate a script tag containing the the specified code.
| string | $js | the JavaScript code |
| moodle_url|string | optional url of the external script, $code ignored if specified |
Definition at line 1286 of file outputcomponents.php.


| static select | ( | array $ | options, |
| $ | name, | ||
| $ | selected = '', |
||
| $ | nothing = array(''=>'choosedots'), |
||
| array $ | attributes = null |
||
| ) | [static] |
Generates a simple select form field
| 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'))) |
| string | $name | name of select element |
| string | array | $selected | value or array of values depending on multiple attribute |
| array | bool | $nothing,add | nothing selected option, or false of not added |
| array | $attributes | - html select element attributes |
Add 'select' selector always
Definition at line 1093 of file outputcomponents.php.


| static select_time | ( | $ | type, |
| $ | name, | ||
| $ | currenttime = 0, |
||
| $ | step = 5, |
||
| array $ | attributes = null |
||
| ) | [static] |
This is a shortcut for making an hour selector menu.
| string | $type | The type of selector (years, months, days, hours, minutes) |
| string | $name | fieldname |
| int | $currenttime | A default timestamp in GMT |
| int | $step | minute spacing |
| array | $attributes | - html select element attributes |
Definition at line 1182 of file outputcomponents.php.


| static select_yes_no | ( | $ | name, |
| $ | selected = true, |
||
| array $ | attributes = null |
||
| ) | [static] |
Generates a simple select yes/no form field
| string | $name | name of select element |
| bool | $selected | |
| array | $attributes | - html select element attributes |
Definition at line 1075 of file outputcomponents.php.


Outputs an opening tag with attributes
| string | $tagname | The name of tag ('a', 'img', 'span' etc.) |
| array | $attributes | The tag attributes (array('src' => $url, 'class' => 'class1') etc.) |
Definition at line 931 of file outputcomponents.php.

| static table | ( | html_table $ | table | ) | [static] |
Renders HTML table
This method may modify the passed instance by adding some default properties if they are not set yet. If this is not what you want, you should make a full clone of your data before passing them to this method. In most cases this is not an issue at all so we do not clone by default for performance and memory consumption reasons.
| html_table | $table | data to be rendered |
Definition at line 1311 of file outputcomponents.php.


Outputs a tag with attributes and contents
| string | $tagname | The name of tag ('a', 'img', 'span' etc.) |
| string | $contents | What goes between the opening and closing tags |
| array | $attributes | The tag attributes (array('src' => $url, 'class' => 'class1') etc.) |
Definition at line 921 of file outputcomponents.php.
