当前位置: 首页>>代码示例>>PHP>>正文


PHP BxDolModuleDb::getModules方法代码示例

本文整理汇总了PHP中BxDolModuleDb::getModules方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolModuleDb::getModules方法的具体用法?PHP BxDolModuleDb::getModules怎么用?PHP BxDolModuleDb::getModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BxDolModuleDb的用法示例。


在下文中一共展示了BxDolModuleDb::getModules方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processing

 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));
     }
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:25,代码来源:BxDolCronModules.php

示例2: getNotInstalled

 function getNotInstalled($sResult)
 {
     //--- Get Items ---//
     $oModules = new BxDolModuleDb();
     $aModules = $oModules->getModules();
     $aInstalled = array();
     foreach ($aModules as $aModule) {
         $aInstalled[] = $aModule['path'];
     }
     $aNotInstalled = array();
     $sPath = BX_DIRECTORY_PATH_ROOT . 'modules/';
     if ($rHandleVendor = opendir($sPath)) {
         while (($sVendor = readdir($rHandleVendor)) !== false) {
             if (substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor)) {
                 continue;
             }
             if ($rHandleModule = opendir($sPath . $sVendor)) {
                 while (($sModule = readdir($rHandleModule)) !== false) {
                     if (!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.' || in_array($sVendor . '/' . $sModule . '/', $aInstalled)) {
                         continue;
                     }
                     $sConfigPath = $sPath . $sVendor . '/' . $sModule . '/install/config.php';
                     if (!file_exists($sConfigPath)) {
                         continue;
                     }
                     include $sConfigPath;
                     $aNotInstalled[$aConfig['title']] = array('name' => $aConfig['home_uri'], 'value' => $aConfig['home_dir'], 'title' => _t('_adm_txt_modules_title_module', $aConfig['title'], !empty($aConfig['version']) ? $aConfig['version'] : $this->_sDefVersion, $aConfig['vendor']), 'can_update' => '0', 'update' => '');
                 }
                 closedir($rHandleModule);
             }
         }
         closedir($rHandleVendor);
     }
     ksort($aNotInstalled);
     //--- Get Controls ---//
     $aButtons = array('modules-install' => _t('_adm_btn_modules_install'), 'modules-delete' => _t('_adm_btn_modules_delete'));
     $oZ = new BxDolAlerts('system', 'admin_modules_buttons', 0, 0, array('place' => 'uninstalled', 'buttons' => &$aButtons));
     $oZ->alert();
     $sControls = BxTemplSearchResult::showAdminActionsPanel('modules-not-installed-form', $aButtons, 'pathes');
     if (!empty($sResult)) {
         $sResult = MsgBox(_t($sResult), 10);
     }
     return $sResult . $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array('type' => 'not-installed', 'bx_repeat:items' => !empty($aNotInstalled) ? array_values($aNotInstalled) : MsgBox(_t('_Empty')), 'controls' => $sControls));
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:44,代码来源:BxDolInstallerUi.php

示例3: BxDolModuleDb

 function _recompileLanguageForAllModules($iLangId)
 {
     $oDb = new BxDolModuleDb();
     $aLanguage = $GLOBALS['MySQL']->getRow("SELECT `ID` AS `id`, `Name` AS `name`, `Title` AS `title` FROM `sys_localization_languages` WHERE `ID` = {$iLangId}");
     if (!$aLanguage) {
         return false;
     }
     // save class properties
     $aSave['config'] = $this->_aConfig;
     $aSave['home_path'] = $this->_sHomePath;
     $aSave['module_path'] = $this->_sModulePath;
     $aModules = $oDb->getModules();
     foreach ($aModules as $a) {
         $aConfig = false;
         $bInclude = @(include BX_DIRECTORY_PATH_MODULES . $a['path'] . 'install/config.php');
         if (!$bInclude || !$aConfig) {
             continue;
         }
         $this->_aConfig = $aConfig;
         $this->_sHomePath = $this->_sBasePath . $aConfig['home_dir'];
         $this->_sModulePath = $this->_sBasePath . $aConfig['home_dir'];
         $b = $this->_updateLanguage(true, $aLanguage);
     }
     // restore class properties
     $this->_aConfig = $aSave['config'];
     $this->_sHomePath = $aSave['home_path'];
     $this->_sModulePath = $aSave['module_path'];
     return true;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:29,代码来源:BxDolInstaller.php

示例4: _checkPermissionsModules

 protected function _checkPermissionsModules(&$aMessages)
 {
     $bRet = true;
     $oDbModules = new BxDolModuleDb();
     $aModules = $oDbModules->getModules();
     foreach ($aModules as $a) {
         if (empty($a['path']) || !(include BX_DIRECTORY_PATH_MODULES . $a['path'] . 'install/config.php')) {
             continue;
         }
         if (empty($aConfig['install_permissions']) || !is_array($aConfig['install_permissions']['writable'])) {
             continue;
         }
         foreach ($aConfig['install_permissions']['writable'] as $sPath) {
             $s = basename(BX_DIRECTORY_PATH_MODULES) . '/' . $a['path'] . $sPath;
             $sType = $this->_getFileType($s);
             $isOk = BX_DOL_PERM_EXE ? $this->isExecutable($s) : $this->isWritable($s);
             $aMessages[$s] = array('res' => $isOk ? BX_DOL_PERM_OK : BX_DOL_PERM_FAIL, 'type' => $sType);
             if (!$isOk && $bRet) {
                 $bRet = false;
             }
         }
     }
     return $bRet;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:24,代码来源:BxDolStudioTools.php

示例5: GenPermTableForModules

 /**
  * Generate permissions table for modules
  * @param $iType - 1: folder, 2: file
  * @return HTML 
  */
 function GenPermTableForModules($iType)
 {
     $aList = array();
     bx_import('BxDolModuleDb');
     $oDbModules = new BxDolModuleDb();
     $aModules = $oDbModules->getModules();
     foreach ($aModules as $a) {
         if (empty($a['path']) || !(include BX_DIRECTORY_PATH_MODULES . $a['path'] . 'install/config.php')) {
             continue;
         }
         if (empty($aConfig['install_permissions']) || !is_array($aConfig['install_permissions']['writable'])) {
             continue;
         }
         foreach ($aConfig['install_permissions']['writable'] as $sPath) {
             if (1 == $iType && is_dir(BX_DIRECTORY_PATH_MODULES . $a['path'] . $sPath)) {
                 $aList[] = basename(BX_DIRECTORY_PATH_MODULES) . '/' . $a['path'] . $sPath;
             } elseif (2 == $iType && is_file(BX_DIRECTORY_PATH_MODULES . $a['path'] . $sPath)) {
                 $aList[] = basename(BX_DIRECTORY_PATH_MODULES) . '/' . $a['path'] . $sPath;
             }
         }
     }
     return $this->GenArrElemPerm($aList, $iType);
 }
开发者ID:bright-spark,项目名称:dolphin.pro,代码行数:28,代码来源:BxDolAdminTools.php


注:本文中的BxDolModuleDb::getModules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。