From 17f77b8de4586d1ee4a3693561b71815eb2fc092 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 22 Dec 2008 04:49:30 +0000 Subject: Remove module.info from infrastructure modules that are effectively libraries that would ship with the core. Refactor welcome.php to use the newly refactored module::available() --- core/controllers/welcome.php | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'core/controllers') diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index b253f13f..18ce0c1a 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -32,7 +32,7 @@ class Welcome_Controller extends Template_Controller { set_error_handler(array("Welcome_Controller", "_error_handler")); try { - $this->template->syscheck->modules = $this->_read_modules(); + $this->template->syscheck->modules = module::available(); $this->template->album_count = ORM::factory("item")->where("type", "album")->count_all(); $this->template->photo_count = ORM::factory("item")->where("type", "photo")->count_all(); $this->template->deepest_photo = ORM::factory("item") @@ -65,8 +65,8 @@ class Welcome_Controller extends Template_Controller { function install($module_name) { $to_install = array(); if ($module_name == "*") { - foreach ($this->_read_modules() as $module_name => $version) { - if (empty($version)) { + foreach (module::available() as $module_name => $info) { + if (empty($info->installed)) { $to_install[] = $module_name; } } @@ -417,24 +417,6 @@ class Welcome_Controller extends Template_Controller { } } - /** - * Create an array of all the modules that are install or available and the version number - * @return array(moduleId => version) - */ - private function _read_modules() { - $modules = module::available(); - try { - foreach (module::installed() as $installed_module) { - $modules->$installed_module->version = $installed_module->version; - } - } catch (Exception $e) { - // The database may not be installed - } - ksort($modules); - - return $modules; - } - private function _load_group_info() { if (class_exists("Group_Model")) { $this->template->groups = ORM::factory("group")->find_all(); -- cgit v1.2.3