mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-03 18:29:09 -04:00
Differentiate between invalid, missing and broken G2 configs and
present the user with feedback in the form. Fixes #1727.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user