summaryrefslogtreecommitdiff
path: root/core/controllers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-22 04:49:30 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-22 04:49:30 +0000
commit17f77b8de4586d1ee4a3693561b71815eb2fc092 (patch)
treebce4ee9c8a1c34f9e2845269ec8bda4b346e2e3d /core/controllers
parent9cf2c5792111570fd831abfad9fc7496995d2e8b (diff)
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()
Diffstat (limited to 'core/controllers')
-rw-r--r--core/controllers/welcome.php24
1 files changed, 3 insertions, 21 deletions
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();