Horde_Form::isSubmitted PHP Метод

isSubmitted() публичный Метод

Other events can explicitly set the _submitted variable to false to indicate a form submit but not for actual posting of data (eg. onChange events to update the display of fields).
public isSubmitted ( ) : boolean
Результат boolean True or false indicating if the form has been submitted.
    function isSubmitted()
    {
        if (is_null($this->_submitted)) {
            if ($this->_vars->get('formname') == $this->getName()) {
                $this->_submitted = true;
            } else {
                $this->_submitted = false;
            }
        }
        return $this->_submitted;
    }

Usage Example

Пример #1
0
            } else {
                $notification->push(_("Your data were successfully updated."), 'horde.success');
                if (empty($data['user_picture'])) {
                    $folks_driver->logActivity(_("Updated his/her profile details."));
                } else {
                    $folks_driver->logActivity(_("Updated his/her profile picture."));
                }
                Horde::url('edit/edit.php')->redirect();
            }
            break;
        case _("Delete picture"):
            $result = $folks_driver->deleteImage($GLOBALS['registry']->getAuth());
            if ($result instanceof PEAR_Error) {
                $notification->push($result);
            } else {
                $notification->push(_("Your image was deleted successfully."), 'horde.success');
            }
            break;
    }
} elseif (!$form->isSubmitted()) {
    foreach ($profile as $key => $value) {
        if ($key != 'user_picture' && !empty($value)) {
            $vars->set($key, $value);
        }
    }
}
$page_output->header(array('title' => $title));
require FOLKS_TEMPLATES . '/menu.inc';
echo $tabs->render('edit');
$form->renderActive(null, null, null, 'post');
$page_output->footer();
All Usage Examples Of Horde_Form::isSubmitted