Constructor
mr_html_tabs
__construct
([moodle_url $url = NULL], [string $component = ''])
-
moodle_url
$url: Base URL for the tabs
-
string
$component: Default get string component key
Add a top level tab
mr_html_tabs
add
(
string $id,
mixed $url, [
string $name =
NULL], [
int $weight =
0], [
boolean $visible =
true], [
string $title =
''], [
boolean $linkedwhenselected =
true])
-
string
$id: Tab ID, must be unique
-
mixed
$url: Either a full string URL or an array of paramaters to pass to $this->url
-
string
$name: The tab display name
-
int
$weight: The weight, tabs will be sorted by this
-
boolean
$visible: If the tab is visible, EG: pass result of a has_capability() call here
-
string
$title: The alt text of the tab
-
boolean
$linkedwhenselected: Keep the tab clickable when selected
Add a sub tab
mr_html_tabs
add_subtab
(
string $parentid,
string $id,
mixed $url, [
string $name =
NULL], [
int $weight =
0], [
boolean $visible =
true], [
string $title =
''], [
boolean $linkedwhenselected =
true])
-
string
$parentid: The top level tab ID that this sub tab belongs
-
string
$id: Tab ID, must be unique
-
mixed
$url: Either a full string URL or an array of paramaters to pass to $this->url
-
string
$name: The tab display name.
-
int
$weight: The weight, tabs will be sorted by this
-
boolean
$visible: If the tab is visible, EG: pass result of a has_capability() call here
-
string
$title: The alt text of the tab
-
boolean
$linkedwhenselected: Keep the tab clickable when selected
Based on the current $tobtab, return the tab row or rows.
array
get_rows
()
Set the current tab
mr_html_tabs
set
([
string $toptab =
''], [
string $subtab =
''])
-
string
$toptab: The toptab index key
-
string
$subtab: The subtab index key
Simple interface: Adds a sub tab
mr_html_tabs
subtab
(
string $id, [
mixed $url =
array()], [
boolean $visible =
true], [
string $toptabid =
NULL])
-
string
$id: The unique sub tab ID
-
mixed
$url: moodle_url or an array of params
-
boolean
$visible: If the tab is visible to the user or not
-
string
$toptabid: The top tab's ID that the sub tab belongs to (defaults to the last top tab's ID)
Simple interface: Adds a top tab
mr_html_tabs
toptab
(
string $id, [
mixed $url =
array()], [
boolean $visible =
true])
-
string
$id: The unique top tab ID
-
mixed
$url: moodle_url or an array of params
-
boolean
$visible: If the tab is visible to the user or not