summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-27 16:15:00 -0700
committerBharat Mediratta <bharat@menalto.com>2009-05-27 16:17:29 -0700
commit88a3d43ba9b9377ba6bbe21a4547220ae3a37276 (patch)
treebcdfaa4188a7e9a8e698c895f84f0ca899005391 /modules/gallery/helpers
parent12fe58d997d2066dc362fd393a18b4e5da190513 (diff)
Update all references to the core application to now point to the
gallery module. This type of mass update is prone to some small bugs.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/access.php4
-rw-r--r--modules/gallery/helpers/block_manager.php4
-rw-r--r--modules/gallery/helpers/gallery.php (renamed from modules/gallery/helpers/core.php)4
-rw-r--r--modules/gallery/helpers/gallery_block.php (renamed from modules/gallery/helpers/core_block.php)2
-rw-r--r--modules/gallery/helpers/gallery_event.php (renamed from modules/gallery/helpers/core_event.php)6
-rw-r--r--modules/gallery/helpers/gallery_installer.php (renamed from modules/gallery/helpers/core_installer.php)42
-rw-r--r--modules/gallery/helpers/gallery_menu.php (renamed from modules/gallery/helpers/core_menu.php)4
-rw-r--r--modules/gallery/helpers/gallery_search.php (renamed from modules/gallery/helpers/core_search.php)2
-rw-r--r--modules/gallery/helpers/gallery_task.php (renamed from modules/gallery/helpers/core_task.php)8
-rw-r--r--modules/gallery/helpers/gallery_theme.php (renamed from modules/gallery/helpers/core_theme.php)26
-rw-r--r--modules/gallery/helpers/graphics.php28
-rw-r--r--modules/gallery/helpers/l10n_client.php4
-rw-r--r--modules/gallery/helpers/locale.php8
-rw-r--r--modules/gallery/helpers/module.php28
-rw-r--r--modules/gallery/helpers/movie.php4
-rw-r--r--modules/gallery/helpers/theme.php15
16 files changed, 95 insertions, 94 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php
index 64ce91fa..c48f0b79 100644
--- a/modules/gallery/helpers/access.php
+++ b/modules/gallery/helpers/access.php
@@ -389,7 +389,7 @@ class access_Core {
* @return ORM_Iterator
*/
private static function _get_all_groups() {
- // When we build the core package, it's possible that the user module is not installed yet.
+ // When we build the gallery package, it's possible that the user module is not installed yet.
// This is ok at packaging time, so work around it.
if (module::is_active("user")) {
return ORM::factory("group")->find_all();
@@ -595,7 +595,7 @@ class access_Core {
}
static function private_key() {
- return module::get_var("core", "private_key");
+ return module::get_var("gallery", "private_key");
}
/**
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php
index 022626e5..20b641d4 100644
--- a/modules/gallery/helpers/block_manager.php
+++ b/modules/gallery/helpers/block_manager.php
@@ -19,11 +19,11 @@
*/
class block_manager_Core {
static function get_active($location) {
- return unserialize(module::get_var("core", "blocks_$location", "a:0:{}"));
+ return unserialize(module::get_var("gallery", "blocks_$location", "a:0:{}"));
}
static function set_active($location, $blocks) {
- module::set_var("core", "blocks_$location", serialize($blocks));
+ module::set_var("gallery", "blocks_$location", serialize($blocks));
}
static function add($location, $module_name, $block_id) {
diff --git a/modules/gallery/helpers/core.php b/modules/gallery/helpers/gallery.php
index 63f51f86..bf33fa2b 100644
--- a/modules/gallery/helpers/core.php
+++ b/modules/gallery/helpers/gallery.php
@@ -17,13 +17,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_Core {
+class gallery_Core {
/**
* If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is
* down for maintenance" page.
*/
static function maintenance_mode() {
- $maintenance_mode = Kohana::config("core.maintenance_mode", false, false);
+ $maintenance_mode = Kohana::config("gallery.maintenance_mode", false, false);
if (Router::$controller != "login" && !empty($maintenance_mode) && !user::active()->admin) {
Router::$controller = "maintenance";
diff --git a/modules/gallery/helpers/core_block.php b/modules/gallery/helpers/gallery_block.php
index 0e2e9c54..abc8a195 100644
--- a/modules/gallery/helpers/core_block.php
+++ b/modules/gallery/helpers/gallery_block.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_block_Core {
+class gallery_block_Core {
static function get_list() {
return array(
"welcome" => t("Welcome to Gallery 3!"),
diff --git a/modules/gallery/helpers/core_event.php b/modules/gallery/helpers/gallery_event.php
index bbb53cc9..aa11b7c0 100644
--- a/modules/gallery/helpers/core_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_event_Core {
+class gallery_event_Core {
static function group_created($group) {
access::add_group($group);
}
@@ -38,9 +38,9 @@ class core_event_Core {
static function user_login($user) {
// If this user is an admin, check to see if there are any post-install tasks that we need
// to run and take care of those now.
- if ($user->admin && module::get_var("core", "choose_default_tookit", null)) {
+ if ($user->admin && module::get_var("gallery", "choose_default_tookit", null)) {
graphics::choose_default_toolkit();
- module::clear_var("core", "choose_default_tookit");
+ module::clear_var("gallery", "choose_default_tookit");
}
}
}
diff --git a/modules/gallery/helpers/core_installer.php b/modules/gallery/helpers/gallery_installer.php
index cffcbedb..e3aa403f 100644
--- a/modules/gallery/helpers/core_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -17,13 +17,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_installer {
+class gallery__installer {
static function install($initial_install=false) {
$db = Database::instance();
if ($initial_install) {
$version = 0;
} else {
- $version = module::get_version("core");
+ $version = module::get_version("gallery");
}
if ($version == 0) {
@@ -212,21 +212,21 @@ class core_installer {
$root->save();
access::add_item($root);
- module::set_var("core", "active_site_theme", "default");
- module::set_var("core", "active_admin_theme", "admin_default");
- module::set_var("core", "page_size", 9);
- module::set_var("core", "thumb_size", 200);
- module::set_var("core", "resize_size", 640);
- module::set_var("core", "default_locale", "en_US");
- module::set_var("core", "image_quality", 75);
+ module::set_var("gallery", "active_site_theme", "default");
+ module::set_var("gallery", "active_admin_theme", "admin_default");
+ module::set_var("gallery", "page_size", 9);
+ module::set_var("gallery", "thumb_size", 200);
+ module::set_var("gallery", "resize_size", 640);
+ module::set_var("gallery", "default_locale", "en_US");
+ module::set_var("gallery", "image_quality", 75);
// Add rules for generating our thumbnails and resizes
graphics::add_rule(
- "core", "thumb", "resize",
+ "gallery", "thumb", "resize",
array("width" => 200, "height" => 200, "master" => Image::AUTO),
100);
graphics::add_rule(
- "core", "resize", "resize",
+ "gallery", "resize", "resize",
array("width" => 640, "height" => 480, "master" => Image::AUTO),
100);
@@ -240,17 +240,17 @@ class core_installer {
$theme->save();
}
- block_manager::add("dashboard_sidebar", "core", "block_adder");
- block_manager::add("dashboard_sidebar", "core", "stats");
- block_manager::add("dashboard_sidebar", "core", "platform_info");
- block_manager::add("dashboard_sidebar", "core", "project_news");
- block_manager::add("dashboard_center", "core", "welcome");
- block_manager::add("dashboard_center", "core", "photo_stream");
- block_manager::add("dashboard_center", "core", "log_entries");
+ block_manager::add("dashboard_sidebar", "gallery", "block_adder");
+ block_manager::add("dashboard_sidebar", "gallery", "stats");
+ block_manager::add("dashboard_sidebar", "gallery", "platform_info");
+ block_manager::add("dashboard_sidebar", "gallery", "project_news");
+ block_manager::add("dashboard_center", "gallery", "welcome");
+ block_manager::add("dashboard_center", "gallery", "photo_stream");
+ block_manager::add("dashboard_center", "gallery", "log_entries");
- module::set_version("core", 1);
- module::set_var("core", "version", "3.0 pre-beta svn");
- module::set_var("core", "choose_default_tookit", 1);
+ module::set_version("gallery", 1);
+ module::set_var("gallery", "version", "3.0 pre-beta git");
+ module::set_var("gallery", "choose_default_tookit", 1);
}
}
diff --git a/modules/gallery/helpers/core_menu.php b/modules/gallery/helpers/gallery_menu.php
index eb208560..215fc420 100644
--- a/modules/gallery/helpers/core_menu.php
+++ b/modules/gallery/helpers/gallery_menu.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_menu_Core {
+class gallery_menu_Core {
static function site($menu, $theme) {
if (file_exists(APPPATH . "controllers/scaffold.php") && user::active()->admin) {
$menu->append($scaffold_menu = Menu::factory("submenu")
@@ -74,7 +74,7 @@ class core_menu_Core {
->label(t("Admin")));
self::admin($admin_menu, $theme);
foreach (module::active() as $module) {
- if ($module->name == "core") {
+ if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
diff --git a/modules/gallery/helpers/core_search.php b/modules/gallery/helpers/gallery_search.php
index 9957a493..2a4029d3 100644
--- a/modules/gallery/helpers/core_search.php
+++ b/modules/gallery/helpers/gallery_search.php
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Core_Search_Core {
+class gallery_search_Core {
static function item_index_data($item) {
return join(" ", array($item->description, $item->name, $item->title));
}
diff --git a/modules/gallery/helpers/core_task.php b/modules/gallery/helpers/gallery_task.php
index e078192c..6046bfc4 100644
--- a/modules/gallery/helpers/core_task.php
+++ b/modules/gallery/helpers/gallery_task.php
@@ -17,12 +17,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_task_Core {
+class gallery_task_Core {
static function available_tasks() {
$dirty_count = graphics::find_dirty_images_query()->count();
$tasks = array();
$tasks[] = Task_Definition::factory()
- ->callback("core_task::rebuild_dirty_images")
+ ->callback("gallery_task::rebuild_dirty_images")
->name(t("Rebuild Images"))
->description($dirty_count ?
t2("You have one out of date photo",
@@ -32,7 +32,7 @@ class core_task_Core {
->severity($dirty_count ? log::WARNING : log::SUCCESS);
$tasks[] = Task_Definition::factory()
- ->callback("core_task::update_l10n")
+ ->callback("gallery_task::update_l10n")
->name(t("Update translations"))
->description(t("Download new and updated translated strings"))
->severity(log::SUCCESS);
@@ -92,7 +92,7 @@ class core_task_Core {
switch ($task->get("mode", "init")) {
case "init": // 0%
- $dirs = array("core", "modules", "themes", "installer");
+ $dirs = array("gallery", "modules", "themes", "installer");
$files = array();
$task->set("mode", "find_files");
$task->status = t("Finding files");
diff --git a/modules/gallery/helpers/core_theme.php b/modules/gallery/helpers/gallery_theme.php
index 28f544a1..0acccb45 100644
--- a/modules/gallery/helpers/core_theme.php
+++ b/modules/gallery/helpers/gallery_theme.php
@@ -17,36 +17,36 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class core_theme_Core {
+class gallery_theme_Core {
static function head($theme) {
$session = Session::instance();
$buf = "";
if ($session->get("debug")) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("core/css/debug.css") . "\" />";
+ url::file("gallery/css/debug.css") . "\" />";
}
if (($theme->page_type == "album" || $theme->page_type == "photo")
&& access::can("edit", $theme->item())) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("core/css/quick.css") . "\" />";
- $buf .= html::script("core/js/quick.js");
+ url::file("gallery/css/quick.css") . "\" />";
+ $buf .= html::script("gallery/js/quick.js");
}
if ($theme->page_type == "photo" && access::can("view_full", $theme->item())) {
$buf .= "<script type=\"text/javascript\" >" .
" var fullsize_detail = { " .
- " close: \"" . url::file("core/images/ico-close.png") . "\", " .
+ " close: \"" . url::file("gallery/images/ico-close.png") . "\", " .
" url: \"" . $theme->item()->file_url() . "\", " .
" width: " . $theme->item()->width . ", " .
" height: " . $theme->item()->height . "};" .
"</script>";
- $buf .= html::script("core/js/fullsize.js");
+ $buf .= html::script("gallery/js/fullsize.js");
}
if ($session->get("l10n_mode", false)) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("core/css/l10n_client.css") . "\" />";
+ url::file("gallery/css/l10n_client.css") . "\" />";
$buf .= html::script("lib/jquery.cookie.js");
- $buf .= html::script("core/js/l10n_client.js");
+ $buf .= html::script("gallery/js/l10n_client.js");
}
return $buf;
@@ -83,14 +83,14 @@ class core_theme_Core {
$buf = "";
if ($session->get("debug")) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("core/css/debug.css") . "\" />";
+ url::file("gallery/css/debug.css") . "\" />";
}
if ($session->get("l10n_mode", false)) {
$buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
- url::file("core/css/l10n_client.css") . "\" />";
+ url::file("gallery/css/l10n_client.css") . "\" />";
$buf .= html::script("lib/jquery.cookie.js");
- $buf .= html::script("core/js/l10n_client.js");
+ $buf .= html::script("gallery/js/l10n_client.js");
}
return $buf;
@@ -127,11 +127,11 @@ class core_theme_Core {
return "<li class=\"first\">" .
t("Powered by <a href=\"%url\">Gallery %version</a>",
array("url" => "http://gallery.menalto.com",
- "version" => module::get_var("core", "version"))) .
+ "version" => module::get_var("gallery", "version"))) .
"</li>";
}
static function admin_credits() {
- return core_theme::credits();
+ return gallery_theme::credits();
}
} \ No newline at end of file
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index 805a95c0..605b9ff8 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -26,11 +26,11 @@ class graphics_Core {
* Rules are applied to targets (thumbnails and resizes) in priority order. Rules are functions
* in the graphics class. So for example, the following rule:
*
- * graphics::add_rule("core", "thumb", "resize",
+ * graphics::add_rule("gallery", "thumb", "resize",
* array("width" => 200, "height" => 200, "master" => Image::AUTO), 100);
*
- * Specifies that "core" is adding a rule to resize thumbnails down to a max of 200px on
- * the longest side. The core module adds default rules at a priority of 100. You can set
+ * Specifies that "gallery" is adding a rule to resize thumbnails down to a max of 200px on
+ * the longest side. The gallery module adds default rules at a priority of 100. You can set
* higher and lower priorities to perform operations before or after this fires.
*
* @param string $module_name the module that added the rule
@@ -194,7 +194,7 @@ class graphics_Core {
} else {
Image::factory($input_file)
->resize($options["width"], $options["height"], $options["master"])
- ->quality(module::get_var("core", "image_quality"))
+ ->quality(module::get_var("gallery", "image_quality"))
->save($output_file);
}
}
@@ -212,7 +212,7 @@ class graphics_Core {
}
Image::factory($input_file)
- ->quality(module::get_var("core", "image_quality"))
+ ->quality(module::get_var("gallery", "image_quality"))
->rotate($options["degrees"])
->save($output_file);
}
@@ -262,7 +262,7 @@ class graphics_Core {
Image::factory($input_file)
->composite($options["file"], $x, $y, $options["transparency"])
- ->quality(module::get_var("core", "image_quality"))
+ ->quality(module::get_var("gallery", "image_quality"))
->save($output_file);
}
@@ -302,7 +302,7 @@ class graphics_Core {
$count,
array("attrs" => sprintf(
'href="%s" class="gDialogLink"',
- url::site("admin/maintenance/start/core_task::rebuild_dirty_images?csrf=__CSRF__")))),
+ url::site("admin/maintenance/start/gallery_task::rebuild_dirty_images?csrf=__CSRF__")))),
"graphics_dirty");
}
}
@@ -332,12 +332,12 @@ class graphics_Core {
$toolkits = graphics::detect_toolkits();
foreach (array("imagemagick", "graphicsmagick", "gd") as $tk) {
if ($toolkits[$tk]) {
- module::set_var("core", "graphics_toolkit", $tk);
- module::set_var("core", "graphics_toolkit_path", $tk == "gd" ? "" : $toolkits[$tk]);
+ module::set_var("gallery", "graphics_toolkit", $tk);
+ module::set_var("gallery", "graphics_toolkit_path", $tk == "gd" ? "" : $toolkits[$tk]);
break;
}
}
- if (!module::get_var("core", "graphics_toolkit")) {
+ if (!module::get_var("gallery", "graphics_toolkit")) {
site_status::warning(
t("Graphics toolkit missing! Please <a href=\"%url\">choose a toolkit</a>",
array("url" => url::site("admin/graphics"))),
@@ -349,7 +349,7 @@ class graphics_Core {
* Choose which driver the Kohana Image library uses.
*/
static function init_toolkit() {
- switch(module::get_var("core", "graphics_toolkit")) {
+ switch(module::get_var("gallery", "graphics_toolkit")) {
case "gd":
Kohana::config_set("image.driver", "GD");
break;
@@ -357,13 +357,13 @@ class graphics_Core {
case "imagemagick":
Kohana::config_set("image.driver", "ImageMagick");
Kohana::config_set(
- "image.params.directory", module::get_var("core", "graphics_toolkit_path"));
+ "image.params.directory", module::get_var("gallery", "graphics_toolkit_path"));
break;
case "graphicsmagick":
Kohana::config_set("image.driver", "GraphicsMagick");
Kohana::config_set(
- "image.params.directory", module::get_var("core", "graphics_toolkit_path"));
+ "image.params.directory", module::get_var("gallery", "graphics_toolkit_path"));
break;
}
@@ -376,7 +376,7 @@ class graphics_Core {
* @return boolean
*/
static function can($func) {
- if (module::get_var("core", "graphics_toolkit") == "gd" &&
+ if (module::get_var("gallery", "graphics_toolkit") == "gd" &&
$func == "rotate" &&
!function_exists("imagerotate")) {
return false;
diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php
index ec4c5429..d26739f5 100644
--- a/modules/gallery/helpers/l10n_client.php
+++ b/modules/gallery/helpers/l10n_client.php
@@ -35,9 +35,9 @@ class l10n_client_Core {
static function api_key($api_key=null) {
if ($api_key !== null) {
- module::set_var("core", "l10n_client_key", $api_key);
+ module::set_var("gallery", "l10n_client_key", $api_key);
}
- return module::get_var("core", "l10n_client_key", "");
+ return module::get_var("gallery", "l10n_client_key", "");
}
static function server_uid($api_key=null) {
diff --git a/modules/gallery/helpers/locale.php b/modules/gallery/helpers/locale.php
index b707637f..2ba0f255 100644
--- a/modules/gallery/helpers/locale.php
+++ b/modules/gallery/helpers/locale.php
@@ -37,8 +37,8 @@ class locale_Core {
static function installed() {
$available = self::available();
- $default = module::get_var("core", "default_locale");
- $codes = explode("|", module::get_var("core", "installed_locales", $default));
+ $default = module::get_var("gallery", "default_locale");
+ $codes = explode("|", module::get_var("gallery", "installed_locales", $default));
foreach ($codes as $code) {
if (isset($available->$code)) {
$installed[$code] = $available[$code];
@@ -49,10 +49,10 @@ class locale_Core {
static function update_installed($locales) {
// Ensure that the default is included...
- $default = module::get_var("core", "default_locale");
+ $default = module::get_var("gallery", "default_locale");
$locales = array_merge($locales, array($default));
- module::set_var("core", "installed_locales", join("|", $locales));
+ module::set_var("gallery", "installed_locales", join("|", $locales));
}
// @todo Might want to add a localizable language name as well.
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php
index a48c89ed..a6cc87ac 100644
--- a/modules/gallery/helpers/module.php
+++ b/modules/gallery/helpers/module.php
@@ -37,7 +37,7 @@ class module_Core {
$module = self::get($module_name);
if (!$module->loaded) {
$module->name = $module_name;
- $module->active = $module_name == "core"; // only core is active by default
+ $module->active = $module_name == "gallery"; // only gallery is active by default
}
$module->version = 1;
$module->save();
@@ -75,7 +75,7 @@ class module_Core {
*/
static function available() {
$modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
- foreach (array_merge(array("core/module.info"), glob(MODPATH . "*/module.info")) as $file) {
+ foreach (array_merge(array("gallery/module.info"), 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->installed = self::is_installed($module_name);
@@ -85,7 +85,7 @@ class module_Core {
}
// Lock certain modules
- $modules->core->locked = true;
+ $modules->gallery->locked = true;
$modules->user->locked = true;
$modules->ksort();
@@ -215,10 +215,10 @@ class module_Core {
if ($module->active) {
self::$active[] = $module;
}
- if ($module->name != "core") {
- $kohana_modules[] = MODPATH . $module->name;
- }
+ $kohana_modules[] = MODPATH . $module->name;
+ // @todo: force 'gallery' to be at the end
}
+
Kohana::config_set("core.modules", $kohana_modules);
}
@@ -252,32 +252,32 @@ class module_Core {
* @return the value
*/
static function get_var($module_name, $name, $default_value=null) {
- // We cache all vars in core._cache so that we can load all vars at once for
+ // We cache all vars in gallery._cache so that we can load all vars at once for
// performance.
if (empty(self::$var_cache)) {
$row = Database::instance()
->select("value")
->from("vars")
- ->where(array("module_name" => "core", "name" => "_cache"))
+ ->where(array("module_name" => "gallery", "name" => "_cache"))
->get()
->current();
if ($row) {
self::$var_cache = unserialize($row->value);
} else {
- // core._cache doesn't exist. Create it now.
+ // gallery._cache doesn't exist. Create it now.
foreach (Database::instance()
->select("module_name", "name", "value")
->from("vars")
->orderby("module_name", "name")
->get() as $row) {
- if ($row->module_name == "core" && $row->name == "_cache") {
+ if ($row->module_name == "gallery" && $row->name == "_cache") {
// This could happen if there's a race condition
continue;
}
self::$var_cache->{$row->module_name}->{$row->name} = $row->value;
}
$cache = ORM::factory("var");
- $cache->module_name = "core";
+ $cache->module_name = "gallery";
$cache->name = "_cache";
$cache->value = serialize(self::$var_cache);
$cache->save();
@@ -309,7 +309,7 @@ class module_Core {
$var->value = $value;
$var->save();
- Database::instance()->delete("vars", array("module_name" => "core", "name" => "_cache"));
+ Database::instance()->delete("vars", array("module_name" => "gallery", "name" => "_cache"));
self::$var_cache = null;
}
@@ -325,7 +325,7 @@ class module_Core {
"WHERE `module_name` = '$module_name' " .
"AND `name` = '$name'");
- Database::instance()->delete("vars", array("module_name" => "core", "name" => "_cache"));
+ Database::instance()->delete("vars", array("module_name" => "gallery", "name" => "_cache"));
self::$var_cache = null;
}
@@ -343,7 +343,7 @@ class module_Core {
$var->delete();
}
- Database::instance()->delete("vars", array("module_name" => "core", "name" => "_cache"));
+ Database::instance()->delete("vars", array("module_name" => "gallery", "name" => "_cache"));
self::$var_cache = null;
}
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 3293d4ac..15225fe7 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -140,11 +140,11 @@ class movie_Core {
}
static function find_ffmpeg() {
- if (!$ffmpeg_path = module::get_var("core", "ffmpeg_path")) {
+ if (!$ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) {
if (function_exists("exec")) {
$ffmpeg_path = exec("which ffmpeg");
if ($ffmpeg_path) {
- module::set_var("core", "ffmpeg_path", $ffmpeg_path);
+ module::set_var("gallery", "ffmpeg_path", $ffmpeg_path);
}
}
}
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php
index cbe224db..af340db6 100644
--- a/modules/gallery/helpers/theme.php
+++ b/modules/gallery/helpers/theme.php
@@ -31,10 +31,11 @@ class theme_Core {
static function load_themes() {
$modules = Kohana::config("core.modules");
if (Router::$controller == "admin") {
- array_unshift($modules, THEMEPATH . module::get_var("core", "active_admin_theme"));
+ array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_admin_theme"));
} else {
- array_unshift($modules, THEMEPATH . module::get_var("core", "active_site_theme"));
+ array_unshift($modules, THEMEPATH . module::get_var("gallery", "active_site_theme"));
}
+
Kohana::config_set("core.modules", $modules);
}
@@ -43,17 +44,17 @@ class theme_Core {
$group = $form->group("edit_theme");
$group->input("page_size")->label(t("Items per page"))->id("gPageSize")
->rules("required|valid_digit")
- ->value(module::get_var("core", "page_size"));
+ ->value(module::get_var("gallery", "page_size"));
$group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("gThumbSize")
->rules("required|valid_digit")
- ->value(module::get_var("core", "thumb_size"));
+ ->value(module::get_var("gallery", "thumb_size"));
$group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("gResizeSize")
->rules("required|valid_digit")
- ->value(module::get_var("core", "resize_size"));
+ ->value(module::get_var("gallery", "resize_size"));
$group->textarea("header_text")->label(t("Header text"))->id("gHeaderText")
- ->value(module::get_var("core", "header_text"));
+ ->value(module::get_var("gallery", "header_text"));
$group->textarea("footer_text")->label(t("Footer text"))->id("gFooterText")
- ->value(module::get_var("core", "footer_text"));
+ ->value(module::get_var("gallery", "footer_text"));
$group->submit("")->value(t("Save"));
return $form;
}