diff options
author | Chad Parry <github@chad.parry.org> | 2011-04-24 08:28:39 -0600 |
---|---|---|
committer | Chad Parry <github@chad.parry.org> | 2011-04-24 08:28:39 -0600 |
commit | 26585fed03236f0f70a75959e1d3002025f4e15e (patch) | |
tree | 33a89567f40dbbdb8affcbe76baa27b242bc6d75 /modules/gallery/controllers/admin_theme_options.php | |
parent | 809567f12850f59bdeb47a2963f6968b99b5a201 (diff) | |
parent | c8f90e861b866d0caa86343a6c7213e923023d39 (diff) |
Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto
Diffstat (limited to 'modules/gallery/controllers/admin_theme_options.php')
-rw-r--r-- | modules/gallery/controllers/admin_theme_options.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php index cb46da90..a968a56d 100644 --- a/modules/gallery/controllers/admin_theme_options.php +++ b/modules/gallery/controllers/admin_theme_options.php @@ -78,8 +78,10 @@ class Admin_Theme_Options_Controller extends Admin_Controller { $group = $form->group("edit_theme")->label(t("Theme layout")); $group->input("page_size")->label(t("Items per page"))->id("g-page-size") ->rules("required|valid_digit") + ->callback(array($this, "_valididate_page_size")) ->error_messages("required", t("You must enter a number")) ->error_messages("valid_digit", t("You must enter a number")) + ->error_messages("valid_min_value", t("The value must be greater than zero")) ->value(module::get_var("gallery", "page_size")); $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("g-thumb-size") ->rules("required|valid_digit") @@ -110,5 +112,12 @@ class Admin_Theme_Options_Controller extends Admin_Controller { $group->submit("")->value(t("Save")); return $form; } + + function _valididate_page_size($input) { + if ($input->value < 1) { + $input->add_error("valid_min_value", true); + } + + } } |