Use in conjunction with DLSupportJS.Tab to hanlde a tab collection.
| DLTab | Use in conjunction with DLSupportJS.Tab to hanlde a tab collection. |
| Private Data | |
| $content_wrapper | (string) The ID of the content wrapper. |
| $tab_wrapper | (string) The ID of the tab wrapper. |
| $tabs | (array) An array containing all of tabs and their content. |
| Class Construction | |
| __construct | Create a new instance of DLTab. |
| Tab Management | |
| AddTab | Add a new tab to the list of tabs. |
| HTML Retrieval | |
| GetAllHTML | Get all of the HTML. |
| GetContentHTML | Retrieve the HTML for the Contents. |
| GetJavaScript | Get the HTML for the initialization of the script. |
| GetTabHTML | Retrieve the HTML for the Tabs. |
private $tabs
(array) An array containing all of tabs and their content.
The array has the following structure
array(
{id of tab} => Array (
tab_id => {
(string) The ID of the tab.
},
name => {
(string) The title of the tab.
},
data => {
(string) The data for the content of the tab.
},
is_link => {
(boolean) Whether or not the data is a link.
},
load_once => {
(boolean) Whether link should only be loaded once.
}
),
...
)
public function AddTab( $id, $name, $data, $options = array() )
Add a new tab to the list of tabs.
| $id | (string) The ID of the tab. Set this to an empty string to have an ID automatically generated for it. |
| $name | (string) The title of the tab. |
| $data | (string) The data for the content of the tab. |
| $options | (array) An associative array containing various options used by this method. Defaults to an empty array. |
The structure of the $options parameter, if given, should look like the following:
array(
link => {
(boolean) If this is set to TRUE, then the given *$data*
should be the URL for which the content should be retrieved.
Defaults to FALSE.
},
once => {
(boolean) If this is set to TRUE and if the option *link* is
also TRUE, then the content will only be fetched once.
Defaults to FALSE.
}
)
public function GetJavaScript( $name = '', $default = '' )
Get the HTML for the initialization of the script.
Note that this does not include the actual source code itself as that should have already been loaded via DLSupportJS.
| $name | (string) Optional and defaults to an empty string. The tab collection name. Leave it as an empty string to use a randomly generated string. |
| $default | (string) Optional and defaults to an empty string. The ID of the tab that should be first shown to the user. Leave it as an empty string to use the first tab declared. |
(string) The HTML for the JavaScript initialization.
(string) The ID of the content wrapper.
private $content_wrapper
(string) The ID of the tab wrapper.
private $tab_wrapper
(array) An array containing all of tabs and their content.
private $tabs
Create a new instance of DLTab.
public function __construct( $tab_wrapper, $content_wrapper )
Add a new tab to the list of tabs.
public function AddTab( $id, $name, $data, $options = array() )
Get all of the HTML.
public function GetAllHTML()
Retrieve the HTML for the Contents.
public function GetContentHTML()
Get the HTML for the initialization of the script.
public function GetJavaScript( $name = '', $default = '' )
Retrieve the HTML for the Tabs.
public function GetTabHTML()