Quote:
Originally Posted by j1gg
|
includes/system-functions.php LINE: 137-196
PHP Code:
/**
* Adds a tab to the page
*
* @param string $title The title of the tab
* @param string $utl The link of the tab
* @param boolean $active Is the tab active?
* @return noreturn
*/
function AddTab($title, $url, $desc, $active=false)
{
global $tabs;
$tab_arr = array();
$tab_arr[0] = "Home";
$tab_arr[1] = "Servers";
$tab_arr[2] = " BanList ";
$tab_arr[3] = "Mute/GaG";
$tab_arr[4] = "CtBans";
$tab_arr[5] = "Web";
$tabs = array();
$tabs['title'] = $title;
$tabs['url'] = $url;
$tabs['desc'] = $desc;
if ($_GET['p'] == "default" && $title == $tab_arr[intval($GLOBALS['config']['config.defaultpage'])]) {
$tabs['active'] = true;
$GLOBALS['pagetitle'] = $title;
} else {
if ($_GET['p'] != "default" && substr($url, 12) == $_GET['p']) {
$tabs['active'] = true;
$GLOBALS['pagetitle'] = $title;
} else {
$tabs['active'] = false;
}
}
include TEMPLATES_PATH . "/tab.php";
}
/**
* Displays the pagetabs
*
* @return noreturn
*/
function BuildPageTabs()
{
global $userbank;
AddTab("Home", "index.php?p=home", "This page shows an overview of your bans and servers.");
AddTab("Servers", "index.php?p=servers", "All of your servers and their status can be viewed here");
AddTab("Bans", "index.php?p=banlist", "All of the bans in the database can be viewed from here.");
if ($GLOBALS['config']['config.enablecomms'] == "1") {
AddTab("Mute/GaG", "index.php?p=commslist", "All of the communication bans (such as chat gags and voice mutes) in the database can be viewed from here.");
}
if ($GLOBALS['config']['config.enablesubmit']=="1") {
AddTab("CtBans", "https://overgame.eu/ctbans.php", "List of CtBans");
}
if ($GLOBALS['config']['config.enableprotest']=="1") {
AddTab("Web", "https://overgame.eu", "Our website.");
}
if ($userbank->is_admin()) {
AddTab(" Admin Panel ", "index.php?p=admin", "This is the control panel for SourceBans where you can setup new admins, add new server, etc.");
}
__________________