Class mr_html_tabs

Description

MR HTML Tabs

Manage tabs and their sub tabs.

  • author: Mark Nielsen
  • example: example

Located in /html/tabs.php (line 35)


	
			
Variable Summary
string $component
string $lasttoptabid
string $subtab
array $tabs
string $toptab
moodle_url $url
Method Summary
mr_html_tabs __construct ([moodle_url $url = NULL], [string $component = ''])
mr_html_tabs add (string $id, mixed $url, [string $name = NULL], [int $weight = 0], [boolean $visible = true], [string $title = ''], [boolean $linkedwhenselected = true])
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])
array get_rows ()
mr_html_tabs set ([string $toptab = ''], [string $subtab = ''])
mr_html_tabs subtab (string $id, [mixed $url = array()], [boolean $visible = true], [string $toptabid = NULL])
mr_html_tabs toptab (string $id, [mixed $url = array()], [boolean $visible = true])
Variables
string $component = '' (line 55)

Get string component key

  • access: protected
string $lasttoptabid = '' (line 76)

The last toptab set

  • access: protected
string $subtab = '' (line 69)

Currently selected subtab index

  • access: public
array $tabs = array('__parents__' => array()) (line 41)

An array of tabobjects

  • access: protected
string $toptab = '' (line 62)

Currently selected toptab index

  • access: public
moodle_url $url (line 48)

Base URL for tabs

  • access: protected
Methods
Constructor __construct (line 84)

Constructor

  • access: public
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 (line 141)

Add a top level tab

  • access: public
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_subtab (line 159)

Add a sub tab

  • throws: coding_exception
  • access: public
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
get_rows (line 108)

Based on the current $tobtab, return the tab row or rows.

  • access: public
array get_rows ()
set (line 96)

Set the current tab

  • access: public
mr_html_tabs set ([string $toptab = ''], [string $subtab = ''])
  • string $toptab: The toptab index key
  • string $subtab: The subtab index key
subtab (line 208)

Simple interface: Adds a sub tab

  • throws: coding_exception
  • access: public
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)
toptab (line 194)

Simple interface: Adds a top tab

  • throws: coding_exception
  • access: public
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

Documentation generated on Thu, 28 Jun 2012 16:33:52 -0700 by phpDocumentor 1.4.3