/** * Load the internal account */ public function loadInternalAccount() { $emI = $this->core->getInternalDatabase()->getEntityManager(); $this->currentInternalAccount = $emI->getRepository('\\Quantum\\DBO\\InternalAccount')->findOneBy(array('accountId' => $this->currentAccount->getId())); if ($this->currentInternalAccount == null) { return; } // Load groups $userGroups = $emI->getRepository('\\Quantum\\DBO\\UserGroup')->findBy(array('userId' => $this->currentInternalAccount->getId())); /** @var $userGroup UserGroup */ foreach ($userGroups as $userGroup) { $this->groups[] = $emI->find('\\Quantum\\DBO\\Group', $userGroup->getGroupId()); } // Load privileges /** @var $group Group */ foreach ($this->groups as $group) { $groupPrivileges = $emI->getRepository('\\Quantum\\DBO\\GroupPrivilege')->findBy(array('groupId' => $group->getId())); /** @var $groupPrivilege GroupPrivilege */ foreach ($groupPrivileges as $groupPrivilege) { /** @var $privilege Privilege */ $privilege = $emI->find('\\Quantum\\DBO\\Privilege', $groupPrivilege->getId()); $this->stringPrivileges[] = $privilege->getTechnicalName(); $this->privileges[] = $privilege; } } }
function smarty_block_lang($params, $content, Smarty_Internal_Template $template, &$repeat) { if (!$repeat) { if (isset($content)) { return \TeamManager\Core::getInstance()->getTranslator()->translate($content); } } return ''; }
/** * Core constructor. */ public function __construct() { $this->initDefines(); //$this->setSettings(); == initConfiguration $this->initConfiguration(); //$this->isMaintenance(); $this->initExceptionHandler(); $this->initSmarty(); $this->initDatabases(); $this->initTranslator(); $this->initUserManager(); $this->initApp(); // TODO: maintenance == TRUE -> smarty if ($this->settings['page_settings']['maintenance'] === TRUE) { header('HTTP/1.1 503 Service Unavailable'); $this->smarty->assign('maintenance', 1); } Core::$instance = $this; }
public function format($value) { $val = intval($value); return number_format($val, 0, Core::getInstance()->getTranslator()->translate('system.number.dec'), Core::getInstance()->getTranslator()->translate('system.number.thousand')); }
function smarty_function_recaptcha($params, Smarty_Internal_Template $template) { return \TeamManager\Core::getInstance()->getRecaptchaHtml(); }
public function _404() { $this->core->displayNotFound(); }