Horde_Core_Ui_Tabs::addTab PHP Method

addTab() public method

Adds a tab to the interface.
public addTab ( string $title, Horde_Url $link, mixed $params = [] )
$title string The text which appears on the tab.
$link Horde_Url The target page.
$params mixed Either a string value to set the tab variable to, or a hash of parameters. If an array, the tab variable can be set by the 'tabname' key.
    public function addTab($title, $link, $params = array())
    {
        if (!is_array($params)) {
            $params = array('tabname' => $params);
        }
        $this->_tabs[] = array_merge(array('title' => $title, 'link' => $link->copy(), 'tabname' => null, 'img' => null, 'class' => null), $params);
    }

Usage Example

Esempio n. 1
0
 /**
  * Creates tabs to navigate the user manager area.
  *
  * @return Horde_Core_Ui_Tabs
  */
 public static function getUserMgrTabs(Variables $vars)
 {
     $url = Horde::url('users/index.php');
     $tabs = new Horde_Core_Ui_Tabs('section', $vars);
     foreach (Vilma::getUserMgrTypes() as $section => $desc) {
         $tabs->addTab($desc['plural'], $url, $section);
     }
     return $tabs;
 }
All Usage Examples Of Horde_Core_Ui_Tabs::addTab