tabsexample.module in Javascript Tools 5
File
tabs/docs/tabsexample.module
View source
<?php
function tabsexample_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'tabsexample',
'title' => t('tabs example'),
'callback' => 'tabs_render',
'callback arguments' => array(
tabsexample_form(),
),
'access' => TRUE,
'type' => MENU_CALLBACK,
);
}
return $items;
}
function tabsexample_form() {
$form = array();
$form['example1'] = array(
'#type' => 'tabset',
);
$form['example1']['tab1'] = array(
'#type' => 'tabpage',
'#title' => t('One'),
'#content' => t('First tab content.'),
);
$form['example1']['tab2'] = array(
'#type' => 'tabpage',
'#title' => t('Two'),
'#content' => t('Second tab content.'),
);
$form['example1']['tab2']['tabset2'] = array(
'#type' => 'tabset',
);
$form['example1']['tab2']['tabset2']['tab1'] = array(
'#type' => 'tabpage',
'#title' => t('One'),
'#content' => t('First tab content.'),
);
$form['example1']['tab2']['tabset2']['tab2'] = array(
'#type' => 'tabpage',
'#title' => t('Two'),
'#content' => t('Second tab content.'),
);
$form['example1']['tab3'] = array(
'#type' => 'tabpage',
'#title' => t('Three'),
'#content' => t('Third tab content.'),
);
return $form;
}