Example #1
0
 function initQuery($params)
 {
     $tables = Modules_Manager::getTables();
     $module_columns = $tables['module']['columns'];
     $this->addSelectTable('module');
     $this->addSelectField('*');
     $this->WhereValue($module_columns['system'], DB_EQ, "E");
 }
 /**
  * Checks if module has been installed.
  *
  * @ finish the functions on this page
  * @return bool TRUE if module has been installed, FALSE otherwise
  */
 function isInstalled()
 {
     return Modules_Manager::isModuleInstalled("Checkout");
 }
Example #3
0
 function initQuery($params)
 {
     $tables = Modules_Manager::getTables();
     $module_columns = $tables['module']['columns'];
     $this->addUpdateValue($module_columns['active'], $params['active']);
     $this->WhereValue($module_columns['name'], DB_EQ, $params['name']);
     $this->WhereAND();
     $this->WhereValue($module_columns['system'], DB_EQ, "E");
 }
Example #4
0
 /**
  * Returns TRUE if the module with the specified name is installed in
  * the system.
  */
 function isModuleInstalled($moduleName, $force_update = false)
 {
     global $application;
     $tables = Modules_Manager::getTables();
     $module_tbl = 'module';
     $module_columns = $tables[$module_tbl]['columns'];
     $module_class_tbl = 'module_class';
     $module_class_columns = $tables[$module_class_tbl]['columns'];
     if (!DB_MySQL::DB_isTableExists($application->getAppIni('DB_TABLE_PREFIX') . $module_tbl)) {
         return false;
     }
     static $installed_modules = null;
     if ($force_update) {
         $installed_modules = null;
     }
     if ($installed_modules == null) {
         $result = execQuery('SELECT_ALL_MODULE_NAMES', array());
         $installed_modules = array();
         foreach ($result as $resultItem) {
             $installed_modules[] = _ml_strtolower($resultItem['module_name']);
         }
     }
     if (in_array(_ml_strtolower($moduleName), $installed_modules)) {
         return true;
     } else {
         return false;
     }
 }