baseline
[omp.pkp.sfu.ca.git] / lib / pkp / classes / form / validation / FormValidatorPost.inc.php
blob85ac8cb86da24e29ecc8b16acf30aea9ec71a271
1 <?php
3 /**
4 * @file classes/form/validation/FormValidatorPost.inc.php
6 * Copyright (c) 2000-2009 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 * @class FormValidatorPost
10 * @ingroup form_validation
12 * @brief Form validation check to make sure the form is POSTed.
15 // $Id: FormValidatorPost.inc.php,v 1.3 2009/04/08 21:34:54 asmecher Exp $
18 import ('form.validation.FormValidator');
20 class FormValidatorPost extends FormValidator {
21 /**
22 * Constructor.
23 * @see FormValidator::FormValidator()
24 * @param message string the locale key to use (optional)
26 function FormValidatorPost(&$form, $message = 'form.postRequired') {
27 parent::FormValidator($form, 'dummy', 'required', $message);
30 /**
31 * Check if field value is valid.
32 * Value is valid if it is empty and optional or matches regular expression.
33 * @return boolean
35 function isValid() {
36 return Request::isPost();