function views_tabset::add in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 6.2 includes/tabs.inc \views_tabset::add()
Add a tab to the tabset.
Parameters
$name: The name of the tab; this is the internal identifier and must be unique within the tabset.
$title: If given, this will be the visible title of the tab. This can also be set via $tabset->set(). This will be the link to click on to view the tab.
$body: If given, this is the body of the tab itself. It will display when the tab title is clicked on.
2 calls to views_tabset::add()
- views_tabset::set in includes/
tabs.inc - Set the values of a tab.
- views_tabset::set_body in includes/
tabs.inc - Set the body of a tab.
File
- includes/
tabs.inc, line 35 - Classes and theme functions for rendering javascript UI tabs.
Class
- views_tabset
- Contain a set of tabs as well as the ability to render them.
Code
function add($name, $title = '', $body = '') {
if (is_object($name) && is_subclass_of($name, 'views_tab')) {
$this
->add_tab($name);
}
elseif (is_array($name)) {
foreach ($name as $real_tab) {
$this
->add($real_tab);
}
}
else {
$this
->add_tab(new views_tab($name, $title, $body));
}
}