You are here

tabsexample.module in Javascript Tools 5

File

tabs/docs/tabsexample.module
View source
<?php

/**
 * Implementation of hook_menu().
 */
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;
}

/**
 * Generate an example set of tabs.
 */
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;
}

Functions

Namesort descending Description
tabsexample_form Generate an example set of tabs.
tabsexample_menu Implementation of hook_menu().