summaryrefslogtreecommitdiff
path: root/modules/g2_import/controllers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-04-22 16:30:37 -0700
committerBharat Mediratta <bharat@menalto.com>2011-04-22 16:30:37 -0700
commit5040adebb5c4e1e491fbb6c3b98783f5809020a3 (patch)
treedc63f868c841a2bf4ed58e20d483eb9981217ba6 /modules/g2_import/controllers
parent526859d9605d137ebe053ecbd80f46ca6a331194 (diff)
Totally revamp the G2 Import UI to make it sexxxy. Fixes #1683.
Diffstat (limited to 'modules/g2_import/controllers')
-rw-r--r--modules/g2_import/controllers/admin_g2_import.php44
1 files changed, 32 insertions, 12 deletions
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