/** * @param string $sTab * @param ap_Screen $oScreen */ protected function initStandardMenuByTab($sTab, ap_Screen &$oScreen) { switch ($sTab) { case AP_TAB_SYSTEM: $this->JsAddFile('system.js'); $oScreen->AddMenuItem(WM_MODE_LOGGING, WM_MODE_LOGGING_NAME, $this->sPath . '/templates/logging.php', array()); $oScreen->SetDefaultMode(WM_MODE_LOGGING); break; } }
/** * @param CAdminPanel $oAdminPanel * @return ap_Simple_Screen */ public function __construct(CAdminPanel &$oAdminPanel, $sGlobalTemplateName, $aData = array()) { parent::__construct($oAdminPanel, CAdminPanel::RootPath() . 'core/templates/' . $sGlobalTemplateName); foreach ($aData as $sKey => $sText) { $this->Data->SetValue($sKey, $sText); } }
/** * @param CAdminPanel $oAdminPanel * @return ap_Standard_Screen */ public function __construct(CAdminPanel &$oAdminPanel) { parent::__construct($oAdminPanel, CAdminPanel::RootPath() . 'core/templates/standard.php'); $this->CssAddFile('static/styles/screens/standard.css'); $this->aMenu = array(); $this->sMode = ''; $this->aMenuDefMode = ''; }
/** * @return ap_Screen_Standard */ function ap_Screen_Standard() { ap_Screen::ap_Screen(); }
/** * @param string $sTab * @param ap_Screen $oScreen */ protected function initTableList($sTab, ap_Screen &$oScreen) { if (AP_TAB_DOMAINS === $sTab) { $iTenantId = $this->oAdminPanel->RType() ? $this->oAdminPanel->TenantId() : 0; $sSearchDesc = $oScreen->GetSearchDesc(); $iAllCount = $this->oDomainsApi->getDomainCount($sSearchDesc, $iTenantId); $oScreen->EnableSearch($iAllCount > 1 || $sSearchDesc); $bAddDefaultDomain = false; if (0 === $iTenantId && $this->oAdminPanel->HasAccessDomain(0)) { $iAllCount += ceil($iAllCount / ($oScreen->GetLinesPerPage() - 1)); $bAddDefaultDomain = true; $oScreen->AddListItem(0, array('Name' => CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT')), true); } $oScreen->SetAllListCount($iAllCount); $aDomainsList = $this->oDomainsApi->getDomainsList($oScreen->GetPage(), $bAddDefaultDomain ? $oScreen->GetLinesPerPage() - 1 : $oScreen->GetLinesPerPage(), $oScreen->GetOrderBy(), $oScreen->GetOrderType(), $sSearchDesc, $iTenantId); if (is_array($aDomainsList) && 0 < count($aDomainsList)) { foreach ($aDomainsList as $iDomainId => $aDomainArray) { if ($this->oAdminPanel->HasAccessDomain($iDomainId)) { $sName = isset($aDomainArray[1]) ? $aDomainArray[1] : ''; if (strpos($sName, '*') !== false) { $oTenant = null; if ($iTenantId === 0) { $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); if ($oDomain) { if ($oDomain->IsDefaultTenantDomain && $this->oAdminPanel->RType()) { $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); if ($oTenant) { $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT') . ' (' . $oTenant->Login . ')'; } } else { continue; } } } else { $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); if ($oDomain) { if ($oDomain->IsDefaultTenantDomain) { $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT'); } } } } else { if ($this->oAdminPanel->RType()) { $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); if ($oDomain) { $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); if ($oTenant) { if ($iTenantId === 0) { $sName = $sName . ' (' . $oTenant->Login . ')'; } } else { $sName = $sName . ' (' . CApi::I18N('ADMIN_PANEL/NOT_IN_TENANT') . ')'; } } } } $oScreen->AddListItem($iDomainId, array('Type' => $aDomainArray[0] ? '<img src="static/images/mailsuite-domain-icon-big.png">' : '<img src="static/images/wm-domain-icon-big.png">', 'Name' => $sName)); } } } } }
/** * @return void */ public function EndModuleInit() { parent::EndModuleInit(); $this->JsAddInitText(' PageSwitcher = new CPageSwitcher(); PageSwitcher.Build(); PageSwitcher.Show(' . $this->iPage . ', ' . $this->iLinesPerPage . ', ' . $this->iAllListCount . ', "PageSwitcherPager(", ");"); List = new CList(); InitList("list"); ResizeElements("all"); $(window).resize(function(){ ResizeElements("all"); }); '); if (isset($_GET['edit'], $_GET['uid']) && is_numeric($_GET['uid'])) { $iId = (int) $_GET['uid']; $this->oAdminPanel->JsAddInitText('Selection.CheckLine("uid' . $iId . '");'); } }
/** * @param string $sTab * @param string $sMode * @param ap_Screen $oScreen */ protected function initStandardMainByTab($sTab, ap_Screen &$oScreen) { if ($this->oPopulateData && $this->IsInTab($sTab)) { $sMode = $oScreen->GetCurrentMode(); $sTabMode = ucfirst($sTab) . ucfirst($sMode); CApi::Log('call ' . get_class($this) . '->PopulateData->' . $sTabMode . '()'); if (method_exists($this->oPopulateData, $sTabMode)) { $oScreen->Data->SetValue('sysTab', $sTab); $oScreen->Data->SetValue('sysMode', $sMode); $this->oPopulateData->{$sTabMode}($oScreen); } } }
/** * @param string $sTab * @param ap_Screen $oScreen */ protected function initTableList($sTab, ap_Screen &$oScreen) { if (AP_TAB_DOMAINS === $sTab) { $iTenantId = $this->oAdminPanel->RType() ? $this->oAdminPanel->TenantId() : 0; $sSearchDesc = $oScreen->GetSearchDesc(); $iAllCount = $this->oDomainsApi->GetDomainCount($sSearchDesc, $iTenantId); $oScreen->EnableSearch($iAllCount > 1 || $sSearchDesc); $bAddDefaultDomain = false; if (0 === $iTenantId && $this->oAdminPanel->HasAccessDomain(0)) { $iAllCount += ceil($iAllCount / ($oScreen->GetLinesPerPage() - 1)); $bAddDefaultDomain = true; $oScreen->AddListItem(0, array('Name' => CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT')), true); } $oScreen->SetAllListCount($iAllCount); $aDomainsList = $this->oDomainsApi->GetDomainsList($oScreen->GetPage(), $bAddDefaultDomain ? $oScreen->GetLinesPerPage() - 1 : $oScreen->GetLinesPerPage(), $oScreen->GetOrderBy(), $oScreen->GetOrderType(), $sSearchDesc, $iTenantId); if (is_array($aDomainsList) && 0 < count($aDomainsList)) { foreach ($aDomainsList as $iDomainId => $aDomainArray) { if ($this->oAdminPanel->HasAccessDomain($iDomainId)) { $oScreen->AddListItem($iDomainId, array('Type' => $aDomainArray[0] ? '<img src="static/images/mailsuite-domain-icon-big.png">' : '<img src="static/images/wm-domain-icon-big.png">', 'Name' => $aDomainArray[1])); } } } } }