summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build_number2
-rw-r--r--installer/install.sql143
-rw-r--r--lib/jquery-ui.js2
-rw-r--r--modules/g2_import/controllers/admin_g2_import.php44
-rw-r--r--modules/g2_import/helpers/g2_import.php21
-rw-r--r--modules/g2_import/helpers/g2_import_task.php2
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php162
-rw-r--r--modules/gallery/controllers/admin_theme_options.php9
-rw-r--r--modules/tag/controllers/tags.php3
-rw-r--r--modules/tag/helpers/tag_block.php2
-rw-r--r--modules/tag/helpers/tag_installer.php7
-rw-r--r--modules/tag/module.info2
12 files changed, 244 insertions, 155 deletions
diff --git a/.build_number b/.build_number
index 70103095..34f951d0 100644
--- a/.build_number
+++ b/.build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=93
+build_number=96
diff --git a/installer/install.sql b/installer/install.sql
index 5dc09cca..ff29e1a0 100644
--- a/installer/install.sql
+++ b/installer/install.sql
@@ -1,6 +1,6 @@
DROP TABLE IF EXISTS {access_caches};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {access_caches} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`item_id` int(9) DEFAULT NULL,
@@ -13,11 +13,11 @@ CREATE TABLE {access_caches} (
PRIMARY KEY (`id`),
KEY `item_id` (`item_id`)
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {access_caches} VALUES (1,1,'1','0','0','1','0','0');
DROP TABLE IF EXISTS {access_intents};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {access_intents} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`item_id` int(9) DEFAULT NULL,
@@ -31,11 +31,11 @@ CREATE TABLE {access_intents} (
`add_2` binary(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {access_intents} VALUES (1,1,'1','1','0','0','1','1','0','0');
DROP TABLE IF EXISTS {caches};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {caches} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`key` varchar(255) NOT NULL,
@@ -46,10 +46,10 @@ CREATE TABLE {caches} (
UNIQUE KEY `key` (`key`),
KEY `tags` (`tags`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {comments};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {comments} (
`author_id` int(9) DEFAULT NULL,
`created` int(9) NOT NULL,
@@ -75,10 +75,10 @@ CREATE TABLE {comments} (
`updated` int(9) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {failed_auths};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {failed_auths} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`count` int(9) NOT NULL,
@@ -86,10 +86,10 @@ CREATE TABLE {failed_auths} (
`time` int(9) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {graphics_rules};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {graphics_rules} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`active` tinyint(1) DEFAULT '0',
@@ -100,12 +100,12 @@ CREATE TABLE {graphics_rules} (
`target` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'thumb');
INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:640;s:6:\"master\";i:2;}','gallery','gallery_graphics::resize',100,'resize');
DROP TABLE IF EXISTS {groups};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {groups} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` char(64) DEFAULT NULL,
@@ -113,25 +113,25 @@ CREATE TABLE {groups} (
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {groups} VALUES (1,'Everybody',1);
INSERT INTO {groups} VALUES (2,'Registered Users',1);
DROP TABLE IF EXISTS {groups_users};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {groups_users} (
`group_id` int(9) NOT NULL,
`user_id` int(9) NOT NULL,
PRIMARY KEY (`group_id`,`user_id`),
UNIQUE KEY `user_id` (`user_id`,`group_id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {groups_users} VALUES (1,1);
INSERT INTO {groups_users} VALUES (1,2);
INSERT INTO {groups_users} VALUES (2,2);
DROP TABLE IF EXISTS {incoming_translations};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {incoming_translations} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`key` char(32) NOT NULL,
@@ -143,10 +143,10 @@ CREATE TABLE {incoming_translations} (
UNIQUE KEY `key` (`key`,`locale`),
KEY `locale_key` (`locale`,`key`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {items};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {items} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`album_cover_item_id` int(9) DEFAULT NULL,
@@ -188,11 +188,11 @@ CREATE TABLE {items} (
KEY `weight` (`weight`),
KEY `left_ptr` (`left_ptr`)
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,2,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
DROP TABLE IF EXISTS {items_tags};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {items_tags} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`item_id` int(9) NOT NULL,
@@ -201,10 +201,10 @@ CREATE TABLE {items_tags} (
KEY `tag_id` (`tag_id`,`id`),
KEY `item_id` (`item_id`,`id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {logs};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {logs} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`category` varchar(64) DEFAULT NULL,
@@ -217,10 +217,10 @@ CREATE TABLE {logs} (
`user_id` int(9) DEFAULT '0',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {messages};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {messages} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`key` varchar(255) DEFAULT NULL,
@@ -229,10 +229,10 @@ CREATE TABLE {messages} (
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {modules};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {modules} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`active` tinyint(1) DEFAULT '0',
@@ -243,7 +243,7 @@ CREATE TABLE {modules} (
UNIQUE KEY `name` (`name`),
KEY `weight` (`weight`)
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {modules} VALUES (1,1,'gallery',47,1);
INSERT INTO {modules} VALUES (2,1,'user',3,2);
INSERT INTO {modules} VALUES (3,1,'comment',4,3);
@@ -252,10 +252,10 @@ INSERT INTO {modules} VALUES (5,1,'info',2,5);
INSERT INTO {modules} VALUES (6,1,'rss',1,6);
INSERT INTO {modules} VALUES (7,1,'search',1,7);
INSERT INTO {modules} VALUES (8,1,'slideshow',2,8);
-INSERT INTO {modules} VALUES (9,1,'tag',2,9);
+INSERT INTO {modules} VALUES (9,1,'tag',3,9);
DROP TABLE IF EXISTS {outgoing_translations};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {outgoing_translations} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`base_revision` int(9) DEFAULT NULL,
@@ -267,10 +267,10 @@ CREATE TABLE {outgoing_translations} (
UNIQUE KEY `key` (`key`,`locale`),
KEY `locale_key` (`locale`,`key`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {permissions};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {permissions} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`display_name` varchar(64) DEFAULT NULL,
@@ -278,14 +278,14 @@ CREATE TABLE {permissions} (
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {permissions} VALUES (1,'View','view');
INSERT INTO {permissions} VALUES (2,'View full size','view_full');
INSERT INTO {permissions} VALUES (3,'Edit','edit');
INSERT INTO {permissions} VALUES (4,'Add','add');
DROP TABLE IF EXISTS {search_records};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {search_records} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`item_id` int(9) DEFAULT NULL,
@@ -295,21 +295,21 @@ CREATE TABLE {search_records} (
KEY `item_id` (`item_id`),
FULLTEXT KEY `data` (`data`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {search_records} VALUES (1,1,0,' Gallery');
DROP TABLE IF EXISTS {sessions};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {sessions} (
`session_id` varchar(127) NOT NULL,
`data` text NOT NULL,
`last_activity` int(10) unsigned NOT NULL,
PRIMARY KEY (`session_id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {tags};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {tags} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(128) NOT NULL,
@@ -317,10 +317,10 @@ CREATE TABLE {tags} (
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {tasks};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {tasks} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`callback` varchar(128) DEFAULT NULL,
@@ -335,10 +335,10 @@ CREATE TABLE {tasks} (
PRIMARY KEY (`id`),
KEY `owner_id` (`owner_id`)
) DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {themes};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {themes} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
@@ -346,12 +346,12 @@ CREATE TABLE {themes} (
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {themes} VALUES (1,'wind',1);
INSERT INTO {themes} VALUES (2,'admin_wind',1);
DROP TABLE IF EXISTS {users};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {users} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
@@ -369,12 +369,12 @@ CREATE TABLE {users} (
UNIQUE KEY `name` (`name`),
UNIQUE KEY `hash` (`hash`)
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+SET character_set_client = @saved_cs_client;
INSERT INTO {users} VALUES (1,'guest','Guest User','',0,0,NULL,0,1,NULL,NULL,NULL);
INSERT INTO {users} VALUES (2,'admin','Gallery Administrator','',0,0,'unknown@unknown.com',1,0,NULL,NULL,NULL);
DROP TABLE IF EXISTS {vars};
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
+SET @saved_cs_client = @@character_set_client;
+SET character_set_client = utf8;
CREATE TABLE {vars} (
`id` int(9) NOT NULL AUTO_INCREMENT,
`module_name` varchar(64) NOT NULL,
@@ -382,8 +382,8 @@ CREATE TABLE {vars} (
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `module_name` (`module_name`,`name`)
-) AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
+) AUTO_INCREMENT=42 DEFAULT CHARSET=utf8;
+SET character_set_client = @saved_cs_client;
INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind');
INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind');
INSERT INTO {vars} VALUES (NULL,'gallery','page_size','9');
@@ -424,3 +424,4 @@ INSERT INTO {vars} VALUES (NULL,'info','show_owner','1');
INSERT INTO {vars} VALUES (NULL,'info','show_name','1');
INSERT INTO {vars} VALUES (NULL,'info','show_captured','1');
INSERT INTO {vars} VALUES (NULL,'slideshow','max_scale','0');
+INSERT INTO {vars} VALUES (NULL,'tag','tag_cloud_size','30');
diff --git a/lib/jquery-ui.js b/lib/jquery-ui.js
index 3398b9e4..74515a5b 100644
--- a/lib/jquery-ui.js
+++ b/lib/jquery-ui.js
@@ -18,7 +18,7 @@ this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widge
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
-this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
+this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!(document.documentMode>=9)&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 33186fb5..55a75a3b 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -24,23 +24,42 @@ class Admin_g2_import_Controller extends Admin_Controller {
g2_import::init();
}
- if (class_exists("GalleryCoreApi")) {
- $g2_stats = g2_import::stats();
- $g2_sizes = g2_import::common_sizes();
- }
-
$view = new Admin_View("admin.html");
$view->page_title = t("Gallery 2 import");
$view->content = new View("admin_g2_import.html");
+
+ if (class_exists("GalleryCoreApi")) {
+ $view->content->g2_stats = $g2_stats = g2_import::g2_stats();
+ $view->content->g3_stats = $g3_stats = g2_import::g3_stats();
+ $view->content->g2_sizes = g2_import::common_sizes();
+ $view->content->g2_version = g2_import::version();
+
+ // Don't count tags because we don't track them in g2_map
+ $view->content->g2_resource_count =
+ $g2_stats["users"] + $g2_stats["groups"] + $g2_stats["albums"] +
+ $g2_stats["photos"] + $g2_stats["movies"] + $g2_stats["comments"];
+ $view->content->g3_resource_count =
+ $g3_stats["user"] + $g3_stats["group"] + $g3_stats["album"] +
+ $g3_stats["item"] + $g3_stats["comment"] + $g3_stats["tag"];
+ }
+
$view->content->form = $this->_get_import_form();
$view->content->version = "";
+ $view->content->thumb_size = module::get_var("gallery", "thumb_size");
+ $view->content->resize_size = module::get_var("gallery", "resize_size");
if (g2_import::is_initialized()) {
- $view->content->g2_stats = $g2_stats;
- $view->content->g2_sizes = $g2_sizes;
- $view->content->thumb_size = module::get_var("gallery", "thumb_size");
- $view->content->resize_size = module::get_var("gallery", "resize_size");
- $view->content->version = g2_import::version();
+ if ((bool)ini_get("eaccelerator.enable") || (bool)ini_get("xcache.cacher")) {
+ message::warning(t("The eAccelerator and XCache PHP performance extensions are known to cause issues. If you're using either of those and are having problems, please disable them while you do your import. Add the following lines: <pre>%lines</pre> to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")));
+ }
+
+ foreach (array("notification", "search", "exif") as $module_id) {
+ if (module::is_active($module_id)) {
+ message::warning(
+ t("<a href=\"%url\">Deactivating</a> the <b>%module_id</b> module during your import will make it faster",
+ array("url" => url::site("admin/modules"), "module_id" => $module_id)));
+ }
+ }
} else if (g2_import::is_configured()) {
$view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
}
@@ -76,14 +95,15 @@ class Admin_g2_import_Controller extends Admin_Controller {
}
private function _get_import_form() {
+ $embed_path = module::get_var("g2_import", "embed_path", "");
$form = new Forge(
"admin/g2_import/save", "", "post", array("id" => "g-admin-configure-g2-import-form"));
$group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import"));
$group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file"))
- ->value(module::get_var("g2_import", "embed_path", ""));
+ ->value($embed_path);
$group->embed_path->error_messages(
"invalid", t("The path you entered is not a Gallery 2 installation."));
- $group->submit("")->value(t("Save"));
+ $group->submit("")->value($embed_path ? t("Change") : t("Continue"));
return $form;
}
} \ No newline at end of file
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 22fb68c6..23fb29e5 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -219,7 +219,7 @@ class g2_import_Core {
* Return a set of statistics about the number of users, groups, albums, photos, movies and
* comments available for import from the Gallery 2 instance.
*/
- static function stats() {
+ static function g2_stats() {
global $gallery;
$root_album_id = g2(GalleryCoreApi::getDefaultAlbumId());
$stats["users"] = g2(GalleryCoreApi::fetchUserCount());
@@ -248,6 +248,25 @@ class g2_import_Core {
}
/**
+ * Return a set of statistics about the number of users, groups, albums, photos, movies and
+ * comments already imported into the Gallery 3 instance.
+ */
+ static function g3_stats() {
+ $g3_stats = array(
+ "album" => 0, "comment" => 0, "item" => 0, "user" => 0, "group" => 0, "tag" => 0);
+ foreach (db::build()
+ ->select("resource_type")
+ ->select(array("C" => 'COUNT("*")'))
+ ->from("g2_maps")
+ ->where("resource_type", "IN", array("album", "comment", "item", "user", "group"))
+ ->group_by("resource_type")
+ ->execute() as $row) {
+ $g3_stats[$row->resource_type] = $row->C;
+ }
+ return $g3_stats;
+ }
+
+ /**
* Import a single group.
*/
static function import_group(&$queue) {
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php
index 6bda8f17..5e908676 100644
--- a/modules/g2_import/helpers/g2_import_task.php
+++ b/modules/g2_import/helpers/g2_import_task.php
@@ -56,7 +56,7 @@ class g2_import_task_Core {
$mode = $task->get("mode");
$queue = $task->get("queue");
if (!isset($mode)) {
- $stats = g2_import::stats();
+ $stats = g2_import::g2_stats();
$stats["items"] = $stats["photos"] + $stats["movies"];
unset($stats["photos"]);
unset($stats["movies"]);
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index cb13363a..20b243d5 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -5,20 +5,43 @@
<?= t("Import your Gallery 2 users, photos, movies, comments and tags into your new Gallery 3 installation.") ?>
</p>
- <div class="g-block-content">
- <?= $form ?>
- </div>
-
- <div class="g-block-content">
- <? if (g2_import::is_initialized()): ?>
- <div id="g-admin-g2-import-details">
- <h2> <?= t("Import") ?> </h2>
- <ul id="g-action-status" class="g-message-block">
- <li class="g-success">
- <?= t("Gallery version %version detected", array("version" => $version)) ?>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#g-admin-g2-import-tabs").tabs()
+ <? if (!isset($g2_version)): ?>
+ .tabs("disable", 1)
+ .tabs("disable", 2)
+ <? elseif ($g3_resource_count > .9 * $g2_resource_count): ?>
+ .tabs("select", 2)
+ <? else: ?>
+ .tabs("select", 1)
+ <? endif ?>
+ ;
+ });
+ </script>
+ <div id="g-admin-g2-import-tabs" class="g-block-content">
+ <ul>
+ <li>
+ <a href="#g-admin-g2-import-configure"><?= t("1. Configure Gallery2 path") ?></a>
+ </li>
+ <li>
+ <a href="#g-admin-g2-import-import"><?= t("2. Import!") ?></a>
+ </li>
+ <li>
+ <a href="#g-admin-g2-import-notes"><?= t("3. After your import") ?></a>
+ </li>
+ </ul>
+ <div id="g-admin-g2-import-configure" class="g-block-content">
+ <?= $form ?>
+ </div>
+ <div id="g-admin-g2-import-import">
+ <? if (isset($g2_version)): ?>
+ <ul class="enumeration">
+ <li>
+ <?= t("Gallery version %version detected", array("version" => $g2_version)) ?>
</li>
<? if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]): ?>
- <li class="g-warning">
+ <li>
<?= t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
array("g2_pixels" => $g2_sizes["thumb"]["size"],
"g3_pixels" => $thumb_size,
@@ -27,73 +50,84 @@
<? endif ?>
<? if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]): ?>
- <li class="g-warning">
+ <li>
<?= t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 intermediate size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.",
- array("g2_pixels" => $g2_sizes["resize"]["size"],
- "g3_pixels" => $resize_size,
- "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
+ array("g2_pixels" => $g2_sizes["resize"]["size"],
+ "g3_pixels" => $resize_size,
+ "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
</li>
<? endif ?>
- <li class="g-info">
- <?= t("Your Gallery 2 has the following importable data in it:") ?>
- <p>
- <?= t2("1 user", "%count users", $g2_stats["users"]) ?>,
- <?= t2("1 group", "%count groups", $g2_stats["groups"]) ?>,
- <?= t2("1 album", "%count albums", $g2_stats["albums"]) ?>,
- <?= t2("1 photo", "%count photos", $g2_stats["photos"]) ?>,
- <?= t2("1 movie", "%count movies", $g2_stats["movies"]) ?>,
- <?= t2("1 comment", "%count comments", $g2_stats["comments"]) ?>,
- <?= t2("1 tagged photo/movie/album",
- "%count tagged photos/movies/albums", $g2_stats["tags"]) ?>
- </p>
+ <li>
+ <?
+ $t = array();
+ $t[] = t2("1 user", "%count users", $g2_stats["users"]);
+ $t[] = t2("1 group", "%count groups", $g2_stats["groups"]);
+ $t[] = t2("1 album", "%count albums", $g2_stats["albums"]);
+ $t[] = t2("1 photo", "%count photos/movies", $g2_stats["photos"] + $g2_stats["movies"]);
+ $t[] = t2("1 comment", "%count comments", $g2_stats["comments"]);
+ $t[] = t2("1 tagged photo/movie/album", "%count tagged photos/movies/albums",
+ $g2_stats["tags"]);
+ ?>
+ <?= t("Your Gallery 2 has the following importable data in it: %t0, %t1, %t2, %t3, %t4, %t5",
+ array("t0" => $t[0], "t1" => $t[1], "t2" => $t[2],
+ "t3" => $t[3], "t4" => $t[4], "t5" => $t[5])) ?>
</li>
- </ul>
+ <? if ($g3_resource_count): ?>
+ <li>
+ <?
+ $t = array();
+ $t[] = t2("1 user", "%count users", $g3_stats["user"]);
+ $t[] = t2("1 group", "%count groups", $g3_stats["group"]);
+ $t[] = t2("1 album", "%count albums", $g3_stats["album"]);
+ $t[] = t2("1 photo/movie", "%count photos/movies", $g3_stats["item"]);
+ $t[] = t2("1 comment", "%count comments", $g3_stats["comment"]);
+ $t[] = t2("1 tagged photo/movie/album", "%count tagged photos/movies/albums", $g3_stats["tag"]);
+ ?>
+ <?= t("It looks like you've imported the following Gallery 2 data already: %t0, %t1, %t2, %t3, %t4, %t5",
+ array("t0" => $t[0], "t1" => $t[1], "t2" => $t[2],
+ "t3" => $t[3], "t4" => $t[4], "t5" => $t[5])) ?>
+ </li>
+ <? endif ?>
+ </ul>
<p>
<a class="g-button g-dialog-link ui-state-default ui-corner-all"
href="<?= url::site("admin/maintenance/start/g2_import_task::import?csrf=$csrf") ?>">
<?= t("Begin import!") ?>
</a>
</p>
+ <? endif ?>
</div>
+ <div id="g-admin-g2-import-notes">
+ <ul class="enumeration">
+ <li>
+ <?= t("Gallery 3 does not support per-user / per-item permissions. <b>Review permissions!</b>") ?>
+ </li>
+ <li>
+ <?= t("The only supported file formats are JPG, PNG and GIF, FLV and MP4. Other formats will be skipped.") ?>
+ </li>
+ <li>
+ <p>
+ <?= t("Redirecting Gallery 2 URLs once your migration is complete. Put this block at the top of your gallery2/.htaccess file and all Gallery 2 urls will be redirected to Gallery 3") ?>
+ </p>
- <div class="g-block-content">
- <div id="g-admin-g2-import-notes">
- <h2> <?= t("Notes") ?> </h2>
- <ul class="enumeration">
- <li>
- <?= t("Gallery 3 does not support per-user / per-item permissions. <b>Review permissions after your import is done.</b>") ?>
- </li>
- <li>
- <?= t("The only supported file formats are JPG, PNG and GIF, FLV and MP4. Other formats will be skipped.") ?>
- </li>
- <li>
- <?= t("Deactivating the <b>notification</b>, <b>search</b> and <b>exif</b> modules during your import will make it go faster.") ?>
- </li>
- <li>
- <?= t("The eAccelerator and XCache PHP performance extensions are known to cause issues. If you're using either of those and are having problems, please disable them while you do your import. Add the following lines: <pre>%lines</pre> to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")) ?>
- </li>
- </ul>
- </div>
- </div>
-
- <div class="g-block-content">
- <div>
- <h2> <?= t("Migrating from Gallery 2") ?> </h2>
- <p>
- <?= t("Once your migration is complete, put this block at the top of your gallery2/.htaccess file and all Gallery 2 urls will be redirected to Gallery 3") ?>
- </p>
-
- <textarea rows="4" cols="60">&lt;IfModule mod_rewrite.c&gt;
- Options +FollowSymLinks
- RewriteEngine On
- RewriteBase <?= html::clean(g2_import::$g2_base_url) ?>
+ <textarea id="g-g2-redirect-rules" rows="4" cols="60">&lt;IfModule mod_rewrite.c&gt;
+ Options +FollowSymLinks
+ RewriteEngine On
+ RewriteBase <?= html::clean(g2_import::$g2_base_url) ?>
- RewriteRule ^(.*)$ <?= url::site("g2/map?path=\$1") ?> [QSA,L,R=301]
-&lt;/IfModule&gt;</textarea>
- </div>
- <? endif ?>
+ RewriteRule ^(.*)$ <?= url::site("g2/map?path=\$1") ?> [QSA,L,R=301]
+ &lt;/IfModule&gt;</textarea>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#g-g2-redirect-rules").click(function(event) {
+ this.select();
+ });
+ });
+ </script>
+ </li>
+ </ul>
</div>
</div>
</div>
diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php
index cb46da90..a968a56d 100644
--- a/modules/gallery/controllers/admin_theme_options.php
+++ b/modules/gallery/controllers/admin_theme_options.php
@@ -78,8 +78,10 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
$group = $form->group("edit_theme")->label(t("Theme layout"));
$group->input("page_size")->label(t("Items per page"))->id("g-page-size")
->rules("required|valid_digit")
+ ->callback(array($this, "_valididate_page_size"))
->error_messages("required", t("You must enter a number"))
->error_messages("valid_digit", t("You must enter a number"))
+ ->error_messages("valid_min_value", t("The value must be greater than zero"))
->value(module::get_var("gallery", "page_size"));
$group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("g-thumb-size")
->rules("required|valid_digit")
@@ -110,5 +112,12 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
$group->submit("")->value(t("Save"));
return $form;
}
+
+ function _valididate_page_size($input) {
+ if ($input->value < 1) {
+ $input->add_error("valid_min_value", true);
+ }
+
+ }
}
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index fe6d747b..bf41c4df 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -22,7 +22,8 @@ class Tags_Controller extends Controller {
// Far from perfection, but at least require view permission for the root album
$album = ORM::factory("item", 1);
access::required("view", $album);
- print tag::cloud(30);
+
+ print tag::cloud(module::get_var("tag", "tag_cloud_size", 30));
}
public function create($item_id) {
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 8df58a6e..69a9a1c4 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -30,7 +30,7 @@ class tag_block_Core {
$block->css_id = "g-tag";
$block->title = t("Popular tags");
$block->content = new View("tag_block.html");
- $block->content->cloud = tag::cloud(30);
+ $block->content->cloud = tag::cloud(module::get_var("tag", "tag_cloud_size", 30));
if ($theme->item() && $theme->page_subtype() != "tag" && access::can("edit", $theme->item())) {
$controller = new Tags_Controller();
diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php
index 16ad1239..66a78b91 100644
--- a/modules/tag/helpers/tag_installer.php
+++ b/modules/tag/helpers/tag_installer.php
@@ -36,7 +36,8 @@ class tag_installer {
KEY(`tag_id`, `id`),
KEY(`item_id`, `id`))
DEFAULT CHARSET=utf8;");
- module::set_version("tag", 2);
+ module::set_var("tag", "tag_cloud_size", 30);
+ module::set_version("tag", 3);
}
static function upgrade($version) {
@@ -45,6 +46,10 @@ class tag_installer {
$db->query("ALTER TABLE {tags} MODIFY COLUMN `name` VARCHAR(128)");
module::set_version("tag", $version = 2);
}
+ if ($version == 2) {
+ module::set_var("tag", "tag_cloud_size", 30);
+ module::set_version("tag", $version = 3);
+ }
}
static function uninstall() {
diff --git a/modules/tag/module.info b/modules/tag/module.info
index 8851d119..d9d34386 100644
--- a/modules/tag/module.info
+++ b/modules/tag/module.info
@@ -1,3 +1,3 @@
name = "Tags"
description = "Allows users to tag photos and albums"
-version = 2
+version = 3