1
0

Cleaning up the code.

This commit is contained in:
rWatcher 2010-11-07 01:48:21 -04:00
parent 03d09e67de
commit bebc67ea77
6 changed files with 22 additions and 20 deletions

View File

@ -39,9 +39,9 @@ class Admin_Albumpassword_Controller extends Admin_Controller {
// Should protected items be hidden, or completely in-accessable? // Should protected items be hidden, or completely in-accessable?
$albumpassword_group = $form->group("album_password_group"); $albumpassword_group = $form->group("album_password_group");
$albumpassword_group->checkbox("hideonly") $albumpassword_group->checkbox("hideonly")
->label("Only hide protected albums?") ->label("Only hide protected albums?")
->checked(module::get_var("albumpassword", "hideonly")); ->checked(module::get_var("albumpassword", "hideonly"));
// Add a save button to the form. // Add a save button to the form.
$albumpassword_group->submit("save_settings")->value(t("Save")); $albumpassword_group->submit("save_settings")->value(t("Save"));
@ -56,12 +56,12 @@ class Admin_Albumpassword_Controller extends Admin_Controller {
// Prevent Cross Site Request Forgery // Prevent Cross Site Request Forgery
access::verify_csrf(); access::verify_csrf();
// Retrieve submitted form data. // Retrieve submitted form data.
if (Input::instance()->post("hideonly") == false) { if (Input::instance()->post("hideonly") == false) {
module::set_var("albumpassword", "hideonly", false); module::set_var("albumpassword", "hideonly", false);
} else { } else {
module::set_var("albumpassword", "hideonly", true); module::set_var("albumpassword", "hideonly", true);
} }
// Display a success message and redirect back to the TagsMap admin page. // Display a success message and redirect back to the TagsMap admin page.
message::success(t("Your settings have been saved.")); message::success(t("Your settings have been saved."));
url::redirect("admin/albumpassword"); url::redirect("admin/albumpassword");

View File

@ -28,6 +28,7 @@ class access extends access_Core {
} else { } else {
self::forbidden(); self::forbidden();
} }
// Begin rWatcher modifications. // Begin rWatcher modifications.
// This section adds an additional condition onto the view permission that throws a 404 // This section adds an additional condition onto the view permission that throws a 404
// error if the album has a password assigned. // error if the album has a password assigned.

View File

@ -39,9 +39,9 @@ class Admin_Albumpassword_Controller extends Admin_Controller {
// Should protected items be hidden, or completely in-accessable? // Should protected items be hidden, or completely in-accessable?
$albumpassword_group = $form->group("album_password_group"); $albumpassword_group = $form->group("album_password_group");
$albumpassword_group->checkbox("hideonly") $albumpassword_group->checkbox("hideonly")
->label("Only hide protected albums?") ->label("Only hide protected albums?")
->checked(module::get_var("albumpassword", "hideonly")); ->checked(module::get_var("albumpassword", "hideonly"));
// Add a save button to the form. // Add a save button to the form.
$albumpassword_group->submit("save_settings")->value(t("Save")); $albumpassword_group->submit("save_settings")->value(t("Save"));
@ -56,12 +56,12 @@ class Admin_Albumpassword_Controller extends Admin_Controller {
// Prevent Cross Site Request Forgery // Prevent Cross Site Request Forgery
access::verify_csrf(); access::verify_csrf();
// Retrieve submitted form data. // Retrieve submitted form data.
if (Input::instance()->post("hideonly") == false) { if (Input::instance()->post("hideonly") == false) {
module::set_var("albumpassword", "hideonly", false); module::set_var("albumpassword", "hideonly", false);
} else { } else {
module::set_var("albumpassword", "hideonly", true); module::set_var("albumpassword", "hideonly", true);
} }
// Display a success message and redirect back to the TagsMap admin page. // Display a success message and redirect back to the TagsMap admin page.
message::success(t("Your settings have been saved.")); message::success(t("Your settings have been saved."));
url::redirect("admin/albumpassword"); url::redirect("admin/albumpassword");

View File

@ -28,6 +28,7 @@ class access extends access_Core {
} else { } else {
self::forbidden(); self::forbidden();
} }
// Begin rWatcher modifications. // Begin rWatcher modifications.
// This section adds an additional condition onto the view permission that throws a 404 // This section adds an additional condition onto the view permission that throws a 404
// error if the album has a password assigned. // error if the album has a password assigned.