diff options
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/module.php | 19 | ||||
-rw-r--r-- | modules/gallery/views/admin_themes.html.php | 8 |
2 files changed, 20 insertions, 7 deletions
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index eab94500..fb298959 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -50,8 +50,20 @@ class module_Core { * @param string $module_name */ static function get($module_name) { - // @todo can't easily use model_cache here because it throw an exception on missing models. - return ORM::factory("module", array("name" => $module_name)); + if (empty(self::$modules[$module_name])) { + return ORM::factory("module", array("name" => $module_name)); + } + return self::$modules[$module_name]; + } + + /** + * Get the information about a module + * @returns ArrayObject containing the module information from the module.info file or false if + * not found + */ + static function info($module_name) { + $module_list = self::available(); + return isset($module_list->$module_name) ? $module_list->$module_name : false; } /** @@ -79,7 +91,8 @@ class module_Core { $modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); foreach (glob(MODPATH . "*/module.info") as $file) { $module_name = basename(dirname($file)); - $modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); + $modules->$module_name = + new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); $m =& $modules->$module_name; $m->installed = self::is_installed($module_name); $m->active = self::is_active($module_name); diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index a75d9f04..f7e77a01 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -14,7 +14,7 @@ <div id="g-site-theme"> <h2> <?= t("Gallery theme") ?> </h2> - <div class="g-block g-selected g-clearfix"> + <div class="g-block g-selected ui-helper-clearfix"> <img src="<?= url::file("themes/{$site}/thumbnail.png") ?>" alt="<?= html::clean_attribute($themes[$site]->name) ?>" /> <h3> <?= $themes[$site]->name ?> </h3> @@ -29,7 +29,7 @@ <? foreach ($themes as $id => $info): ?> <? if (!$info->site) continue ?> <? if ($id == $site) continue ?> - <div class="g-block g-clearfix"> + <div class="g-block ui-helper-clearfix"> <a href="<?= url::site("admin/themes/preview/site/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" alt="<?= html::clean_attribute($info->name) ?>" /> @@ -52,7 +52,7 @@ <div id="g-admin-theme"> <h2> <?= t("Admin theme") ?> </h2> - <div class="g-block g-selected g-clearfix"> + <div class="g-block g-selected ui-helper-clearfix"> <img src="<?= url::file("themes/{$admin}/thumbnail.png") ?>" alt="<?= html::clean_attribute($themes[$admin]->name) ?>" /> <h3> <?= $themes[$admin]->name ?> </h3> @@ -67,7 +67,7 @@ <? foreach ($themes as $id => $info): ?> <? if (!$info->admin) continue ?> <? if ($id == $admin) continue ?> - <div class="g-block g-clearfix"> + <div class="g-block ui-helper-clearfix"> <a href="<?= url::site("admin/themes/preview/admin/$id") ?>" class="g-dialog-link" title="<?= t("Theme Preview: %theme_name", array("theme_name" => $info->name))->for_html_attr() ?>"> <img src="<?= url::file("themes/{$id}/thumbnail.png") ?>" alt="<?= html::clean_attribute($info->name) ?>" /> |