From e3e56827d5724c6ec5174d4186db99ab2c55e8f7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 10 Jul 2009 12:33:37 +0800 Subject: Corrected a problem where the number limit value was being set the same for both popular and recent changes. Signed-off-by: Tim Almdal --- modules/dynamic/controllers/admin_dynamic.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/dynamic/controllers/admin_dynamic.php') 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); -- cgit v1.2.3