function processing() { $oModules = new BxDolModuleDb(); $aModules = $oModules->getModules(); $aResult = array(); foreach ($aModules as $aModule) { $aCheckInfo = BxDolInstallerUi::checkForUpdates($aModule); if (isset($aCheckInfo['version'])) { $aResult[] = _t('_adm_txt_modules_update_text_ext', $aModule['title'], $aCheckInfo['version']); } } if (empty($aResult)) { return; } $aAdmins = $GLOBALS['MySQL']->getAll("SELECT * FROM `Profiles` WHERE `Role`&" . BX_DOL_ROLE_ADMIN . "<>0 AND `EmailNotify`='1'"); if (empty($aAdmins)) { return; } $oEmailTemplate = new BxDolEmailTemplates(); $sMessage = implode('<br />', $aResult); foreach ($aAdmins as $aAdmin) { $aTemplate = $oEmailTemplate->getTemplate('t_ModulesUpdates', $aAdmin['ID']); sendMail($aAdmin['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aAdmin['ID'], array('MessageText' => $sMessage)); } }
function getInstalled() { //--- Get Items ---// $oModules = new BxDolModuleDb(); $aModules = $oModules->getModules(); $aItems = array(); foreach ($aModules as $aModule) { if (strpos($aModule['dependencies'], $aModule['uri']) !== false) { continue; } $sUpdate = ''; if (in_array($aModule['path'], $this->_aCheckPathes)) { $aCheckInfo = BxDolInstallerUi::checkForUpdates($aModule); $sUpdate = $this->_parseUpdate($aCheckInfo); } $aItems[] = array('name' => $aModule['uri'], 'value' => $aModule['path'], 'title' => _t('_adm_txt_modules_title_module', $aModule['title'], !empty($aModule['version']) ? $aModule['version'] : $this->_sDefVersion, $aModule['vendor']), 'can_update' => isset($aModule['update_url']) && !empty($aModule['update_url']) ? 1 : 0, 'update' => $sUpdate); } //--- Get Controls ---// $aButtons = array('modules-uninstall' => array('type' => 'submit', 'name' => 'modules-uninstall', 'value' => _t('_adm_btn_modules_uninstall'), 'onclick' => 'onclick="javascript: return ' . BX_DOL_ADM_MM_JS_NAME . '.onSubmitUninstall(this);"'), 'modules-recompile-languages' => _t('_adm_btn_modules_recompile_languages')); $oZ = new BxDolAlerts('system', 'admin_modules_buttons', 0, 0, array('place' => 'installed', 'buttons' => &$aButtons)); $oZ->alert(); $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array('type' => 'installed', 'bx_repeat:items' => !empty($aItems) ? $aItems : MsgBox(_t('_Empty')), 'controls' => BxTemplSearchResult::showAdminActionsPanel('modules-installed-form', $aButtons, 'pathes'))); $aTopMenu = array('modules-update' => array('title' => '_adm_btn_modules_update', 'href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MM_JS_NAME . '.checkForUpdates(this);')); $GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_txt_modules_data_will_be_lost')); return DesignBoxAdmin(_t('_adm_box_cpt_installed_modules'), $sContent, $aTopMenu); }
function getInstalled() { //--- Get Items ---// $oModules = new BxDolModuleDb(); $aModules = $oModules->getModules(); $aItems = array(); foreach ($aModules as $aModule) { $bNeedCheck = in_array($aModule['path'], $this->_aCheckPathes); $aCheckInfo = $bNeedCheck ? BxDolInstallerUi::checkForUpdates($aModule) : array(); $aItems[] = array('name' => $aModule['uri'], 'value' => $aModule['path'], 'title' => _t('_adm_txt_modules_title_module', $aModule['title'], !empty($aModule['version']) ? $aModule['version'] : $this->_sDefVersion, $aModule['vendor']), 'bx_if:update' => array('condition' => $bNeedCheck && !empty($aCheckInfo), 'content' => array('link' => empty($aCheckInfo['link']) ? '' : $aCheckInfo['link'], 'text' => _t('_adm_txt_modules_update_text', empty($aCheckInfo['version']) ? '' : $aCheckInfo['version']))), 'bx_if:latest' => array('condition' => $bNeedCheck && empty($aCheckInfo), 'content' => array())); } //--- Get Controls ---// $aButtons = array('modules-update' => _t('_adm_btn_modules_update'), 'modules-uninstall' => _t('_adm_btn_modules_uninstall'), 'modules-recompile-languages' => _t('_adm_btn_modules_recompile_languages')); $sControls = BxTemplSearchResult::showAdminActionsPanel('modules-installed-form', $aButtons, 'pathes'); return $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array('type' => 'installed', 'bx_repeat:items' => $aItems, 'controls' => $sControls)); }