diff options
Diffstat (limited to 'modules/g2_import')
-rw-r--r-- | modules/g2_import/controllers/admin_g2_import.php | 6 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index b1018560..b9427f79 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -33,7 +33,7 @@ class Admin_g2_import_Controller extends Admin_Controller { $view->page_title = t("Gallery 2 import"); $view->content = new View("admin_g2_import.html"); $view->content->form = $this->_get_import_form(); - $view->content->version = ''; + $view->content->version = ""; if (g2_import::is_initialized()) { $view->content->g2_stats = $g2_stats; @@ -41,6 +41,8 @@ class Admin_g2_import_Controller extends Admin_Controller { $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(); + } else if (g2_import::is_configured()) { + $view->content->form->configure_g2_import->embed_path->add_error("invalid", 1); } g2_import::restore_error_reporting(); print $view; @@ -58,7 +60,7 @@ class Admin_g2_import_Controller extends Admin_Controller { } if (g2_import::is_valid_embed_path($embed_path)) { - message::success("Gallery 2 path saved."); + message::success(t("Gallery 2 path saved")); module::set_var("g2_import", "embed_path", $embed_path); url::redirect("admin/g2_import"); } else { diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 575d02bb..c0ea09d6 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -438,8 +438,15 @@ class g2_import_Core { // Only consider G2's first sort order $g2_order = explode("|", $g2_album->getOrderBy() . ""); $g2_order = $g2_order[0]; + 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]; @@ -502,7 +509,7 @@ class g2_import_Core { } try { $g3_album->save(); - graphics::generate($g2_album); + graphics::generate($g3_album); } catch (Exception $e) { return (string) new G2_Import_Exception( t("Failed to generate an album highlight for album '%name'.", @@ -826,6 +833,7 @@ class g2_import_Core { $text .= " "; } $text .= $g2_comment->getComment(); + $text = html_entity_decode($text); // Just import the fields we know about. Do this outside of the comment API for now so that // we don't trigger spam filtering events @@ -835,6 +843,7 @@ class g2_import_Core { if ($comment->author_id == identity::guest()->id) { $comment->guest_name = $g2_comment->getAuthor(); $comment->guest_name or $comment->guest_name = (string) t("Anonymous coward"); + $comment->guest_email = "unknown@nobody.com"; } $comment->item_id = $item_id; $comment->text = self::_transform_bbcode($text); |