⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
Core
/
Ui
/
View File Name :
Tabs.php
* Copyright 2003-2017 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.horde.org/licenses/lgpl21. * * @author Jason M. Felice
* @author Jan Schneider
* @category Horde * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package Core */ class Horde_Core_Ui_Tabs extends Horde_Core_Ui_Widget { /** * The array of tabs. * * @var array */ protected $_tabs = array(); /** * Adds a tab to the interface. * * @param string $title The text which appears on the tab. * @param Horde_Url $link The target page. * @param mixed $params 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); } /** * Returns the title of the tab with the specified name. * * @param string $tabname The name of the tab. * * @return string The tab's title. */ public function getTitleFromAction($tabname) { foreach ($this->_tabs as $tab) { if ($tab['tabname'] == $tabname) { return $tab['title']; } } return null; } /** * Renders the tabs. * * @param string $active_tab If specified, the name of the active tab. If * not, the active tab is determined * automatically. * @param string $class The CSS class of the tabset. */ public function render($active_tab = null, $class = 'tabset') { $html = "
\n"; $active = $_SERVER['PHP_SELF'] . $this->_vars->get($this->_name); foreach ($this->_tabs as $tab) { $link = $this->_addPreserved($tab['link']); if (!is_null($this->_name) && !is_null($tab['tabname'])) { $link->add($this->_name, $tab['tabname']); } $classes = array(); if (isset($tab['class'])) { $classes[] = $tab['class']; } if ((!is_null($active_tab) && (string)$active_tab == (string)$tab['tabname']) || ($active == $tab['link'] . $tab['tabname'])) { $classes[] = 'horde-active'; } $class = $classes ? (' class="' . implode(' ', $classes) . '"') : ''; $id = ''; if (!empty($tab['id'])) { $id = ' id="' . htmlspecialchars($tab['id']) . '"'; } if (!isset($tab['target'])) { $tab['target'] = ''; } if (!isset($tab['onclick'])) { $tab['onclick'] = ''; } $accesskey = Horde::getAccessKey($tab['title']); if (!empty($tab['img'])) { $img = Horde_Themes_Image::tag($tab['img']); } else { $img = ''; } $html .= '
' . $link->link(array('target' => $tab['target'], 'onclick' => $tab['onclick'], 'accesskey' => $accesskey)) . $img . Horde::highlightAccessKey(str_replace(' ', ' ', $tab['title']), $accesskey) . "
\n"; } return $html . "
\n"; } }