<?php
/**
* @package phlyMail Nahariya 4.0+, Branch MessageCenter
* @subpackage Handler Core
* @copyright 2001-2010 phlyLabs, Berlin (http://phlylabs.de)
* @version 0.2.8 2010-09-06
*/
// Only valid within phlyMail
if (!defined('_IN_PHM_')) die();
class topbuttonbar_core
{
public function __construct(&$_PM_)
{
global $WP_msg;
$passthru = give_passthrough(1);
if (!isset($_SESSION['phM_uniqe_handlers']['core']['i18n'])) {
$_SESSION['phM_uniqe_handlers']['core']['i18n'] = 'Core';
}
$this->tpl = new fxl_cached_template($_PM_['path']['frontend'].'/templates/topbuttonbar.core.tpl', $_PM_['path']['tplcache'].'topbuttonbar.core.tpl');
$smsactive = (isset($_PM_['core']['sms_feature_active']) && $_PM_['core']['sms_feature_active']);
if ($smsactive) {
$smsactive = (isset($_PM_['core']['sms_active']) && $_PM_['core']['sms_active']);
$faxactive = ((isset($_PM_['core']['fax_default_active']) && $_PM_['core']['fax_default_active'])
|| (isset($_PM_['core']['fax_active']) && $_PM_['core']['fax_active']));
}
// Permissions
if ($_SESSION['phM_privs']['all'] || ($_SESSION['phM_privs']['core_new_email'] && $_SESSION['phM_privs']['email_see_emails'])) {
$this->tpl->assign_block('has_new_email');
}
if ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['core_new_sms']) {
if ($smsactive) $this->tpl->assign_block('smsactive');
}
if ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['core_new_fax']) {
$gwoptions = parse_ini_file($_PM_['path']['msggw'].'/'.$_PM_['core']['sms_use_gw'].'/settings.ini.php');
if (!isset($gwoptions['has_fax']) || !$gwoptions['has_fax']) $faxactive = false;
if ($faxactive) $this->tpl->assign_block('faxactive');
}
if ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['core_setup_settings']) {
if (isset($_PM_['core']['allow_user_setup']) && $_PM_['core']['allow_user_setup']) {
$this->tpl->assign_block('usersetup');
}
}
if ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['email_add_profile'] || $_SESSION['phM_privs']['email_edit_profile']) {
if (isset($_PM_['core']['conf_acc']) && $_PM_['core']['conf_acc']) {
$this->tpl->assign_block('profiles');
}
}
if (isset($_PM_['core']['showlinkconfig']) && $_PM_['core']['showlinkconfig']) {
$this->tpl->assign_block('showlinkconfig');
}
if (isset($_PM_['core']['logincheckupdates']) && $_PM_['core']['logincheckupdates']) {
$this->tpl->fill_block('logincheckupdates', array
('url_logincheckupdates' => PHP_SELF.'?load=worker&handler=core&'.$passthru.'&what=logincheckupdates'
,'head_update' => $WP_msg['CoreChkUpdHead']
,'title_update' => $WP_msg['CoreChkUpdTitle']
,'about_update' => $WP_msg['CoreChkUpdBody']
));
}
$this->tpl->assign(array
('handler' => $_PM_['handler']['name']
,'msg_about' => $WP_msg['About']
,'msg_newemail' => $WP_msg['NewEmail']
,'msg_newsms' => $WP_msg['NewSMS']
,'msg_newfax' => $WP_msg['NewFax']
,'msg_logout' => $WP_msg['alt_logout']
,'msg_gotoconfig' => $WP_msg['CoreGoToConfig']
,'msg_setup_programme' => $WP_msg['SetupProgramme']
,'msg_setup_pop3_accounts' => $WP_msg['accounts']
,'msg_showfavfolderss' => $WP_msg['CoreShowFavourites']
,'msg_showfolderlist' => $WP_msg['CoreShowFolderlist']
,'msg_shownamepane' => $WP_msg['CoreShowNamePane']
,'checkquota_url' => PHP_SELF.'?load=worker&handler=core&'.$passthru.'&what=get_quota_state'
));
return true;
}
public function get()
{
return $this->tpl;
}
}
?>