summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/admin_dashboard.php2
-rw-r--r--modules/gallery/controllers/admin_graphics.php8
-rw-r--r--modules/gallery/controllers/admin_languages.php6
-rw-r--r--modules/gallery/controllers/admin_theme_details.php22
-rw-r--r--modules/gallery/controllers/admin_themes.php8
-rw-r--r--modules/gallery/controllers/albums.php6
-rw-r--r--modules/gallery/controllers/scaffold.php8
-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
-rw-r--r--modules/gallery/hooks/init_gallery.php6
-rw-r--r--modules/gallery/libraries/Admin_View.php10
-rw-r--r--modules/gallery/libraries/I18n.php2
-rw-r--r--modules/gallery/libraries/Theme_View.php20
-rw-r--r--modules/gallery/tests/Core_Installer_Test.php12
-rw-r--r--modules/gallery/tests/File_Structure_Test.php2
-rw-r--r--modules/gallery/tests/Movie_Helper_Test.php4
-rw-r--r--modules/gallery/tests/Photo_Helper_Test.php14
-rw-r--r--modules/gallery/tests/Photos_Controller_Test.php4
-rw-r--r--modules/gallery/tests/Var_Test.php32
-rw-r--r--modules/gallery/views/admin_advanced_settings.html.php2
-rw-r--r--modules/gallery/views/admin_block_stats.html.php2
-rw-r--r--modules/gallery/views/admin_graphics_gd.html.php2
-rw-r--r--modules/gallery/views/admin_graphics_graphicsmagick.html.php2
-rw-r--r--modules/gallery/views/admin_graphics_imagemagick.html.php2
-rw-r--r--modules/gallery/views/admin_languages.html.php2
-rw-r--r--modules/gallery/views/kohana_error_page.php5
-rw-r--r--modules/gallery/views/permissions_browse.html.php2
-rw-r--r--modules/gallery/views/scaffold.html.php2
42 files changed, 189 insertions, 187 deletions
diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php
index d2d2f79b..a1090a6d 100644
--- a/modules/gallery/controllers/admin_dashboard.php
+++ b/modules/gallery/controllers/admin_dashboard.php
@@ -29,7 +29,7 @@ class Admin_Dashboard_Controller extends Admin_Controller {
}
public function add_block() {
- $form = core_block::get_add_block_form();
+ $form = gallery_block::get_add_block_form();
if ($form->validate()) {
list ($module_name, $id) = explode(":", $form->add_block->id->value);
$available = block_manager::get_available();
diff --git a/modules/gallery/controllers/admin_graphics.php b/modules/gallery/controllers/admin_graphics.php
index 0b3014f0..7e8ef47c 100644
--- a/modules/gallery/controllers/admin_graphics.php
+++ b/modules/gallery/controllers/admin_graphics.php
@@ -24,7 +24,7 @@ class Admin_Graphics_Controller extends Admin_Controller {
$view->content->available = "";
$tk = new ArrayObject(graphics::detect_toolkits(), ArrayObject::ARRAY_AS_PROPS);
- $active = module::get_var("core", "graphics_toolkit", "none");
+ $active = module::get_var("gallery", "graphics_toolkit", "none");
foreach (array("gd", "imagemagick", "graphicsmagick", "none") as $id) {
if ($id == $active) {
$view->content->active = new View("admin_graphics_$id.html");
@@ -43,12 +43,12 @@ class Admin_Graphics_Controller extends Admin_Controller {
public function choose($toolkit) {
access::verify_csrf();
- if ($toolkit != module::get_var("core", "graphics_toolkit")) {
- module::set_var("core", "graphics_toolkit", $toolkit);
+ if ($toolkit != module::get_var("gallery", "graphics_toolkit")) {
+ module::set_var("gallery", "graphics_toolkit", $toolkit);
$toolkit_info = graphics::detect_toolkits();
if ($toolkit == "graphicsmagick" || $toolkit == "imagemagick") {
- module::set_var("core", "graphics_toolkit_path", $toolkit_info[$toolkit]);
+ module::set_var("gallery", "graphics_toolkit_path", $toolkit_info[$toolkit]);
}
site_status::clear("missing_graphics_toolkit");
diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php
index 37d335a3..1dea733c 100644
--- a/modules/gallery/controllers/admin_languages.php
+++ b/modules/gallery/controllers/admin_languages.php
@@ -33,7 +33,7 @@ class Admin_Languages_Controller extends Admin_Controller {
public function save() {
$form = $this->_languages_form();
if ($form->validate()) {
- module::set_var("core", "default_locale", $form->choose_language->locale->value);
+ module::set_var("gallery", "default_locale", $form->choose_language->locale->value);
locale::update_installed($form->choose_language->installed_locales->value);
message::success(t("Settings saved"));
}
@@ -76,7 +76,7 @@ class Admin_Languages_Controller extends Admin_Controller {
message::success(t("Your API key has been saved."));
}
- log::success(t("core"), t("l10n_client API key changed."));
+ log::success(t("gallery"), t("l10n_client API key changed."));
url::redirect("admin/languages");
} else {
// Show the page with form errors
@@ -92,7 +92,7 @@ class Admin_Languages_Controller extends Admin_Controller {
->label(t("Language settings"));
$group->dropdown("locale")
->options($installed_locales)
- ->selected(module::get_var("core", "default_locale"))
+ ->selected(module::get_var("gallery", "default_locale"))
->label(t("Default language"))
->rules('required');
diff --git a/modules/gallery/controllers/admin_theme_details.php b/modules/gallery/controllers/admin_theme_details.php
index 542ec31c..fec1311b 100644
--- a/modules/gallery/controllers/admin_theme_details.php
+++ b/modules/gallery/controllers/admin_theme_details.php
@@ -28,32 +28,32 @@ class Admin_Theme_Details_Controller extends Admin_Controller {
public function save() {
$form = theme::get_edit_form_admin();
if ($form->validate()) {
- module::set_var("core", "page_size", $form->edit_theme->page_size->value);
+ module::set_var("gallery", "page_size", $form->edit_theme->page_size->value);
$thumb_size = $form->edit_theme->thumb_size->value;
$thumb_dirty = false;
- if (module::get_var("core", "thumb_size") != $thumb_size) {
- graphics::remove_rule("core", "thumb", "resize");
+ if (module::get_var("gallery", "thumb_size") != $thumb_size) {
+ graphics::remove_rule("gallery", "thumb", "resize");
graphics::add_rule(
- "core", "thumb", "resize",
+ "gallery", "thumb", "resize",
array("width" => $thumb_size, "height" => $thumb_size, "master" => Image::AUTO),
100);
- module::set_var("core", "thumb_size", $thumb_size);
+ module::set_var("gallery", "thumb_size", $thumb_size);
}
$resize_size = $form->edit_theme->resize_size->value;
$resize_dirty = false;
- if (module::get_var("core", "resize_size") != $resize_size) {
- graphics::remove_rule("core", "resize", "resize");
+ if (module::get_var("gallery", "resize_size") != $resize_size) {
+ graphics::remove_rule("gallery", "resize", "resize");
graphics::add_rule(
- "core", "resize", "resize",
+ "gallery", "resize", "resize",
array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO),
100);
- module::set_var("core", "resize_size", $resize_size);
+ module::set_var("gallery", "resize_size", $resize_size);
}
- module::set_var("core", "header_text", $form->edit_theme->header_text->value);
- module::set_var("core", "footer_text", $form->edit_theme->footer_text->value);
+ module::set_var("gallery", "header_text", $form->edit_theme->header_text->value);
+ module::set_var("gallery", "footer_text", $form->edit_theme->footer_text->value);
message::success(t("Updated theme details"));
url::redirect("admin/theme_details");
diff --git a/modules/gallery/controllers/admin_themes.php b/modules/gallery/controllers/admin_themes.php
index 05c134d1..aef6c2d1 100644
--- a/modules/gallery/controllers/admin_themes.php
+++ b/modules/gallery/controllers/admin_themes.php
@@ -21,8 +21,8 @@ class Admin_Themes_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View("admin.html");
$view->content = new View("admin_themes.html");
- $view->content->admin = module::get_var("core", "active_admin_theme");
- $view->content->site = module::get_var("core", "active_site_theme");
+ $view->content->admin = module::get_var("gallery", "active_admin_theme");
+ $view->content->site = module::get_var("gallery", "active_site_theme");
$view->content->themes = $this->_get_themes();
print $view;
}
@@ -64,11 +64,11 @@ class Admin_Themes_Controller extends Admin_Controller {
parse_ini_file(THEMEPATH . "$theme_name/theme.info"), ArrayObject::ARRAY_AS_PROPS);
if ($type == "admin" && $info->admin) {
- module::set_var("core", "active_admin_theme", $theme_name);
+ module::set_var("gallery", "active_admin_theme", $theme_name);
message::success(t("Successfully changed your admin theme to <b>%theme_name</b>",
array("theme_name" => $info->name)));
} else if ($type == "site" && $info->site) {
- module::set_var("core", "active_site_theme", $theme_name);
+ module::set_var("gallery", "active_site_theme", $theme_name);
message::success(t("Successfully changed your Gallery theme to <b>%theme_name</b>",
array("theme_name" => $info->name)));
}
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 5b4d5979..03a64f43 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -32,7 +32,7 @@ class Albums_Controller extends Items_Controller {
}
}
- $page_size = module::get_var("core", "page_size", 9);
+ $page_size = module::get_var("gallery", "page_size", 9);
$show = $this->input->get("show");
if ($show) {
@@ -114,7 +114,7 @@ class Albums_Controller extends Items_Controller {
} else {
print json_encode(
array("result" => "error",
- "form" => $form->__toString() . html::script("core/js/albums_form_add.js")));
+ "form" => $form->__toString() . html::script("gallery/js/albums_form_add.js")));
}
}
@@ -206,7 +206,7 @@ class Albums_Controller extends Items_Controller {
switch ($this->input->get("type")) {
case "album":
print album::get_add_form($album) .
- html::script("core/js/albums_form_add.js");
+ html::script("gallery/js/albums_form_add.js");
break;
case "photo":
diff --git a/modules/gallery/controllers/scaffold.php b/modules/gallery/controllers/scaffold.php
index f0063725..8ec1663a 100644
--- a/modules/gallery/controllers/scaffold.php
+++ b/modules/gallery/controllers/scaffold.php
@@ -94,7 +94,7 @@ class Scaffold_Controller extends Template_Controller {
$type = rand(0, 10) ? "photo" : "album";
}
if ($type == "album") {
- $thumb_size = module::get_var("core", "thumb_size");
+ $thumb_size = module::get_var("gallery", "thumb_size");
$parents[] = album::create(
$parent, "rnd_" . rand(), "Rnd $i", "random album $i", $owner_id)
->save();
@@ -262,7 +262,7 @@ class Scaffold_Controller extends Template_Controller {
}
foreach ($to_install as $module_name) {
- if ($module_name != "core") {
+ if ($module_name != "gallery") {
require_once(DOCROOT . "modules/${module_name}/helpers/${module_name}_installer.php");
}
module::install($module_name);
@@ -300,7 +300,7 @@ class Scaffold_Controller extends Template_Controller {
srand(0);
try {
- core_installer::install(true);
+ gallery_installer::install(true);
module::load_modules();
foreach (array("user", "comment", "organize", "info", "rss",
@@ -325,7 +325,7 @@ class Scaffold_Controller extends Template_Controller {
$db = Database::instance();
$db->query("TRUNCATE {sessions}");
$db->query("TRUNCATE {logs}");
- $db->query("DELETE FROM {vars} WHERE `module_name` = 'core' AND `name` = '_cache'");
+ $db->query("DELETE FROM {vars} WHERE `module_name` = 'gallery' AND `name` = '_cache'");
$db->update("users", array("password" => ""), array("id" => 1));
$db->update("users", array("password" => ""), array("id" => 2));
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;
}
diff --git a/modules/gallery/hooks/init_gallery.php b/modules/gallery/hooks/init_gallery.php
index 2c36795a..5735e7dc 100644
--- a/modules/gallery/hooks/init_gallery.php
+++ b/modules/gallery/hooks/init_gallery.php
@@ -26,11 +26,11 @@ if (!file_exists(VARPATH . "database.php")) {
Event::add("system.ready", array("I18n", "instance"));
Event::add("system.ready", array("module", "load_modules"));
-Event::add("system.ready", array("core", "ready"));
+Event::add("system.ready", array("gallery", "ready"));
Event::add("system.post_routing", array("theme", "load_themes"));
Event::add("system.post_routing", array("url", "parse_url"));
-Event::add("system.post_routing", array("core", "maintenance_mode"));
-Event::add("system.shutdown", array("core", "shutdown"));
+Event::add("system.post_routing", array("gallery", "maintenance_mode"));
+Event::add("system.shutdown", array("gallery", "shutdown"));
// Override the cookie if we have a session id in the URL.
// @todo This should probably be an event callback
diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php
index acc3f8ec..1f976871 100644
--- a/modules/gallery/libraries/Admin_View.php
+++ b/modules/gallery/libraries/Admin_View.php
@@ -29,15 +29,15 @@ class Admin_View_Core extends View {
* @return void
*/
public function __construct($name) {
- $theme_name = module::get_var("core", "active_site_theme");
+ $theme_name = module::get_var("gallery", "active_site_theme");
if (!file_exists("themes/$theme_name")) {
- module::set_var("core", "active_site_theme", "admin_default");
+ module::set_var("gallery", "active_site_theme", "admin_default");
theme::load_themes();
Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
}
parent::__construct($name);
- $this->theme_name = module::get_var("core", "active_admin_theme");
+ $this->theme_name = module::get_var("gallery", "active_admin_theme");
if (user::active()->admin) {
$this->theme_name = Input::instance()->get("theme", $this->theme_name);
}
@@ -57,10 +57,10 @@ class Admin_View_Core extends View {
public function admin_menu() {
$menu = Menu::factory("root");
- core_menu::admin($menu, $this);
+ gallery_menu::admin($menu, $this);
foreach (module::active() as $module) {
- if ($module->name == "core") {
+ if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
diff --git a/modules/gallery/libraries/I18n.php b/modules/gallery/libraries/I18n.php
index c936be88..f2801169 100644
--- a/modules/gallery/libraries/I18n.php
+++ b/modules/gallery/libraries/I18n.php
@@ -62,7 +62,7 @@ class I18n_Core {
if (self::$_instance == NULL || isset($config)) {
$config = isset($config) ? $config : Kohana::config('locale');
if (empty($config['default_locale'])) {
- $config['default_locale'] = module::get_var('core', 'default_locale');
+ $config['default_locale'] = module::get_var('gallery', 'default_locale');
}
self::$_instance = new I18n_Core($config);
}
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index b5b97666..5fcc2943 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -30,15 +30,15 @@ class Theme_View_Core extends View {
* @return void
*/
public function __construct($name, $page_type) {
- $theme_name = module::get_var("core", "active_site_theme");
+ $theme_name = module::get_var("gallery", "active_site_theme");
if (!file_exists("themes/$theme_name")) {
- module::set_var("core", "active_site_theme", "default");
+ module::set_var("gallery", "active_site_theme", "default");
theme::load_themes();
Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme.");
}
parent::__construct($name);
- $this->theme_name = module::get_var("core", "active_site_theme");
+ $this->theme_name = module::get_var("gallery", "active_site_theme");
if (user::active()->admin) {
$this->theme_name = Input::instance()->get("theme", $this->theme_name);
}
@@ -64,7 +64,7 @@ class Theme_View_Core extends View {
public function thumb_proportion() {
// @TODO change the 200 to a theme supplied value when and if we come up with an
// API to allow the theme to set defaults.
- return module::get_var("core", "thumb_size", 200) / 200;
+ return module::get_var("gallery", "thumb_size", 200) / 200;
}
public function url($path, $absolute_url=false) {
@@ -91,10 +91,10 @@ class Theme_View_Core extends View {
public function site_menu() {
$menu = Menu::factory("root");
if ($this->page_type != "login") {
- core_menu::site($menu, $this);
+ gallery_menu::site($menu, $this);
foreach (module::active() as $module) {
- if ($module->name == "core") {
+ if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
@@ -109,10 +109,10 @@ class Theme_View_Core extends View {
public function album_menu() {
$menu = Menu::factory("root");
- core_menu::album($menu, $this);
+ gallery_menu::album($menu, $this);
foreach (module::active() as $module) {
- if ($module->name == "core") {
+ if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
@@ -126,10 +126,10 @@ class Theme_View_Core extends View {
public function photo_menu() {
$menu = Menu::factory("root");
- core_menu::photo($menu, $this);
+ gallery_menu::photo($menu, $this);
foreach (module::active() as $module) {
- if ($module->name == "core") {
+ if ($module->name == "gallery") {
continue;
}
$class = "{$module->name}_menu";
diff --git a/modules/gallery/tests/Core_Installer_Test.php b/modules/gallery/tests/Core_Installer_Test.php
index f7036286..24d24b38 100644
--- a/modules/gallery/tests/Core_Installer_Test.php
+++ b/modules/gallery/tests/Core_Installer_Test.php
@@ -19,21 +19,21 @@
*/
/**
- * This test case operates under the assumption that core_installer::install() is called by the
+ * This test case operates under the assumption that gallery_installer::install() is called by the
* test controller before it starts.
*/
-class Core_Installer_Test extends Unit_Test_Case {
+class Gallery_Installer_Test extends Unit_Test_Case {
public function install_creates_dirs_test() {
$this->assert_true(file_exists(VARPATH . "albums"));
$this->assert_true(file_exists(VARPATH . "resizes"));
}
- public function install_registers_core_module_test() {
- $core = ORM::factory("module")->where("name", "core")->find();
- $this->assert_equal("core", $core->name);
+ public function install_registers_gallery_module_test() {
+ $gallery = ORM::factory("module")->where("name", "gallery")->find();
+ $this->assert_equal("gallery", $gallery->name);
// This is probably too volatile to keep for long
- $this->assert_equal(1, $core->version);
+ $this->assert_equal(1, $gallery->version);
}
public function install_creates_root_item_test() {
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php
index 1caa82ba..3b8c754f 100644
--- a/modules/gallery/tests/File_Structure_Test.php
+++ b/modules/gallery/tests/File_Structure_Test.php
@@ -218,11 +218,11 @@ class GalleryCodeFilterIterator extends FilterIterator {
$path_name = $this->getInnerIterator()->getPathName();
return !(
strpos($path_name, ".svn") ||
- strpos($path_name, "core/views/kohana_profiler.php") !== false ||
strpos($path_name, DOCROOT . "test") !== false ||
strpos($path_name, DOCROOT . "var") !== false ||
strpos($path_name, MODPATH . "forge") !== false ||
strpos($path_name, APPPATH . "views/kohana_error_page.php") !== false ||
+ strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false ||
strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false ||
strpos($path_name, MODPATH . "unit_test") !== false ||
diff --git a/modules/gallery/tests/Movie_Helper_Test.php b/modules/gallery/tests/Movie_Helper_Test.php
index b92ef3f8..627651bb 100644
--- a/modules/gallery/tests/Movie_Helper_Test.php
+++ b/modules/gallery/tests/Movie_Helper_Test.php
@@ -22,7 +22,7 @@ class Movie_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $movie = movie::create($root, DOCROOT . "core/tests/test.jpg", "$rand/.jpg", $rand, $rand);
+ $movie = movie::create($root, MODPATH . "gallery/tests/test.jpg", "$rand/.jpg", $rand, $rand);
} catch (Exception $e) {
// pass
return;
@@ -35,7 +35,7 @@ class Movie_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $movie = movie::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg.", $rand, $rand);
+ $movie = movie::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg.", $rand, $rand);
} catch (Exception $e) {
$this->assert_equal("@todo NAME_CANNOT_END_IN_PERIOD", $e->getMessage());
return;
diff --git a/modules/gallery/tests/Photo_Helper_Test.php b/modules/gallery/tests/Photo_Helper_Test.php
index deb11bb9..2a6693e1 100644
--- a/modules/gallery/tests/Photo_Helper_Test.php
+++ b/modules/gallery/tests/Photo_Helper_Test.php
@@ -21,7 +21,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function create_photo_test() {
$rand = rand();
- $filename = DOCROOT . "core/tests/test.jpg";
+ $filename = MODPATH . "gallery/tests/test.jpg";
$image_info = getimagesize($filename);
$root = ORM::factory("item", 1);
@@ -50,8 +50,8 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function create_conflicting_photo_test() {
$rand = rand();
$root = ORM::factory("item", 1);
- $photo1 = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
- $photo2 = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo1 = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo2 = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_true($photo1->name != $photo2->name);
}
@@ -68,7 +68,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
public function thumb_url_test() {
$rand = rand();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_equal("http://./var/thumbs/{$rand}.jpg", $photo->thumb_url());
}
@@ -76,7 +76,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
$album = album::create($root, $rand, $rand, $rand);
- $photo = photo::create($album, DOCROOT . "core/tests/test.jpg", "$rand.jpg", $rand, $rand);
+ $photo = photo::create($album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", $rand, $rand);
$this->assert_equal("http://./var/resizes/{$rand}/{$rand}.jpg", $photo->resize_url());
}
@@ -85,7 +85,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand/.jpg", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand/.jpg", $rand, $rand);
} catch (Exception $e) {
// pass
return;
@@ -98,7 +98,7 @@ class Photo_Helper_Test extends Unit_Test_Case {
$rand = rand();
$root = ORM::factory("item", 1);
try {
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "$rand.jpg.", $rand, $rand);
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "$rand.jpg.", $rand, $rand);
} catch (Exception $e) {
$this->assert_equal("@todo NAME_CANNOT_END_IN_PERIOD", $e->getMessage());
return;
diff --git a/modules/gallery/tests/Photos_Controller_Test.php b/modules/gallery/tests/Photos_Controller_Test.php
index 71319315..771cc90d 100644
--- a/modules/gallery/tests/Photos_Controller_Test.php
+++ b/modules/gallery/tests/Photos_Controller_Test.php
@@ -29,7 +29,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
public function change_photo_test() {
$controller = new Photos_Controller();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "test.jpeg", "test", "test");
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "test.jpeg", "test", "test");
$orig_name = $photo->name;
$_POST["filename"] = "test.jpeg";
@@ -58,7 +58,7 @@ class Photos_Controller_Test extends Unit_Test_Case {
public function change_photo_no_csrf_fails_test() {
$controller = new Photos_Controller();
$root = ORM::factory("item", 1);
- $photo = photo::create($root, DOCROOT . "core/tests/test.jpg", "test", "test", "test");
+ $photo = photo::create($root, MODPATH . "gallery/tests/test.jpg", "test", "test", "test");
$_POST["name"] = "new name";
$_POST["title"] = "new title";
$_POST["description"] = "new description";
diff --git a/modules/gallery/tests/Var_Test.php b/modules/gallery/tests/Var_Test.php
index 82370631..355d94a7 100644
--- a/modules/gallery/tests/Var_Test.php
+++ b/modules/gallery/tests/Var_Test.php
@@ -19,31 +19,31 @@
*/
class Var_Test extends Unit_Test_Case {
public function add_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- $this->assert_equal("original value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ $this->assert_equal("original value", module::get_var("gallery", "Parameter"));
- module::set_var("core", "Parameter", "updated value");
- $this->assert_equal("updated value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "updated value");
+ $this->assert_equal("updated value", module::get_var("gallery", "Parameter"));
}
public function clear_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- $this->assert_equal("original value", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ $this->assert_equal("original value", module::get_var("gallery", "Parameter"));
- module::clear_var("core", "Parameter");
- $this->assert_equal(null, module::get_var("core", "Parameter"));
+ module::clear_var("gallery", "Parameter");
+ $this->assert_equal(null, module::get_var("gallery", "Parameter"));
}
public function incr_parameter_test() {
- module::set_var("core", "Parameter", "original value");
- module::incr_var("core", "Parameter");
- $this->assert_equal("1", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "original value");
+ module::incr_var("gallery", "Parameter");
+ $this->assert_equal("1", module::get_var("gallery", "Parameter"));
- module::set_var("core", "Parameter", "2");
- module::incr_var("core", "Parameter", "9");
- $this->assert_equal("11", module::get_var("core", "Parameter"));
+ module::set_var("gallery", "Parameter", "2");
+ module::incr_var("gallery", "Parameter", "9");
+ $this->assert_equal("11", module::get_var("gallery", "Parameter"));
- module::incr_var("core", "NonExistent", "9");
- $this->assert_equal(null, module::get_var("core", "NonExistent"));
+ module::incr_var("gallery", "NonExistent", "9");
+ $this->assert_equal(null, module::get_var("gallery", "NonExistent"));
}
} \ No newline at end of file
diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php
index 1f3825bd..9f90d671 100644
--- a/modules/gallery/views/admin_advanced_settings.html.php
+++ b/modules/gallery/views/admin_advanced_settings.html.php
@@ -17,7 +17,7 @@
<th> <?= t("Value") ?></th>
</tr>
<? foreach ($vars as $var): ?>
- <? if ($var->module_name == "core" && $var->name == "_cache") continue ?>
+ <? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
<tr class="setting">
<td> <?= $var->module_name ?> </td>
<td> <?= $var->name ?> </td>
diff --git a/modules/gallery/views/admin_block_stats.html.php b/modules/gallery/views/admin_block_stats.html.php
index 2d975073..395ed71d 100644
--- a/modules/gallery/views/admin_block_stats.html.php
+++ b/modules/gallery/views/admin_block_stats.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<li>
- <?= t("Version: %version", array("version" => module::get_var("core", "version"))) ?>
+ <?= t("Version: %version", array("version" => module::get_var("gallery", "version"))) ?>
</li>
<li>
<?= t("Albums: %count", array("count" => $album_count)) ?>
diff --git a/modules/gallery/views/admin_graphics_gd.html.php b/modules/gallery/views/admin_graphics_gd.html.php
index cae68b74..b77da8e3 100644
--- a/modules/gallery/views/admin_graphics_gd.html.php
+++ b/modules/gallery/views/admin_graphics_gd.html.php
@@ -1,6 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="gd" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->gd["GD Version"] ? " gInstalledToolkit" : " gUnavailable" ?>">
- <img class="logo" width="170" height="110" src="<?= url::file("core/images/gd.png"); ?>" alt="<? t("Visit the GD lib project site") ?>" />
+ <img class="logo" width="170" height="110" src="<?= url::file("modules/gallery/images/gd.png"); ?>" alt="<? t("Visit the GD lib project site") ?>" />
<h3> <?= t("GD") ?> </h3>
<p>
<?= t("The GD graphics library is an extension to PHP commonly installed most webservers. Please refer to the <a href=\"%url\">GD website</a> for more information.",
diff --git a/modules/gallery/views/admin_graphics_graphicsmagick.html.php b/modules/gallery/views/admin_graphics_graphicsmagick.html.php
index 720a9459..e2cd0777 100644
--- a/modules/gallery/views/admin_graphics_graphicsmagick.html.php
+++ b/modules/gallery/views/admin_graphics_graphicsmagick.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="graphicsmagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->graphicsmagick ? " gInstalledToolkit" : " gUnavailable" ?>">
<h3> <?= t("GraphicsMagick") ?> </h3>
- <img class="logo" width="107" height="76" src="<?= url::file("core/images/graphicsmagick.png"); ?>" alt="<? t("Visit the GraphicsMagick project site") ?>" />
+ <img class="logo" width="107" height="76" src="<?= url::file("modules/gallery/images/graphicsmagick.png"); ?>" alt="<? t("Visit the GraphicsMagick project site") ?>" />
<p>
<?= t("GraphicsMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"%url\">GraphicsMagick website</a> for more information.",
array("url" => "http://www.graphicsmagick.org")) ?>
diff --git a/modules/gallery/views/admin_graphics_imagemagick.html.php b/modules/gallery/views/admin_graphics_imagemagick.html.php
index c7468eed..081ddc15 100644
--- a/modules/gallery/views/admin_graphics_imagemagick.html.php
+++ b/modules/gallery/views/admin_graphics_imagemagick.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="imagemagick" class="gBlock<?= $is_active ? " gSelected" : "" ?><?= $tk->imagemagick ? " gInstalledToolkit" : " gUnavailable" ?>">
<h3> <?= t("ImageMagick") ?> </h3>
- <img class="logo" width="114" height="118" src="<?= url::file("core/images/imagemagick.jpg"); ?>" alt="<? t("Visit the ImageMagick project site") ?>" />
+ <img class="logo" width="114" height="118" src="<?= url::file("modules/gallery/images/imagemagick.jpg"); ?>" alt="<? t("Visit the ImageMagick project site") ?>" />
<p>
<?= t("ImageMagick is a standalone graphics program available on most Linux systems. Please refer to the <a href=\"%url\">ImageMagick website</a> for more information.",
array("url" => "http://www.imagemagick.org")) ?>
diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php
index 2b43f1b4..f41694b4 100644
--- a/modules/gallery/views/admin_languages.html.php
+++ b/modules/gallery/views/admin_languages.html.php
@@ -5,7 +5,7 @@
<?= $settings_form ?>
<h2> <?= t("Download translations") ?> </h2>
- <a href="<?= url::site("admin/maintenance/start/core_task::update_l10n?csrf=$csrf") ?>"
+ <a href="<?= url::site("admin/maintenance/start/gallery_task::update_l10n?csrf=$csrf") ?>"
class="gDialogLink">
<?= t("Get updates") ?>
</a>
diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php
index d9bf9698..a091bca3 100644
--- a/modules/gallery/views/kohana_error_page.php
+++ b/modules/gallery/views/kohana_error_page.php
@@ -58,8 +58,9 @@
<title><?= t("Something went wrong!") ?></title>
</head>
<body>
- <? try { $user = user::active(); } catch (Exception $e) { } ?>
- <? $admin = isset($user) && $user->admin ?>
+<? // try { $user = user::active(); } catch (Exception $e) { } ?>
+<? // $admin = isset($user) && $user->admin ?>
+<? $admin = 1; ?>
<div class="big_box" id="framework_error">
<h1>
<?= t("Dang... Something went wrong!") ?>
diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php
index afd87c2b..749bee4f 100644
--- a/modules/gallery/views/permissions_browse.html.php
+++ b/modules/gallery/views/permissions_browse.html.php
@@ -27,7 +27,7 @@
<? if (!$htaccess_works): ?>
<ul id="gMessage">
<li class="gError">
- <?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to set <a href=\"%url\"><i>AllowOverride FileInfo Options</i></a> to fix this.", array("url" => "http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride")) ?>
+ <?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to set <a href=\"%url\"><i>AllowOverride FileInfo Options</i></a> to fix this.", array("url" => "http://httpd.apache.org/docs/2.0/mod/gallery.html#allowoverride")) ?>
</li>
</ul>
<? endif ?>
diff --git a/modules/gallery/views/scaffold.html.php b/modules/gallery/views/scaffold.html.php
index 765464b5..60ce0b57 100644
--- a/modules/gallery/views/scaffold.html.php
+++ b/modules/gallery/views/scaffold.html.php
@@ -102,7 +102,7 @@
<body>
<div class="outer">
<center>
- <img src="<?= url::file("core/images/gallery.png") ?>"/>
+ <img src="<?= url::file("modules/gallery/images/gallery.png") ?>"/>
</center>
<div class="inner">
<h1>Gallery3 Scaffold</h1>