diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-06-28 17:57:23 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-06-28 17:57:23 -0600 |
commit | bf79d4372cbaac63f4fee55dbba58bc19f52bc14 (patch) | |
tree | d648c5d7d455da63b36f795f010cc94d55fe3ee5 /modules/gallery/helpers | |
parent | 2b804ebdcea2127ca481ae3fb25a33a3bc5a78c3 (diff) | |
parent | ce6d453b3f32af98e13b62fe10b62173c59bde44 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 49 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_theme.php | 34 |
2 files changed, 61 insertions, 22 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 92fc662d..c3c3543c 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -32,6 +32,16 @@ class gallery_installer { PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {caches} ( + `id` int(9) NOT NULL auto_increment, + `key` varchar(255) NOT NULL, + `tags` varchar(255), + `expiration` int(9) NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`), + KEY (`tags`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {graphics_rules} ( `id` int(9) NOT NULL auto_increment, `active` BOOLEAN default 0, @@ -181,15 +191,6 @@ class gallery_installer { UNIQUE KEY(`module_name`, `name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE {caches} ( - `id` varchar(255) NOT NULL, - `tags` varchar(255), - `expiration` int(9) NOT NULL, - `cache` text, - PRIMARY KEY (`id`), - KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - foreach (array("albums", "logs", "modules", "resizes", "thumbs", "tmp", "uploads") as $dir) { @mkdir(VARPATH . $dir); } @@ -258,7 +259,7 @@ class gallery_installer { module::set_var("gallery", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>"); - module::set_version("gallery", 4); + module::set_version("gallery", 5); } static function upgrade($version) { @@ -278,15 +279,29 @@ class gallery_installer { if ($version == 3) { $db->query("CREATE TABLE {caches} ( - `id` varchar(255) NOT NULL, - `tags` varchar(255), - `expiration` int(9) NOT NULL, - `cache` text, - PRIMARY KEY (`id`), - KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + `id` varchar(255) NOT NULL, + `tags` varchar(255), + `expiration` int(9) NOT NULL, + `cache` text, + PRIMARY KEY (`id`), + KEY (`tags`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); module::set_version("gallery", $version = 4); } + + if ($version == 4) { + Cache::instance()->delete_all(); + $db->query("ALTER TABLE {caches} MODIFY COLUMN `cache` LONGBLOB"); + module::set_version("gallery", $version = 5); + } + + if ($version == 5) { + Cache::instance()->delete_all(); + $db->query("ALTER TABLE {caches} DROP COLUMN `id`"); + $db->query("ALTER TABLE {caches} ADD COLUMN `key` varchar(255) NOT NULL"); + $db->query("ALTER TABLE {caches} ADD COLUMN `id` int(9) NOT NULL auto_increment PRIMARY KEY"); + module::set_version("gallery", $version = 6); + } } static function uninstall() { diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index a96c8f5b..b6b24b27 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -21,6 +21,22 @@ class gallery_theme_Core { static function head($theme) { $session = Session::instance(); $buf = ""; + $theme->script("lib/jquery.js"); + $theme->script("lib/jquery.form.js"); + $theme->script("lib/jquery-ui.js"); + $theme->script("lib/gallery.common.js"); + $theme->script("lib/gallery.dialog.js"); + $theme->script("lib/gallery.form.js"); + $theme->script("lib/superfish/js/superfish.js"); + if ($theme->page_type == 'photo') { + $theme->script("lib/jquery.scrollTo.js"); + $theme->script("lib/jquery.localscroll.js"); + $theme->script("lib/gallery.show_full_size.js"); + } + if ($theme->page_type == 'movie') { + $theme->script("lib/flowplayer.js"); + } + $theme->script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />"; @@ -29,7 +45,7 @@ class gallery_theme_Core { && access::can("edit", $theme->item())) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/quick.css") . "\" />"; - $buf .= html::script("modules/gallery/js/quick.js"); + $theme->script("modules/gallery/js/quick.js"); } if (module::is_active("rss")) { @@ -43,8 +59,8 @@ class gallery_theme_Core { if ($session->get("l10n_mode", false)) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />"; - $buf .= html::script("lib/jquery.cookie.js"); - $buf .= html::script("modules/gallery/js/l10n_client.js"); + $theme->script("lib/jquery.cookie.js"); + $theme->script("modules/gallery/js/l10n_client.js"); } return $buf; @@ -79,6 +95,14 @@ class gallery_theme_Core { static function admin_head($theme) { $session = Session::instance(); $buf = ""; + $theme->script("lib/jquery.js"); + $theme->script("lib/jquery.form.js"); + $theme->script("lib/jquery-ui.js"); + $theme->script("lib/gallery.common.js"); + $theme->script("lib/gallery.dialog.js"); + $theme->script("lib/superfish/js/superfish.js"); + $theme->script($theme->url("js/jquery.dropshadow.js", false, true)); + $theme->script($theme->url("js/ui.init.js", false, true)); if ($session->get("debug")) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/debug.css") . "\" />"; @@ -87,8 +111,8 @@ class gallery_theme_Core { if ($session->get("l10n_mode", false)) { $buf .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . url::file("modules/gallery/css/l10n_client.css") . "\" />"; - $buf .= html::script("lib/jquery.cookie.js"); - $buf .= html::script("modules/gallery/js/l10n_client.js"); + $theme->script("lib/jquery.cookie.js"); + $theme->script("modules/gallery/js/l10n_client.js"); } return $buf; |