[dev] [patch] conf.php backup
Coleman
mercury at appisolutions.net
Thu Aug 12 09:03:44 PDT 2004
Quoting Jan Schneider <jan at horde.org>:
> Zitat von Andrew Coleman <mercury at appisolutions.net>:
>
>> Well, i was going to do the cool thing and post a patch to
>> bugs.horde.org but it appears to be under some maintenance. Here is a
>> proposed patch for generating and reverting configuration settings.
>
> Looks good, but I'd like to see one change. It doesn't make sense to check
> twice if the revert button has been clicked. If it has been clicked, it
> doesn't matter if the form validates or not, this would also save you from
> declaring the revert code in a function.
> This should be the logic:
>
> if (revert) {
> revert;
> } else {
> if ($form->validate()) {
> make_config;
> } elseif ($form->isSubmitted()) {
> show_error;
> }
> }
>
You're right... Trying to make it work under too many conditions :P Try this
one, it should be a lot cleaner.
Coleman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: confphp-backup.patch
Type: text/x-patch
Size: 3561 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20040812/c1557301/confphp-backup.bin
More information about the dev
mailing list