diff options
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/css/upgrader.css | 117 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 65 | ||||
-rw-r--r-- | modules/gallery/views/upgrader.html.php | 108 |
3 files changed, 159 insertions, 131 deletions
diff --git a/modules/gallery/css/upgrader.css b/modules/gallery/css/upgrader.css new file mode 100644 index 00000000..6bd16064 --- /dev/null +++ b/modules/gallery/css/upgrader.css @@ -0,0 +1,117 @@ +body { + background: #eee; + font-family: Trebuchet MS; + font-size: 1.1em; +} + +h1 { + font-size: 1.4em; +} + +div#outer { + width: 650px; + background: white; + border: 1px solid #999; + margin: 0 auto; + padding: -10px; +} + +div#inner { + padding: 0 1em 0 1em; + margin: 0px; +} + +div#footer { + border-top: 1px solid #ccc; + margin: 1em; +} + +td.name { + text-align: left; + padding-left: 30px; +} + +td { + text-align: center; + border-bottom: 1px solid #eee; +} + +tr.current td { + color: #999; + font-style: italic; +} + +tr.current td.gallery { + color: #00d; +} + +tr.upgradeable td { + font-weight: bold; +} + +tr.upgradeable td.gallery { + color: #00d; +} + +table { + width: 600px; + margin-bottom: 10px; +} + +p { + font-size: .9em; +} + +ul { + font-size: .9em; + list-style: none; +} + +li { + display: inline; +} + +li:before { + content: "\00BB \0020"; +} + +div.button { + margin: 0 auto; + width: 120px; + text-align: center; + border: 1px solid #999; + background: #eee; +} + +div.button a { + text-decoration: none; +} + +div.button:hover { + background: #ccc; +} + +div#confirmation { + position: absolute; + background: blue; + z-index: 1000; + margin: 10px; + text-align: center; +} + +div#confirmation div { + margin: 2px; + padding: 20px; + border: 2px solid #999; + background: #eee; +} + +.gray_on_done { + opacity: <?= $done ? "0.5" : "1" ?>; +} + +pre { + display: inline; + margin: 0px; + padding: 0px; +} diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index b2be63be..cd871c17 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -50,6 +50,18 @@ class gallery_installer { PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {incoming_translations} ( + `id` int(9) NOT NULL auto_increment, + `key` char(32) NOT NULL, + `locale` char(10) NOT NULL, + `message` text NOT NULL, + `revision` int(9) DEFAULT NULL, + `translation` text, + PRIMARY KEY (`id`), + UNIQUE KEY(`key`, `locale`), + KEY `locale_key` (`locale`, `key`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {items} ( `id` int(9) NOT NULL auto_increment, `album_cover_item_id` int(9) default NULL, @@ -117,44 +129,24 @@ class gallery_installer { UNIQUE KEY(`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE {themes} ( - `id` int(9) NOT NULL auto_increment, - `name` varchar(64) default NULL, - `version` int(9) default NULL, - PRIMARY KEY (`id`), - UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE {permissions} ( - `id` int(9) NOT NULL auto_increment, - `display_name` varchar(64) default NULL, - `name` varchar(64) default NULL, - PRIMARY KEY (`id`), - UNIQUE KEY(`name`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE {incoming_translations} ( + $db->query("CREATE TABLE {outgoing_translations} ( `id` int(9) NOT NULL auto_increment, + `base_revision` int(9) DEFAULT NULL, `key` char(32) NOT NULL, `locale` char(10) NOT NULL, `message` text NOT NULL, - `revision` int(9) DEFAULT NULL, `translation` text, PRIMARY KEY (`id`), UNIQUE KEY(`key`, `locale`), KEY `locale_key` (`locale`, `key`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE {outgoing_translations} ( + $db->query("CREATE TABLE {permissions} ( `id` int(9) NOT NULL auto_increment, - `base_revision` int(9) DEFAULT NULL, - `key` char(32) NOT NULL, - `locale` char(10) NOT NULL, - `message` text NOT NULL, - `translation` text, + `display_name` varchar(64) default NULL, + `name` varchar(64) default NULL, PRIMARY KEY (`id`), - UNIQUE KEY(`key`, `locale`), - KEY `locale_key` (`locale`, `key`)) + UNIQUE KEY(`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE {sessions} ( @@ -179,6 +171,14 @@ class gallery_installer { KEY (`owner_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {themes} ( + `id` int(9) NOT NULL auto_increment, + `name` varchar(64) default NULL, + `version` int(9) default NULL, + PRIMARY KEY (`id`), + UNIQUE KEY(`name`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {vars} ( `id` int(9) NOT NULL auto_increment, `module_name` varchar(64) NOT NULL, @@ -248,18 +248,20 @@ class gallery_installer { block_manager::add("dashboard_center", "gallery", "photo_stream"); block_manager::add("dashboard_center", "gallery", "log_entries"); - module::set_version("gallery", 1); + module::set_version("gallery", $version = 1); module::set_var("gallery", "version", "3.0 beta 1"); module::set_var("gallery", "choose_default_tookit", 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>"); - } else if ($version == 1) { + } + + if ($version == 1) { module::set_var("gallery", "date_format", "Y-M-d"); module::set_var("gallery", "date_time_format", "Y-M-d H:i:s"); module::set_var("gallery", "time_format", "H:i:s"); module::set_var("gallery", "version", "3.0 pre beta 2 (git)"); - module::set_version("gallery", 2); + module::set_version("gallery", $version = 2); } } @@ -268,16 +270,15 @@ class gallery_installer { $db->query("DROP TABLE IF EXISTS {access_caches}"); $db->query("DROP TABLE IF EXISTS {access_intents}"); $db->query("DROP TABLE IF EXISTS {graphics_rules}"); + $db->query("DROP TABLE IF EXISTS {incoming_translations}"); $db->query("DROP TABLE IF EXISTS {items}"); $db->query("DROP TABLE IF EXISTS {logs}"); - $db->query("DROP TABLE IF EXISTS {messages}"); $db->query("DROP TABLE IF EXISTS {modules}"); - $db->query("DROP TABLE IF EXISTS {themes}"); - $db->query("DROP TABLE IF EXISTS {incoming_translations}"); $db->query("DROP TABLE IF EXISTS {outgoing_translations}"); $db->query("DROP TABLE IF EXISTS {permissions}"); $db->query("DROP TABLE IF EXISTS {sessions}"); $db->query("DROP TABLE IF EXISTS {tasks}"); + $db->query("DROP TABLE IF EXISTS {themes}"); $db->query("DROP TABLE IF EXISTS {vars}"); foreach (array("albums", "resizes", "thumbs", "uploads", "modules", "logs", "database.php") as $entry) { diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index fa21e196..07792322 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -2,106 +2,10 @@ <html> <head> <title><?= t("Gallery3 Upgrader") ?></title> + <link rel="stylesheet" type="text/css" href="<?= url::file("modules/gallery/css/upgrader.css") ?>" + media="screen,print,projection" /> + <script src="<?= url::file("lib/jquery.js") ?>" type="text/javascript"></script> </head> - <style> - body { - background: #eee; - font-family: Trebuchet MS; - font-size: 1.1em; - } - h1 { - font-size: 1.4em; - } - div#outer { - width: 650px; - background: white; - border: 1px solid #999; - margin: 0 auto; - padding: -10px; - } - div#inner { - padding: 0 1em 0 1em; - margin: 0px; - } - div#footer { - border-top: 1px solid #ccc; - margin: 1em; - } - td.name { - text-align: left; - padding-left: 30px; - } - td { - text-align: center; - border-bottom: 1px solid #eee; - } - tr.current td { - color: #999; - font-style: italic; - } - tr.current td.gallery { - color: #00d; - } - tr.upgradeable td { - font-weight: bold; - } - tr.upgradeable td.gallery { - color: #00d; - } - table { - width: 600px; - margin-bottom: 10px; - } - p { - font-size: .9em; - } - ul { - font-size: .9em; - list-style: none; - } - li { - display: inline; - } - li:before { - content: "\00BB \0020"; - } - div.button { - margin: 0 auto; - width: 120px; - text-align: center; - border: 1px solid #999; - background: #eee; - } - div.button a { - text-decoration: none; - } - div.button:hover { - background: #ccc; - } - div#confirmation { - position: fixed; - top: 400px; - left: 325px; - background: blue; - z-index: 1000; - margin: 10px; - text-align: center; - } - div#confirmation div { - margin: 2px; - padding: 20px; - border: 2px solid #999; - background: white; - } - .gray_on_done { - opacity: <?= $done ? "0.5" : "1" ?>; - } - pre { - display: inline; - margin: 0px; - padding: 0px; - } - </style> <body> <div id="outer"> <img src="<?= url::file("modules/gallery/images/gallery.png") ?>" /> @@ -117,6 +21,12 @@ </p> </div> </div> + <script type="text/javascript"> + $(document).ready(function() { + $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2)); + $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2)); + }); + </script> <? endif ?> <p class="gray_on_done"> <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?> |