summaryrefslogtreecommitdiff
path: root/modules/dynamic/controllers/admin_dynamic.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-10 12:33:37 +0800
committerTim Almdal <tnalmdal@shaw.ca>2009-07-10 12:39:24 +0800
commite3e56827d5724c6ec5174d4186db99ab2c55e8f7 (patch)
treedee81249d426c216896b880ebf565e682837cb6c /modules/dynamic/controllers/admin_dynamic.php
parent4b28f7f50e0901ee3abe864a3881ff11d08a73ce (diff)
Corrected a problem where the number limit value was being set the
same for both popular and recent changes. Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/dynamic/controllers/admin_dynamic.php')
-rw-r--r--modules/dynamic/controllers/admin_dynamic.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/dynamic/controllers/admin_dynamic.php b/modules/dynamic/controllers/admin_dynamic.php
index f559e3d2..50dac459 100644
--- a/modules/dynamic/controllers/admin_dynamic.php
+++ b/modules/dynamic/controllers/admin_dynamic.php
@@ -28,9 +28,11 @@ class Admin_Dynamic_Controller extends Admin_Controller {
if ($form->validate()) {
foreach (array("updates", "popular") as $album) {
$album_defn = unserialize(module::get_var("dynamic", $album));
- $album_defn->enabled = $form->$album->enabled->value;
- $album_defn->description = $form->$album->description->value;
- $album_defn->limit = $form->$album->limit->value === "" ? null : $form->$album->limit->value;
+ $group = $form->inputs[$album];
+ $album_defn->enabled = $group->inputs["{$album}_enabled"]->value;
+ $album_defn->description = $group->inputs["{$album}_description"]->value;
+ $album_defn->limit = $group->inputs["{$album}_limit"] === "" ? null :
+ $group->inputs["{$album}_limit"]->value;
module::set_var("dynamic", $album, serialize($album_defn));
}
@@ -58,15 +60,15 @@ class Admin_Dynamic_Controller extends Admin_Controller {
$album_defn = unserialize(module::get_var("dynamic", $album));
$group = $form->group($album)->label(t($album_defn->title));
- $group->checkbox("enabled")
+ $group->checkbox("{$album}_enabled")
->label(t("Enable"))
->value(1)
->checked($album_defn->enabled);
- $group->input("limit")
+ $group->input("{$album}_limit")
->label(t("Limit (leave empty for unlimited)"))
- ->value(empty($updates->limit) ? "" : $updates->limit)
+ ->value(empty($album_defn->limit) ? "" : $album_defn->limit)
->rules("valid_numeric");
- $group->textarea("description")
+ $group->textarea("{$album}_description")
->label(t("Description"))
->rules("length[0,2048]")
->value($album_defn->description);