From 5040adebb5c4e1e491fbb6c3b98783f5809020a3 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Fri, 22 Apr 2011 16:30:37 -0700
Subject: Totally revamp the G2 Import UI to make it sexxxy. Fixes #1683.
---
modules/g2_import/controllers/admin_g2_import.php | 44 ++++--
modules/g2_import/helpers/g2_import.php | 21 ++-
modules/g2_import/helpers/g2_import_task.php | 2 +-
modules/g2_import/views/admin_g2_import.html.php | 162 +++++++++++++---------
4 files changed, 151 insertions(+), 78 deletions(-)
(limited to 'modules/g2_import')
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: %lines
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("Deactivating the %module_id 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());
@@ -247,6 +247,25 @@ class g2_import_Core {
return $stats;
}
+ /**
+ * 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.
*/
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.") ?>
-
- = $form ?>
-
-
-
- if (g2_import::is_initialized()): ?>
-
-
= t("Import") ?>
-
- -
- = t("Gallery version %version detected", array("version" => $version)) ?>
+
+
+
+
+ = $form ?>
+
+
+ if (isset($g2_version)): ?>
+
+ -
+ = t("Gallery version %version detected", array("version" => $g2_version)) ?>
if ($g2_sizes["thumb"]["size"] && $thumb_size != $g2_sizes["thumb"]["size"]): ?>
- -
+
-
= 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. Using the same value 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"]): ?>
-
-
+
-
= 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. Using the same value 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")))) ?>
endif ?>
- -
- = t("Your Gallery 2 has the following importable data in it:") ?>
-
- = 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"]) ?>
-
+ -
+
+ $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])) ?>
-
+ if ($g3_resource_count): ?>
+
-
+
+ $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])) ?>
+
+ endif ?>
+
">
= t("Begin import!") ?>
+ endif ?>
+
--
cgit v1.2.3
From 07c266b973cd65d44bb769c19d86b1245ed2c9e5 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sat, 23 Apr 2011 07:20:58 -0700
Subject: Enable autocomplete for the embed path. Fixes #1687.
---
modules/g2_import/controllers/admin_g2_import.php | 12 ++++++++++++
modules/g2_import/views/admin_g2_import.html.php | 13 +++++++++++++
2 files changed, 25 insertions(+)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 55a75a3b..cf68d911 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -94,6 +94,18 @@ class Admin_g2_import_Controller extends Admin_Controller {
print $view;
}
+ public function autocomplete() {
+ $directories = array();
+ $path_prefix = Input::instance()->get("q");
+ foreach (glob("{$path_prefix}*") as $file) {
+ if (is_dir($file) && !is_link($file)) {
+ $directories[] = $file;
+ }
+ }
+
+ print implode("\n", $directories);
+ }
+
private function _get_import_form() {
$embed_path = module::get_var("g2_import", "embed_path", "");
$form = new Forge(
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 20b243d5..1094524f 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -1,4 +1,17 @@
+= $theme->css("jquery.autocomplete.css") ?>
+= $theme->script("jquery.autocomplete.js") ?>
+
+
= t("Gallery 2 import") ?>
--
cgit v1.2.3
From bb23e28035293174f935345178f32638c09d0421 Mon Sep 17 00:00:00 2001
From: Chad Kieffer
Date: Sat, 23 Apr 2011 10:28:39 -0400
Subject: Remove enumeration unordered list class, it's no longer needed.
---
modules/g2_import/views/admin_g2_import.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 20b243d5..fb2b58c9 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -36,7 +36,7 @@
if (isset($g2_version)): ?>
-
+
-
= t("Gallery version %version detected", array("version" => $g2_version)) ?>
--
cgit v1.2.3
From ba20d5a500fbc724376a2fc749ee2c645041a6e1 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sat, 23 Apr 2011 14:46:07 -0700
Subject: Oops, this is the rest of the modules and themes for #1696 and #1698.
---
modules/akismet/module.info | 4 ++++
modules/comment/module.info | 4 ++++
modules/digibug/module.info | 4 ++++
modules/exif/module.info | 4 ++++
modules/g2_import/module.info | 4 ++++
modules/image_block/module.info | 4 ++++
modules/info/module.info | 4 ++++
modules/notification/module.info | 4 ++++
modules/organize/module.info | 4 ++++
modules/recaptcha/module.info | 4 ++++
modules/rest/module.info | 4 ++++
modules/rss/module.info | 4 ++++
modules/search/module.info | 4 ++++
modules/server_add/module.info | 4 ++++
modules/slideshow/module.info | 4 ++++
modules/tag/module.info | 4 ++++
modules/user/module.info | 4 ++++
modules/watermark/module.info | 4 ++++
themes/admin_wind/theme.info | 4 ++++
themes/wind/theme.info | 4 ++++
20 files changed, 80 insertions(+)
(limited to 'modules/g2_import')
diff --git a/modules/akismet/module.info b/modules/akismet/module.info
index b61ed107..afc649d3 100644
--- a/modules/akismet/module.info
+++ b/modules/akismet/module.info
@@ -1,3 +1,7 @@
name = "Akismet"
description = "Filter comments through the Akismet web service to detect and eliminate spam (http://akismet.com). You'll need a WordPress.com API key to use it."
version = 1
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:akismet"
+discuss_url = "http://gallery.menalto.com/forum_module_akismet"
diff --git a/modules/comment/module.info b/modules/comment/module.info
index e5aa454d..63c6af1c 100644
--- a/modules/comment/module.info
+++ b/modules/comment/module.info
@@ -1,3 +1,7 @@
name = "Comments"
description = "Allows users and guests to leave comments on photos and albums."
version = 4
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:comment"
+discuss_url = "http://gallery.menalto.com/forum_module_comment"
diff --git a/modules/digibug/module.info b/modules/digibug/module.info
index be4e880a..ce437611 100644
--- a/modules/digibug/module.info
+++ b/modules/digibug/module.info
@@ -1,3 +1,7 @@
name = "Digibug"
description = "Digibug Photo Printing Module"
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:digibug"
+discuss_url = "http://gallery.menalto.com/forum_module_digibug"
diff --git a/modules/exif/module.info b/modules/exif/module.info
index c8ae688e..c2ffbfa7 100644
--- a/modules/exif/module.info
+++ b/modules/exif/module.info
@@ -1,3 +1,7 @@
name = "Exif Data"
description = "Extract Exif data and display it on photo pages."
version = 1
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:exif"
+discuss_url = "http://gallery.menalto.com/forum_module_exif"
diff --git a/modules/g2_import/module.info b/modules/g2_import/module.info
index 977af251..0e766255 100644
--- a/modules/g2_import/module.info
+++ b/modules/g2_import/module.info
@@ -1,3 +1,7 @@
name = "Gallery2 Import"
description = "Import your Gallery 2 content into Gallery 3"
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:g2_import"
+discuss_url = "http://gallery.menalto.com/forum_module_g2_import"
diff --git a/modules/image_block/module.info b/modules/image_block/module.info
index 6836fabc..aa3c5461 100644
--- a/modules/image_block/module.info
+++ b/modules/image_block/module.info
@@ -1,3 +1,7 @@
name = "Image Block"
description = "Display a random image in the sidebar"
version = 3
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:image_block"
+discuss_url = "http://gallery.menalto.com/forum_module_image_block"
diff --git a/modules/info/module.info b/modules/info/module.info
index 5f84cbb9..e8f30594 100644
--- a/modules/info/module.info
+++ b/modules/info/module.info
@@ -1,3 +1,7 @@
name = "Info"
description = "Display extra information about photos and albums"
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:info"
+discuss_url = "http://gallery.menalto.com/forum_module_info"
diff --git a/modules/notification/module.info b/modules/notification/module.info
index 8c5e1162..dacc00f9 100644
--- a/modules/notification/module.info
+++ b/modules/notification/module.info
@@ -1,3 +1,7 @@
name = "Notification"
description = "Send notifications to users when changes are made to watched albums."
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:notification"
+discuss_url = "http://gallery.menalto.com/forum_module_notification"
diff --git a/modules/organize/module.info b/modules/organize/module.info
index 0d16144d..31d24379 100644
--- a/modules/organize/module.info
+++ b/modules/organize/module.info
@@ -1,3 +1,7 @@
name = "Organize"
description = "Visually rearrange and move photos in your gallery"
version = 4
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:organize"
+discuss_url = "http://gallery.menalto.com/forum_module_organize"
diff --git a/modules/recaptcha/module.info b/modules/recaptcha/module.info
index cfa1bf7a..2a0b419b 100644
--- a/modules/recaptcha/module.info
+++ b/modules/recaptcha/module.info
@@ -1,3 +1,7 @@
name = "reCAPTCHA"
description = "reCAPTCHA displays a graphical verification that protects the input form from abuse from 'bots,' or automated programs usually written to generate spam (http://recaptcha.net)."
version = 1
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:recaptcha"
+discuss_url = "http://gallery.menalto.com/forum_module_recaptcha"
diff --git a/modules/rest/module.info b/modules/rest/module.info
index 5aaffc28..c71c64f9 100644
--- a/modules/rest/module.info
+++ b/modules/rest/module.info
@@ -2,3 +2,7 @@ name = "REST API Module"
description = "A REST-based API that allows desktop clients and other apps to interact with Gallery 3"
version = 3
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:rest"
+discuss_url = "http://gallery.menalto.com/forum_module_rest"
diff --git a/modules/rss/module.info b/modules/rss/module.info
index 48375da1..5ebae9e7 100644
--- a/modules/rss/module.info
+++ b/modules/rss/module.info
@@ -1,3 +1,7 @@
name = "RSS"
description = "Provides RSS feeds"
version = 1
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:rss"
+discuss_url = "http://gallery.menalto.com/forum_module_rss"
diff --git a/modules/search/module.info b/modules/search/module.info
index f417c4fa..a1c58af5 100644
--- a/modules/search/module.info
+++ b/modules/search/module.info
@@ -1,3 +1,7 @@
name = "Search"
description = "Allows users to search their Gallery"
version = 1
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:search"
+discuss_url = "http://gallery.menalto.com/forum_module_search"
diff --git a/modules/server_add/module.info b/modules/server_add/module.info
index 87b317b1..754e06c1 100644
--- a/modules/server_add/module.info
+++ b/modules/server_add/module.info
@@ -1,3 +1,7 @@
name = "Server Add"
description = "Allows authorized users to load images directly from your web server"
version = 4
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:server_add"
+discuss_url = "http://gallery.menalto.com/forum_module_server_add"
diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info
index b56eac81..55cdf9b8 100644
--- a/modules/slideshow/module.info
+++ b/modules/slideshow/module.info
@@ -1,3 +1,7 @@
name = "Slideshow"
description = "Allows users to view a slideshow of photos"
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:slideshow"
+discuss_url = "http://gallery.menalto.com/forum_module_slideshow"
diff --git a/modules/tag/module.info b/modules/tag/module.info
index d9d34386..59d8dfbd 100644
--- a/modules/tag/module.info
+++ b/modules/tag/module.info
@@ -1,3 +1,7 @@
name = "Tags"
description = "Allows users to tag photos and albums"
version = 3
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:tag"
+discuss_url = "http://gallery.menalto.com/forum_module_tag"
diff --git a/modules/user/module.info b/modules/user/module.info
index b7594815..f6dd9529 100644
--- a/modules/user/module.info
+++ b/modules/user/module.info
@@ -2,3 +2,7 @@ name = "Users and Groups"
description = "Gallery 3 user and group management"
version = 4
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:user"
+discuss_url = "http://gallery.menalto.com/forum_module_user"
diff --git a/modules/watermark/module.info b/modules/watermark/module.info
index 41a871bd..1f440016 100644
--- a/modules/watermark/module.info
+++ b/modules/watermark/module.info
@@ -1,3 +1,7 @@
name = "Watermarks"
description = "Allows users to watermark their photos"
version = 2
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Module:watermark"
+discuss_url = "http://gallery.menalto.com/forum_module_watermark"
diff --git a/themes/admin_wind/theme.info b/themes/admin_wind/theme.info
index 4034b64a..aca5c6c5 100644
--- a/themes/admin_wind/theme.info
+++ b/themes/admin_wind/theme.info
@@ -4,3 +4,7 @@ version = 1
author = "Gallery Team"
admin = 1
site = 0
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Theme:admin_wind"
+discuss_url = "http://gallery.menalto.com/forum_theme_admin_wind"
diff --git a/themes/wind/theme.info b/themes/wind/theme.info
index 17ea7c20..c2344c48 100644
--- a/themes/wind/theme.info
+++ b/themes/wind/theme.info
@@ -4,3 +4,7 @@ version = 1
author = "Gallery Team"
site = 1
admin = 0
+author_name = "Gallery Team"
+author_url = "http://codex.gallery2.org/Gallery:Team"
+info_url = "http://codex.gallery2.org/Gallery3:Theme:wind"
+discuss_url = "http://gallery.menalto.com/forum_theme_wind"
--
cgit v1.2.3
From c07af35a19905f3241fb77662e8b7c84e41e9a62 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sat, 23 Apr 2011 14:53:34 -0700
Subject: Oops, fix broken codex urls. For #1698.
---
modules/akismet/module.info | 2 +-
modules/comment/module.info | 2 +-
modules/digibug/module.info | 2 +-
modules/exif/module.info | 2 +-
modules/g2_import/module.info | 2 +-
modules/gallery/module.info | 2 +-
modules/image_block/module.info | 2 +-
modules/info/module.info | 2 +-
modules/notification/module.info | 2 +-
modules/organize/module.info | 2 +-
modules/recaptcha/module.info | 2 +-
modules/rest/module.info | 2 +-
modules/rss/module.info | 2 +-
modules/search/module.info | 2 +-
modules/server_add/module.info | 2 +-
modules/slideshow/module.info | 2 +-
modules/tag/module.info | 2 +-
modules/user/module.info | 2 +-
modules/watermark/module.info | 2 +-
themes/admin_wind/theme.info | 2 +-
themes/wind/theme.info | 2 +-
21 files changed, 21 insertions(+), 21 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/akismet/module.info b/modules/akismet/module.info
index afc649d3..63473468 100644
--- a/modules/akismet/module.info
+++ b/modules/akismet/module.info
@@ -3,5 +3,5 @@ description = "Filter comments through the Akismet web service to detect and eli
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:akismet"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:akismet"
discuss_url = "http://gallery.menalto.com/forum_module_akismet"
diff --git a/modules/comment/module.info b/modules/comment/module.info
index 63c6af1c..4e7df6f1 100644
--- a/modules/comment/module.info
+++ b/modules/comment/module.info
@@ -3,5 +3,5 @@ description = "Allows users and guests to leave comments on photos and albums."
version = 4
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:comment"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:comment"
discuss_url = "http://gallery.menalto.com/forum_module_comment"
diff --git a/modules/digibug/module.info b/modules/digibug/module.info
index ce437611..781d5f01 100644
--- a/modules/digibug/module.info
+++ b/modules/digibug/module.info
@@ -3,5 +3,5 @@ description = "Digibug Photo Printing Module"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:digibug"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:digibug"
discuss_url = "http://gallery.menalto.com/forum_module_digibug"
diff --git a/modules/exif/module.info b/modules/exif/module.info
index c2ffbfa7..e266e20e 100644
--- a/modules/exif/module.info
+++ b/modules/exif/module.info
@@ -3,5 +3,5 @@ description = "Extract Exif data and display it on photo pages."
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:exif"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:exif"
discuss_url = "http://gallery.menalto.com/forum_module_exif"
diff --git a/modules/g2_import/module.info b/modules/g2_import/module.info
index 0e766255..30fb46d4 100644
--- a/modules/g2_import/module.info
+++ b/modules/g2_import/module.info
@@ -3,5 +3,5 @@ description = "Import your Gallery 2 content into Gallery 3"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:g2_import"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:g2_import"
discuss_url = "http://gallery.menalto.com/forum_module_g2_import"
diff --git a/modules/gallery/module.info b/modules/gallery/module.info
index fc522d78..42345531 100644
--- a/modules/gallery/module.info
+++ b/modules/gallery/module.info
@@ -3,5 +3,5 @@ description = "Gallery core application"
version = 49
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:gallery"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:gallery"
discuss_url = "http://gallery.menalto.com/forum_module_gallery"
diff --git a/modules/image_block/module.info b/modules/image_block/module.info
index aa3c5461..6722cc8f 100644
--- a/modules/image_block/module.info
+++ b/modules/image_block/module.info
@@ -3,5 +3,5 @@ description = "Display a random image in the sidebar"
version = 3
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:image_block"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:image_block"
discuss_url = "http://gallery.menalto.com/forum_module_image_block"
diff --git a/modules/info/module.info b/modules/info/module.info
index e8f30594..f8964a78 100644
--- a/modules/info/module.info
+++ b/modules/info/module.info
@@ -3,5 +3,5 @@ description = "Display extra information about photos and albums"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:info"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:info"
discuss_url = "http://gallery.menalto.com/forum_module_info"
diff --git a/modules/notification/module.info b/modules/notification/module.info
index dacc00f9..84be8f99 100644
--- a/modules/notification/module.info
+++ b/modules/notification/module.info
@@ -3,5 +3,5 @@ description = "Send notifications to users when changes are made to watched albu
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:notification"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:notification"
discuss_url = "http://gallery.menalto.com/forum_module_notification"
diff --git a/modules/organize/module.info b/modules/organize/module.info
index 31d24379..07b9dc38 100644
--- a/modules/organize/module.info
+++ b/modules/organize/module.info
@@ -3,5 +3,5 @@ description = "Visually rearrange and move photos in your gallery"
version = 4
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:organize"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:organize"
discuss_url = "http://gallery.menalto.com/forum_module_organize"
diff --git a/modules/recaptcha/module.info b/modules/recaptcha/module.info
index 2a0b419b..ebaff7de 100644
--- a/modules/recaptcha/module.info
+++ b/modules/recaptcha/module.info
@@ -3,5 +3,5 @@ description = "reCAPTCHA displays a graphical verification that protects the inp
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:recaptcha"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:recaptcha"
discuss_url = "http://gallery.menalto.com/forum_module_recaptcha"
diff --git a/modules/rest/module.info b/modules/rest/module.info
index c71c64f9..33c9f1cf 100644
--- a/modules/rest/module.info
+++ b/modules/rest/module.info
@@ -4,5 +4,5 @@ description = "A REST-based API that allows desktop clients and other apps to in
version = 3
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:rest"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:rest"
discuss_url = "http://gallery.menalto.com/forum_module_rest"
diff --git a/modules/rss/module.info b/modules/rss/module.info
index 5ebae9e7..cd13c1b0 100644
--- a/modules/rss/module.info
+++ b/modules/rss/module.info
@@ -3,5 +3,5 @@ description = "Provides RSS feeds"
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:rss"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:rss"
discuss_url = "http://gallery.menalto.com/forum_module_rss"
diff --git a/modules/search/module.info b/modules/search/module.info
index a1c58af5..1389798d 100644
--- a/modules/search/module.info
+++ b/modules/search/module.info
@@ -3,5 +3,5 @@ description = "Allows users to search their Gallery"
version = 1
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:search"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:search"
discuss_url = "http://gallery.menalto.com/forum_module_search"
diff --git a/modules/server_add/module.info b/modules/server_add/module.info
index 754e06c1..4ce0a97d 100644
--- a/modules/server_add/module.info
+++ b/modules/server_add/module.info
@@ -3,5 +3,5 @@ description = "Allows authorized users to load images directly from your web ser
version = 4
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:server_add"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:server_add"
discuss_url = "http://gallery.menalto.com/forum_module_server_add"
diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info
index 55cdf9b8..8c9a3176 100644
--- a/modules/slideshow/module.info
+++ b/modules/slideshow/module.info
@@ -3,5 +3,5 @@ description = "Allows users to view a slideshow of photos"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:slideshow"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:slideshow"
discuss_url = "http://gallery.menalto.com/forum_module_slideshow"
diff --git a/modules/tag/module.info b/modules/tag/module.info
index 59d8dfbd..75d16bf0 100644
--- a/modules/tag/module.info
+++ b/modules/tag/module.info
@@ -3,5 +3,5 @@ description = "Allows users to tag photos and albums"
version = 3
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:tag"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:tag"
discuss_url = "http://gallery.menalto.com/forum_module_tag"
diff --git a/modules/user/module.info b/modules/user/module.info
index f6dd9529..503bcd0d 100644
--- a/modules/user/module.info
+++ b/modules/user/module.info
@@ -4,5 +4,5 @@ version = 4
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:user"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:user"
discuss_url = "http://gallery.menalto.com/forum_module_user"
diff --git a/modules/watermark/module.info b/modules/watermark/module.info
index 1f440016..58efa43f 100644
--- a/modules/watermark/module.info
+++ b/modules/watermark/module.info
@@ -3,5 +3,5 @@ description = "Allows users to watermark their photos"
version = 2
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Module:watermark"
+info_url = "http://codex.gallery2.org/Gallery3:Modules:watermark"
discuss_url = "http://gallery.menalto.com/forum_module_watermark"
diff --git a/themes/admin_wind/theme.info b/themes/admin_wind/theme.info
index aca5c6c5..466d8e43 100644
--- a/themes/admin_wind/theme.info
+++ b/themes/admin_wind/theme.info
@@ -6,5 +6,5 @@ admin = 1
site = 0
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Theme:admin_wind"
+info_url = "http://codex.gallery2.org/Gallery3:Themes:admin_wind"
discuss_url = "http://gallery.menalto.com/forum_theme_admin_wind"
diff --git a/themes/wind/theme.info b/themes/wind/theme.info
index c2344c48..e0be78b9 100644
--- a/themes/wind/theme.info
+++ b/themes/wind/theme.info
@@ -6,5 +6,5 @@ site = 1
admin = 0
author_name = "Gallery Team"
author_url = "http://codex.gallery2.org/Gallery:Team"
-info_url = "http://codex.gallery2.org/Gallery3:Theme:wind"
+info_url = "http://codex.gallery2.org/Gallery3:Themes:wind"
discuss_url = "http://gallery.menalto.com/forum_theme_wind"
--
cgit v1.2.3
From b89c40242f85ecb49393e4fe6aeb3659550f60a4 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 07:49:41 -0700
Subject: Sentence-case the url. Fixes #1706.
---
modules/g2_import/helpers/g2_import_event.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import_event.php b/modules/g2_import/helpers/g2_import_event.php
index 0e078d08..0afa62d8 100644
--- a/modules/g2_import/helpers/g2_import_event.php
+++ b/modules/g2_import/helpers/g2_import_event.php
@@ -34,7 +34,7 @@ class g2_import_event_Core {
->get("settings_menu")
->append(Menu::factory("link")
->id("g2_import")
- ->label(t("Gallery 2 Import"))
+ ->label(t("Gallery 2 import"))
->url(url::site("admin/g2_import")));
}
}
--
cgit v1.2.3
From b4cdd016dc97f2df608bb14d2088cb4ddbd32c35 Mon Sep 17 00:00:00 2001
From: Chad Kieffer
Date: Sun, 24 Apr 2011 11:53:29 -0400
Subject: Third times the charm. Rethink unordered lists and bullets. Revert to
turning them off by default and provide a new class, g-text, to define a list
or a section of text as needing to display bullets.
---
modules/g2_import/views/admin_g2_import.html.php | 4 ++--
modules/gallery/views/admin_block_welcome.html.php | 2 +-
themes/admin_wind/css/screen.css | 17 ++---------------
3 files changed, 5 insertions(+), 18 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index cf5e4755..2f4a1b28 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -112,8 +112,8 @@ $("document").ready(function() {
endif ?>
-
-
+
+
-
= t("Gallery 3 does not support per-user / per-item permissions. Review permissions!") ?>
diff --git a/modules/gallery/views/admin_block_welcome.html.php b/modules/gallery/views/admin_block_welcome.html.php
index d8c96187..d3765d19 100644
--- a/modules/gallery/views/admin_block_welcome.html.php
+++ b/modules/gallery/views/admin_block_welcome.html.php
@@ -2,7 +2,7 @@
= t("This is your administration dashboard and it provides a quick overview of status messages, recent updates, and frequently used options. Add or remove blocks and rearrange them to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options and settings. Here are a few of the most used options to get you started.") ?>
-
+
-
= t("General Settings - choose your graphics and language settings.",
array("graphics_url" => html::mark_clean(url::site("admin/graphics")),
diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css
index f01c2a94..6f1c0962 100644
--- a/themes/admin_wind/css/screen.css
+++ b/themes/admin_wind/css/screen.css
@@ -92,25 +92,12 @@ a:hover,
/* Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-#g-content ul li {
+ul.g-text li,
+.g-text ul li {
list-style-type: disc;
margin-left: 1em;
}
-form ul li,
-#g-action-status li,
-#g-log-entries li,
-#g-tag-admin li,
-.g-buttonset li,
-.g-buttonset-vertical li,
-.g-paginator li,
-.ui-sortable li,
-.ui-widget-header li {
- list-style: none !important;
- margin-left: 0 !important;
-}
-
-
/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
form {
--
cgit v1.2.3
From ea2127c3b2ddef5709e02b4804c074bd1f942159 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 21:02:34 -0700
Subject: Fix a bug introduced in f2477703faa7cd05ff1aa16da3ecef7b666bef40
which was a fix for #1581 that caused us to skip adding highlights for any
albums that had no sub-albums.
---
modules/g2_import/helpers/g2_import.php | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 23fb29e5..e9c19c9d 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -518,12 +518,11 @@ class g2_import_Core {
static function set_album_highlight(&$queue) {
// Dequeue the current album and enqueue its children
list($g2_album_id, $children) = each($queue);
- if (empty($children)) {
- return;
- }
unset($queue[$g2_album_id]);
- foreach ($children as $key => $value) {
- $queue[$key] = $value;
+ if (!empty($children)) {
+ foreach ($children as $key => $value) {
+ $queue[$key] = $value;
+ }
}
$messages = array();
--
cgit v1.2.3
From 701c1fb12f2f254d8d7e7756a09cb5e825123a2f Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 22:45:45 -0700
Subject: Ignore the presort when transferring over sort orders. Fixes #1710.
---
modules/g2_import/helpers/g2_import.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index e9c19c9d..50ab8a23 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -475,9 +475,10 @@ class g2_import_Core {
1 => "ASC",
ORDER_ASCENDING => "ASC",
ORDER_DESCENDING => "DESC");
- // Only consider G2's first sort order
+ // G2 sorts can either be or |. Right now we can't
+ // map presorts so ignore them.
$g2_order = explode("|", $g2_album->getOrderBy() . "");
- $g2_order = $g2_order[0];
+ $g2_order = end($g2_order);
if (empty($g2_order)) {
$g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
}
--
cgit v1.2.3
From 953be781dc91254599224fa6e95fcc435e787975 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 22:51:14 -0700
Subject: Refactor the meat of g2_import::import_album() off into a separate
function so taht we can call it on the root album as well. Fixes
---
modules/g2_import/helpers/g2_import.php | 96 +++++++++++++++-------------
modules/g2_import/helpers/g2_import_task.php | 6 ++
2 files changed, 58 insertions(+), 44 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 50ab8a23..22a054ac 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -448,50 +448,8 @@ class g2_import_Core {
$album = ORM::factory("item");
$album->type = "album";
$album->parent_id = self::map($g2_album->getParentId());
- $album->name = $g2_album->getPathComponent();
- $album->title = self::_decode_html_special_chars($g2_album->getTitle());
- $album->title or $album->title = $album->name;
- $album->description = self::_decode_html_special_chars(self::extract_description($g2_album));
- $album->owner_id = self::map($g2_album->getOwnerId());
- try {
- $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
- } catch (Exception $e) {
- // @todo log
- $album->view_count = 0;
- }
- $album->created = $g2_album->getCreationTimestamp();
-
- $order_map = array(
- "originationTimestamp" => "captured",
- "creationTimestamp" => "created",
- "description" => "description",
- "modificationTimestamp" => "updated",
- "orderWeight" => "weight",
- "pathComponent" => "name",
- "summary" => "description",
- "title" => "title",
- "viewCount" => "view_count");
- $direction_map = array(
- 1 => "ASC",
- ORDER_ASCENDING => "ASC",
- ORDER_DESCENDING => "DESC");
- // G2 sorts can either be or |. Right now we can't
- // map presorts so ignore them.
- $g2_order = explode("|", $g2_album->getOrderBy() . "");
- $g2_order = end($g2_order);
- if (empty($g2_order)) {
- $g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
- }
- $g2_order_direction = explode("|", $g2_album->getOrderDirection() . "");
- $g2_order_direction = $g2_order_direction[0];
- if (empty($g2_order_direction)) {
- $g2_order_direction =
- g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderDirection'));
- }
- if (array_key_exists($g2_order, $order_map)) {
- $album->sort_column = $order_map[$g2_order];
- $album->sort_order = $direction_map[$g2_order_direction];
- }
+
+ g2_import::set_album_values($album, $g2_album);
try {
$album->save();
@@ -513,6 +471,56 @@ class g2_import_Core {
self::_import_permissions($g2_album, $album);
}
+ /**
+ * Transfer over all the values from a G2 album to a G3 album.
+ */
+ static function set_album_values($album, $g2_album) {
+ $album->name = $g2_album->getPathComponent();
+ $album->title = self::_decode_html_special_chars($g2_album->getTitle());
+ $album->title or $album->title = $album->name;
+ $album->description = self::_decode_html_special_chars(self::extract_description($g2_album));
+ $album->owner_id = self::map($g2_album->getOwnerId());
+ try {
+ $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ } catch (Exception $e) {
+ // @todo log
+ $album->view_count = 0;
+ }
+ $album->created = $g2_album->getCreationTimestamp();
+
+ $order_map = array(
+ "originationTimestamp" => "captured",
+ "creationTimestamp" => "created",
+ "description" => "description",
+ "modificationTimestamp" => "updated",
+ "orderWeight" => "weight",
+ "pathComponent" => "name",
+ "summary" => "description",
+ "title" => "title",
+ "viewCount" => "view_count");
+ $direction_map = array(
+ 1 => "ASC",
+ ORDER_ASCENDING => "ASC",
+ ORDER_DESCENDING => "DESC");
+ // G2 sorts can either be or |. Right now we can't
+ // map presorts so ignore them.
+ $g2_order = explode("|", $g2_album->getOrderBy() . "");
+ $g2_order = end($g2_order);
+ if (empty($g2_order)) {
+ $g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
+ }
+ $g2_order_direction = explode("|", $g2_album->getOrderDirection() . "");
+ $g2_order_direction = $g2_order_direction[0];
+ if (empty($g2_order_direction)) {
+ $g2_order_direction =
+ g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderDirection'));
+ }
+ if (array_key_exists($g2_order, $order_map)) {
+ $album->sort_column = $order_map[$g2_order];
+ $album->sort_order = $direction_map[$g2_order_direction];
+ }
+ }
+
/**
* Set the highlight properly for a single album
*/
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php
index 5e908676..31615a55 100644
--- a/modules/g2_import/helpers/g2_import_task.php
+++ b/modules/g2_import/helpers/g2_import_task.php
@@ -127,6 +127,12 @@ class g2_import_task_Core {
$g2_root_id = g2(GalleryCoreApi::getDefaultAlbumId());
$tree = g2(GalleryCoreApi::fetchAlbumTree());
$task->set("queue", $queue = array($g2_root_id => $tree));
+
+ // Update the root album to reflect the Gallery2 root album.
+ $root_album = item::root();
+ g2_import::set_album_values(
+ $root_album, g2(GalleryCoreApi::loadEntitiesById($g2_root_id)));
+ $root_album->save();
}
$log_message = g2_import::import_album($queue);
if ($log_message) {
--
cgit v1.2.3
From 8533420f5d307e81a90c3d26a75b666350aee0f2 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 22:55:01 -0700
Subject: Look for and return embed.php files in the autocomplete list if we
can find them. Fixes #1708.
---
modules/g2_import/controllers/admin_g2_import.php | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index cf68d911..5c4995c9 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -100,6 +100,11 @@ class Admin_g2_import_Controller extends Admin_Controller {
foreach (glob("{$path_prefix}*") as $file) {
if (is_dir($file) && !is_link($file)) {
$directories[] = $file;
+
+ // If we find an embed.php, include it as well
+ if (file_exists("$file/embed.php")) {
+ $directories[] = "$file/embed.php";
+ }
}
}
--
cgit v1.2.3
From 4e7524664a24dd2ca2309c9d67843a19e74b48e0 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 24 Apr 2011 23:04:50 -0700
Subject: Show the tabs after the page has loaded to prevent Firefox from
rendering the unstyled page and then flashing. Fixes #1705.
---
modules/g2_import/views/admin_g2_import.html.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 2f4a1b28..9c4eb840 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -30,9 +30,13 @@ $("document").ready(function() {
.tabs("select", 1)
endif ?>
;
+
+ // Show the tabs after the page has loaded to prevent Firefox from rendering the
+ // unstyled page and then flashing.
+ $("#g-admin-g2-import-tabs").show();
});
-
+
-
= t("1. Configure Gallery2 path") ?>
--
cgit v1.2.3
From 9e080efff3cf9c706dfb2c69dacc19328196ec01 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sat, 30 Apr 2011 15:43:57 -0700
Subject: Differentiate between invalid, missing and broken G2 configs and
present the user with feedback in the form. Fixes #1727.
---
modules/g2_import/controllers/admin_g2_import.php | 8 +-
modules/g2_import/helpers/g2_import.php | 265 ++++++++++++----------
2 files changed, 147 insertions(+), 126 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 5c4995c9..1a705bea 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -78,12 +78,12 @@ class Admin_g2_import_Controller extends Admin_Controller {
$embed_path = "$embed_path/embed.php";
}
- if (g2_import::is_valid_embed_path($embed_path)) {
+ if (($g2_init_error = g2_import::is_valid_embed_path($embed_path)) == "ok") {
message::success(t("Gallery 2 path saved"));
module::set_var("g2_import", "embed_path", $embed_path);
url::redirect("admin/g2_import");
} else {
- $form->configure_g2_import->embed_path->add_error("invalid", 1);
+ $form->configure_g2_import->embed_path->add_error($g2_init_error, 1);
}
}
@@ -120,6 +120,10 @@ class Admin_g2_import_Controller extends Admin_Controller {
->value($embed_path);
$group->embed_path->error_messages(
"invalid", t("The path you entered is not a Gallery 2 installation."));
+ $group->embed_path->error_messages(
+ "broken", t("Your Gallery 2 install isn't working properly. Please verify it!"));
+ $group->embed_path->error_messages(
+ "missing", t("The path you entered does not exist."));
$group->submit("")->value($embed_path ? t("Change") : t("Continue"));
return $form;
}
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 22a054ac..3606c7ef 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -31,7 +31,7 @@ class g2_import_Core {
}
static function is_initialized() {
- return g2_import::$init;
+ return g2_import::$init == "ok";
}
static function init() {
@@ -52,146 +52,163 @@ class g2_import_Core {
if (file_exists($mod_path)) {
dir::unlink($mod_path);
}
- return file_exists($embed_path) && g2_import::init_embed($embed_path);
+ return g2_import::init_embed($embed_path);
}
/**
* Initialize the embedded Gallery 2 instance. Call this before any other Gallery 2 calls.
+ *
+ * Return values:
+ * "ok" - the Gallery 2 install is fine
+ * "missing" - the embed path does not exist
+ * "invalid" - the install path is not a valid Gallery 2 code base
+ * "broken" - the embed path is correct, but the Gallery 2 install is broken
*/
static function init_embed($embed_path) {
if (!is_file($embed_path)) {
- return false;
+ return "missing";
}
- // Gallery 2 defines a class called Gallery. So does Gallery 3. They don't get along. So do
- // a total hack here and copy over a few critical files (embed.php, main.php, bootstrap.inc
- // and Gallery.class) and munge them so that we can rename the Gallery class to be
- // G2_Gallery. Is this retarded? Why yes it is.
- //
- // Store the munged files in a directory that's the md5 hash of the embed path so that
- // multiple import sources don't interfere with each other.
-
- $mod_path = VARPATH . "modules/g2_import/" . md5($embed_path);
- if (!file_exists($mod_path) || !file_exists("$mod_path/embed.php")) {
- @dir::unlink($mod_path);
- mkdir($mod_path);
-
- $config_dir = dirname($embed_path);
- if (filesize($embed_path) > 200) {
- // Regular install
- $base_dir = $config_dir;
- } else {
- // Multisite install. Line 2 of embed.php will be something like:
- // require('/usr/home/bharat/public_html/gallery2/embed.php');
- $lines = file($embed_path);
- preg_match("#require\('(.*)/embed.php'\);#", $lines[2], $matches);
- $base_dir = $matches[1];
+ try {
+ // Gallery 2 defines a class called Gallery. So does Gallery 3. They don't get along. So do
+ // a total hack here and copy over a few critical files (embed.php, main.php, bootstrap.inc
+ // and Gallery.class) and munge them so that we can rename the Gallery class to be
+ // G2_Gallery. Is this retarded? Why yes it is.
+ //
+ // Store the munged files in a directory that's the md5 hash of the embed path so that
+ // multiple import sources don't interfere with each other.
+
+ $mod_path = VARPATH . "modules/g2_import/" . md5($embed_path);
+ if (!file_exists($mod_path) || !file_exists("$mod_path/embed.php")) {
+ @dir::unlink($mod_path);
+ mkdir($mod_path);
+
+ $config_dir = dirname($embed_path);
+ if (filesize($embed_path) > 200) {
+ // Regular install
+ $base_dir = $config_dir;
+ } else {
+ // Multisite install. Line 2 of embed.php will be something like:
+ // require('/usr/home/bharat/public_html/gallery2/embed.php');
+ $lines = file($embed_path);
+ preg_match("#require\('(.*)/embed.php'\);#", $lines[2], $matches);
+ $base_dir = $matches[1];
+ }
+
+ file_put_contents(
+ "$mod_path/embed.php",
+ str_replace(
+ array(
+ "require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');",
+ "require(dirname(__FILE__) . '/modules/core/classes/GalleryEmbed.class');"),
+ array(
+ "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');",
+ "require('$base_dir/modules/core/classes/GalleryEmbed.class');"),
+ array_merge(
+ array("\n"),
+ file("$base_dir/embed.php"))));
+
+ file_put_contents(
+ "$mod_path/main.php",
+ str_replace(
+ array(
+ "include(dirname(__FILE__) . '/bootstrap.inc');",
+ "require_once(dirname(__FILE__) . '/init.inc');"),
+ array(
+ "include(dirname(__FILE__) . '/bootstrap.inc');",
+ "require_once('$base_dir/init.inc');"),
+ array_merge(
+ array("\n"),
+ file("$base_dir/main.php"))));
+
+ file_put_contents(
+ "$mod_path/bootstrap.inc",
+ str_replace(
+ array(
+ "require_once(dirname(__FILE__) . '/modules/core/classes/Gallery.class');",
+ "require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');",
+ "define('GALLERY_CONFIG_DIR', dirname(__FILE__));",
+ "\$gallery =& new Gallery();",
+ "\$GLOBALS['gallery'] =& new Gallery();",
+ "\$gallery = new Gallery();"),
+ array(
+ "require_once(dirname(__FILE__) . '/Gallery.class');",
+ "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');",
+ "define('GALLERY_CONFIG_DIR', '$config_dir');",
+ "\$gallery =& new G2_Gallery();",
+ "\$GLOBALS['gallery'] =& new G2_Gallery();",
+ "\$gallery = new G2_Gallery();"),
+ array_merge(
+ array("\n"),
+ file("$base_dir/bootstrap.inc"))));
+
+ file_put_contents(
+ "$mod_path/Gallery.class",
+ str_replace(
+ array("class Gallery",
+ "function Gallery"),
+ array("class G2_Gallery",
+ "function G2_Gallery"),
+ array_merge(
+ array("\n"),
+ file("$base_dir/modules/core/classes/Gallery.class"))));
+ } else {
+ // Ok, this is a good one. If you're running a bytecode accelerator and you move your
+ // Gallery install, these files sometimes get cached with the wrong path and then fail to
+ // load properly.
+ // Documented in https://sourceforge.net/apps/trac/gallery/ticket/1253
+ touch("$mod_path/embed.php");
+ touch("$mod_path/main.php");
+ touch("$mod_path/bootstrap.inc");
+ touch("$mod_path/Gallery.class.inc");
+ }
+
+ require("$mod_path/embed.php");
+ if (!class_exists("GalleryEmbed")) {
+ return "invalid";
}
- file_put_contents(
- "$mod_path/embed.php",
- str_replace(
- array(
- "require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');",
- "require(dirname(__FILE__) . '/modules/core/classes/GalleryEmbed.class');"),
- array(
- "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');",
- "require('$base_dir/modules/core/classes/GalleryEmbed.class');"),
- array_merge(array("\n"),
- file("$base_dir/embed.php"))));
-
- file_put_contents(
- "$mod_path/main.php",
- str_replace(
- array(
- "include(dirname(__FILE__) . '/bootstrap.inc');",
- "require_once(dirname(__FILE__) . '/init.inc');"),
- array(
- "include(dirname(__FILE__) . '/bootstrap.inc');",
- "require_once('$base_dir/init.inc');"),
- array_merge(array("\n"),
- file("$base_dir/main.php"))));
-
- file_put_contents(
- "$mod_path/bootstrap.inc",
- str_replace(
- array("require_once(dirname(__FILE__) . '/modules/core/classes/Gallery.class');",
- "require_once(dirname(__FILE__) . '/modules/core/classes/GalleryDataCache.class');",
- "define('GALLERY_CONFIG_DIR', dirname(__FILE__));",
- "\$gallery =& new Gallery();",
- "\$GLOBALS['gallery'] =& new Gallery();",
- "\$gallery = new Gallery();"),
- array("require_once(dirname(__FILE__) . '/Gallery.class');",
- "require_once('$base_dir/modules/core/classes/GalleryDataCache.class');",
- "define('GALLERY_CONFIG_DIR', '$config_dir');",
- "\$gallery =& new G2_Gallery();",
- "\$GLOBALS['gallery'] =& new G2_Gallery();",
- "\$gallery = new G2_Gallery();"),
- array_merge(array("\n"),
- file("$base_dir/bootstrap.inc"))));
-
- file_put_contents(
- "$mod_path/Gallery.class",
- str_replace(
- array("class Gallery",
- "function Gallery"),
- array("class G2_Gallery",
- "function G2_Gallery"),
- array_merge(array("\n"),
- file("$base_dir/modules/core/classes/Gallery.class"))));
- } else {
- // Ok, this is a good one. If you're running a bytecode accelerator and you move your
- // Gallery install, these files sometimes get cached with the wrong path and then fail to
- // load properly.
- // Documented in https://sourceforge.net/apps/trac/gallery/ticket/1253
- touch("$mod_path/embed.php");
- touch("$mod_path/main.php");
- touch("$mod_path/bootstrap.inc");
- touch("$mod_path/Gallery.class.inc");
- }
-
- require("$mod_path/embed.php");
- if (!class_exists("GalleryEmbed")) {
- return false;
- }
-
- $ret = GalleryEmbed::init();
- if ($ret) {
- Kohana_Log::add("error", "Gallery 2 call failed with: " . $ret->getAsText());
- return false;
- }
-
- $admin_group_id = g2(GalleryCoreApi::getPluginParameter("module", "core", "id.adminGroup"));
- $admins = g2(GalleryCoreApi::fetchUsersForGroup($admin_group_id, 1));
- $admin_id = current(array_flip($admins));
- $admin = g2(GalleryCoreApi::loadEntitiesById($admin_id));
- $GLOBALS["gallery"]->setActiveUser($admin);
+ $ret = GalleryEmbed::init();
+ if ($ret) {
+ Kohana_Log::add("error", "Gallery 2 call failed with: " . $ret->getAsText());
+ return "broken";
+ }
- // Make sure we have an embed location so that embedded url generation comes out ok. Without
- // this, the Gallery2 ModRewrite code won't try to do url generation.
- $g2_embed_location =
- g2(GalleryCoreApi::getPluginParameter("module", "rewrite", "modrewrite.embeddedLocation"));
+ $admin_group_id = g2(GalleryCoreApi::getPluginParameter("module", "core", "id.adminGroup"));
+ $admins = g2(GalleryCoreApi::fetchUsersForGroup($admin_group_id, 1));
+ $admin_id = current(array_flip($admins));
+ $admin = g2(GalleryCoreApi::loadEntitiesById($admin_id));
+ $GLOBALS["gallery"]->setActiveUser($admin);
- if (empty($g2_embed_location)) {
+ // Make sure we have an embed location so that embedded url generation comes out ok. Without
+ // this, the Gallery2 ModRewrite code won't try to do url generation.
$g2_embed_location =
- g2(GalleryCoreApi::getPluginParameter("module", "rewrite", "modrewrite.galleryLocation"));
- g2(GalleryCoreApi::setPluginParameter(
- "module", "rewrite", "modrewrite.embeddedLocation", $g2_embed_location));
- g2($gallery->getStorage()->checkPoint());
- }
+ g2(GalleryCoreApi::getPluginParameter("module", "rewrite", "modrewrite.embeddedLocation"));
+
+ if (empty($g2_embed_location)) {
+ $g2_embed_location =
+ g2(GalleryCoreApi::getPluginParameter("module", "rewrite", "modrewrite.galleryLocation"));
+ g2(GalleryCoreApi::setPluginParameter("module", "rewrite", "modrewrite.embeddedLocation",
+ $g2_embed_location));
+ g2($gallery->getStorage()->checkPoint());
+ }
- if ($g2_embed_location) {
- self::$g2_base_url = $g2_embed_location;
- } else {
- self::$g2_base_url = $GLOBALS["gallery"]->getUrlGenerator()->generateUrl(
- array(),
- array("forceSessionId" => false,
- "htmlEntities" => false,
- "urlEncode" => false,
- "useAuthToken" => false));
+ if ($g2_embed_location) {
+ self::$g2_base_url = $g2_embed_location;
+ } else {
+ self::$g2_base_url = $GLOBALS["gallery"]->getUrlGenerator()->generateUrl(
+ array(),
+ array("forceSessionId" => false,
+ "htmlEntities" => false,
+ "urlEncode" => false,
+ "useAuthToken" => false));
+ }
+ } catch (ErrorException $e) {
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ return "broken";
}
- return true;
+ return "ok";
}
/**
--
cgit v1.2.3
From 68370b92f5f6fa68744655f8c68b4b0ca59bf4fd Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Mon, 2 May 2011 21:36:17 -0700
Subject: Map the G2 album highlight thumbnail derivative id to the G3 album's
thumbnail. Fixes #1729.
---
modules/g2_import/helpers/g2_import.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 3606c7ef..c79a8d36 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -560,7 +560,7 @@ class g2_import_Core {
$table = g2(GalleryCoreApi::fetchThumbnailsByItemIds(array($g2_album_id)));
if (isset($table[$g2_album_id])) {
// Backtrack the source id to an item
- $g2_source = $table[$g2_album_id];
+ $orig_g2_source = $g2_source = $table[$g2_album_id];
while (GalleryUtilities::isA($g2_source, "GalleryDerivative")) {
$g2_source = g2(GalleryCoreApi::loadEntitiesById($g2_source->getDerivativeSourceId()));
}
@@ -584,6 +584,11 @@ class g2_import_Core {
array("name" => $g3_album->name)),
$e);
}
+
+ self::set_map(
+ $orig_g2_source->getId(), $g3_album->id,
+ "thumbnail",
+ self::g2_url(array("view" => "core.DownloadItem", "itemId" => $orig_g2_source->getId())));
}
}
}
--
cgit v1.2.3
From 229bfc5c7c760c53d1357503fd61bf9a165acf6e Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Mon, 2 May 2011 21:37:04 -0700
Subject: Track and redirect core.DownloadItem requests properly. This can
happen if the G2 was imported with rewrite on, so the g2_url in the g2_map
table has a shortened url, but then rewrite is disabled and the .htaccess
mod_rewrite rules are sending over a &g2_view=core.DownloadItem request.
Fixes #1728.
---
modules/g2_import/controllers/g2.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php
index 6e60bed0..90984e84 100644
--- a/modules/g2_import/controllers/g2.php
+++ b/modules/g2_import/controllers/g2.php
@@ -41,7 +41,9 @@ class G2_Controller extends Controller {
// (bbcode, embedding) people are using the id style URLs although URL rewriting is enabled.
$where = array(array("g2_id", "=", $id));
$view = $input->get("g2_view");
- if ($view) {
+ if ($view == "core.DownloadItem") {
+ $where[] = array("resource_type", "IN", array("file", "resize", "thumbnail", "full"));
+ } else if ($view) {
$where[] = array("g2_url", "like", "%g2_view=$view%");
} // else: Assuming that the first search hit is sufficiently good.
} else if ($path) {
--
cgit v1.2.3
From 784ebe75321304fe3f83cddaf3cb1030410fb5ed Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 22 May 2011 21:24:27 -0700
Subject: Leave the "updated" field alone when importing comments so that if
Akismet marks them as spam, we don't immediately flush them out of the
database on the next visit to Admin > Content > Comments.
Also warn the user about Akismet, and fix up the G2 import code to
reimport deleted comments.
---
modules/g2_import/controllers/admin_g2_import.php | 5 +++++
modules/g2_import/helpers/g2_import.php | 26 ++++++++++++++++++-----
2 files changed, 26 insertions(+), 5 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index 1a705bea..4c8af852 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -60,6 +60,11 @@ class Admin_g2_import_Controller extends Admin_Controller {
array("url" => url::site("admin/modules"), "module_id" => $module_id)));
}
}
+ if (module::is_active("akismet")) {
+ message::warning(
+ t("The Akismet module may mark some or all of your imported comments as spam. Deactivate it to avoid that outcome.",
+ array("url" => url::site("admin/modules"))));
+ }
} else if (g2_import::is_configured()) {
$view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
}
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index c79a8d36..5c690da4 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -908,9 +908,14 @@ class g2_import_Core {
array("id" => $g2_comment_id, "exception" => (string)$e));
}
- if (self::map($g2_comment->getId())) {
- // Already imported
- return;
+ if ($id = self::map($g2_comment->getId())) {
+ if (ORM::factory("comment", $id)->loaded()) {
+ // Already imported and still exists
+ return;
+ }
+ // This comment was already imported, but now it no longer exists. Import it again, per
+ // ticket #1736.
+ self::clear_map($g2_comment_id);
}
$item_id = self::map($g2_comment->getParentId());
@@ -948,10 +953,11 @@ class g2_import_Core {
self::set_map($g2_comment->getId(), $comment->id, "comment");
// Backdate the creation date. We can't do this at creation time because
- // Comment_Model::save() will override it.
+ // Comment_Model::save() will override it. Leave the updated date alone
+ // so that if the comments get marked as spam, they don't immediately get
+ // flushed (see ticket #1736)
db::update("comments")
->set("created", $g2_comment->getDate())
- ->set("updated", $g2_comment->getDate())
->where("id", "=", $comment->id)
->execute();
}
@@ -1306,6 +1312,16 @@ class g2_import_Core {
self::$map[$g2_id] = $g3_id;
}
+ /**
+ * Remove all map entries associated with the given Gallery 2 id.
+ */
+ static function clear_map($g2_id) {
+ db::build()
+ ->delete("g2_maps")
+ ->where("g2_id", "=", $g2_id)
+ ->execute();
+ }
+
static function log($msg) {
message::warning($msg);
Kohana_Log::add("alert", $msg);
--
cgit v1.2.3
From f567bdde2817a52afbd436421b61adad8f4a9fd8 Mon Sep 17 00:00:00 2001
From: Bharat Mediratta
Date: Sun, 22 May 2011 21:36:16 -0700
Subject: Clear any existing, matching g2_map rows before mapping new rows.
This is an extra query, but should keep duplicate rows out of the database
and let new rows supercede old ones. Fixes #1737.
---
modules/g2_import/helpers/g2_import.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 5c690da4..8a5d2c5f 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -915,7 +915,6 @@ class g2_import_Core {
}
// This comment was already imported, but now it no longer exists. Import it again, per
// ticket #1736.
- self::clear_map($g2_comment_id);
}
$item_id = self::map($g2_comment->getParentId());
@@ -1298,6 +1297,7 @@ class g2_import_Core {
* Associate a Gallery 2 id with a Gallery 3 item id.
*/
static function set_map($g2_id, $g3_id, $resource_type, $g2_url=null) {
+ self::clear_map($g2_id, $resource_type);
$g2_map = ORM::factory("g2_map");
$g2_map->g3_id = $g3_id;
$g2_map->g2_id = $g2_id;
@@ -1315,10 +1315,11 @@ class g2_import_Core {
/**
* Remove all map entries associated with the given Gallery 2 id.
*/
- static function clear_map($g2_id) {
+ static function clear_map($g2_id, $resource_type) {
db::build()
->delete("g2_maps")
->where("g2_id", "=", $g2_id)
+ ->where("resource_type", "=", $resource_type)
->execute();
}
--
cgit v1.2.3
From 784c429070db54e183feb3e0ea6f2726b6507081 Mon Sep 17 00:00:00 2001
From: Andy Lindeman
Date: Mon, 27 Jun 2011 07:24:37 -0400
Subject: [Fixes #1757] Redirect to root album if path comes in as main.php or
index.php
---
modules/g2_import/controllers/g2.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'modules/g2_import')
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php
index 90984e84..1252014f 100644
--- a/modules/g2_import/controllers/g2.php
+++ b/modules/g2_import/controllers/g2.php
@@ -34,7 +34,7 @@ class G2_Controller extends Controller {
$path = $input->get("path");
$id = $input->get("g2_itemId");
- if ($path || $id) {
+ if (($path && $path != 'index.php' && $path != 'main.php') || $id) {
if ($id) {
// Requests by id are either core.DownloadItem or core.ShowItem requests. Later versions of
// Gallery 2 don't specify g2_view if it's the default (core.ShowItem). And in some cases
--
cgit v1.2.3