infoBarHasBeenCalled = true;
if(!$message)
{
if($type == 'edited')
{
$message = translate('Your changes have been saved');
}
else if($type == 'deleted')
{
$message = translate('The selected item has been deleted');
}
else if($type == 'created')
{
$message = translate('The item has been created');
}
else if($type == 'moved')
{
$message = translate('The item was moved');
}
else if($type == 'activated')
{
$message = translate('The item was activated');
}
else if($type == 'deactivated')
{
$message = translate('The item was de-activated');
}
else
{
return false;
}
}
$this->tpl->define('infobar',$message);
$this->tpl->parse('infobar');
return true;
}
public function output($tplfile='wrapper.html')
{
$totaltime = microtime() - START;
$this->tpl = new TemplateParser;
$this->tpl->load($tplfile);
if(!$this->infoBarHasBeenCalled)
{
$this->displayInfoBar(false,$_REQUEST['info']);
}
$this->tpl->define("title", $this->pageDetails->outTitle());
$this->tpl->define("location", $this->pageDetails->outCrumbs());
$this->tpl->define("main content", $this->content);
$this->tpl->define("content", $this->content);
$this->tpl->define("BASEURL", BASEURL);
$this->tpl->define("COPYRIGHT", '© ' . WEBSITE_NAME . ' - Powered by ClanCommandCenter (exec: ' . $totaltime . ', queries: ' . $this->db->count . ') - Hosted by Hostgator');
$this->tpl->define("TEMPLATE", TPL);
$this->tpl->define('username',safeoutput($this->user['username']));
$this->tpl->define("VERSION", VERSION);
$this->tpl->define('DATE',getlocaldate('d M Y, H:i'));
// make a tab for each module
// this array can be overwritten by a module :)
foreach($this->pageDetails->adminTabs as $tab)
{
if(is_array($tab['sub']))
{
foreach($tab['sub'] as $subtab)
{
$subtab['name'] = translate($subtab['name']);
$pieces = explode('&',$subtab['url']);
$action = false;
foreach($pieces as $piece)
{
$piece = '&' . $piece;
if(substr_count($piece,'&action=') == 1)
{
$action = str_replace('&action=','',$piece);
break;
}
}
if($_GET['action'] == $action)
{
$subtab['name'] = '' . $subtab['name'] . '';
}
$this->tpl->define('name', $subtab['name']);
$this->tpl->define('url', $subtab['url']);
$this->tpl->parse('subtab');
if($tab['module'] == $_GET['module'])
{
$this->tpl->parse('activesubtab');
}
}
}
if($tab['module'] == $_GET['module']) $this->tpl->define('state','');
else $this->tpl->define('state','non');
$this->tpl->define('name',$tab['name']);
$this->tpl->define('url',$tab['url']);
$this->tpl->parse('tab');
}
// pages?
$pages = $this->pageDetails->pages;
if(!empty($pages))
{
$this->tpl->define("pages", $pages);
$this->tpl->parse("pages");
}
print $this->tpl->publish();
ob_end_flush();
exit;
}
}