Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
Form Class Reference
Inheritance diagram for Form:
AbntSettingsForm ArticleGalleyForm AuthorDepositForm AuthorSubmitForm AuthorSubmitSuppFileForm AuthSourceSettingsForm BookForReviewForm BooksForReviewSettingsForm CategoryForm ChangePasswordForm CitationForm CommentForm CommentForm ContextForm CreateReviewerForm CustomBlockEditForm CustomThemeSettingsForm DepositPointForm DOIExportSettingsForm DOISettingsForm DuraCloudLoginForm EditCommentForm EmailTemplateForm ExternalFeedForm ExternalFeedSettingsForm FilterForm GiftIndividualSubscriptionForm GoogleAnalyticsSettingsForm GroupForm InstallForm IssueForm IssueGalleyForm JournalSetupForm JournalSiteSettingsForm LanguageSettingsForm LoginChangePasswordForm LuceneSettingsForm MetadataForm NotificationMailingListForm OpenAdsSettingsForm PaymentSettingsForm PayMethodSettingsForm PhpMyVisitesSettingsForm PiwikSettingsForm PKPNotificationSettingsForm ProfileForm QuickSubmitForm ReferralForm ReferralPluginSettingsForm RegistrationForm ReportGeneratorForm ReviewFormElementForm ReviewFormForm ReviewFormResponseForm SearchForm SectionForm SettingsForm SettingsForm SettingsForm SettingsForm SettingsForm SettingsForm StaticPagesSettingsForm StopForumSpamSettingsForm StudentThesisForm SubscriptionForm SubscriptionPolicyForm SubscriptionTypeForm SuppFileForm ThesisForm ThesisSettingsForm UpgradeForm URNSettingsForm UsageStatsSettingsForm UserIndividualSubscriptionForm UserInstitutionalSubscriptionForm UserManagementForm VersionForm XMLGalleySettingsForm

Public Member Functions

 _decomposeArray ($name, $value, $stack)
 
 addCheck ($formValidator)
 
 addError ($field, $message)
 
 addErrorField ($field)
 
 display ($request=null, $template=null)
 
 execute ($object=null)
 
 fetch (&$request, $template=null, $display=false)
 
 Form ($template=null, $callHooks=true, $requiredLocale=null, $supportedLocales=null)
 
 getData ($key)
 
 getDefaultFormLocale ()
 
 getErrorsArray ()
 
 getFormLocale ()
 
 getLocaleFieldNames ()
 
 getRequiredLocale ()
 
 getTemplate ()
 
 initData ()
 
 isLocaleResubmit ()
 
 isValid ()
 
 readInputData ()
 
 readUserDateVars ($vars)
 
 readUserVars ($vars)
 
 setData ($key, $value)
 
 setTemplate ($template)
 
 smartyFormLanguageChooser ($params, &$smarty)
 
 validate ($callHooks=true)
 

Public Attributes

 $_checks
 
 $_data
 
 $_errors
 
 $_template
 
 $cssValidation
 
 $errorFields
 
 $errorsArray
 
 $formSectionErrors
 

Detailed Description

Class defining basic operations for handling HTML forms.

Definition at line 44 of file Form.inc.php.

Member Function Documentation

Form::_decomposeArray (   $name,
  $value,
  $stack 
)

Convert PHP variable (literals or arrays) into HTML containing hidden input fields.

Parameters
$namestring Name of variable
$valuemixed Value of variable
$stackarray Names of array keys (for recursive calling)
Returns
string HTML hidden form elements describing the parameters.

Definition at line 479 of file Form.inc.php.

Referenced by smartyFormLanguageChooser().

Form::addCheck (   $formValidator)

Add a validation check to the form.

Parameters
$formValidatorFormValidator

Definition at line 395 of file Form.inc.php.

Referenced by AnnouncementForm\AnnouncementForm(), ArticleGalleyForm\ArticleGalleyForm(), AuthorSubmitForm\AuthorSubmitForm(), AuthorSubmitStep1Form\AuthorSubmitStep1Form(), AuthorSubmitStep3Form\AuthorSubmitStep3Form(), AuthorSubmitStep5Form\AuthorSubmitStep5Form(), AuthorSubmitSuppFileForm\AuthorSubmitSuppFileForm(), AuthSourceSettingsForm\AuthSourceSettingsForm(), BookForReviewForm\BookForReviewForm(), BooksForReviewSettingsForm\BooksForReviewSettingsForm(), CategoryForm\CategoryForm(), ChangePasswordForm\ChangePasswordForm(), CitationForm\CitationForm(), CommentForm\CommentForm(), ContextForm\ContextForm(), CreateReviewerForm\CreateReviewerForm(), CustomBlockEditForm\CustomBlockEditForm(), DataciteSettingsForm\DataciteSettingsForm(), DepositPointForm\DepositPointForm(), DOIExportSettingsForm\DOIExportSettingsForm(), DOISettingsForm\DOISettingsForm(), DuraCloudLoginForm\DuraCloudLoginForm(), EditCommentForm\EditCommentForm(), EmailTemplateForm\EmailTemplateForm(), ExternalFeedForm\ExternalFeedForm(), ExternalFeedSettingsForm\ExternalFeedSettingsForm(), FilterForm\FilterForm(), GiftIndividualSubscriptionForm\GiftIndividualSubscriptionForm(), GoogleAnalyticsSettingsForm\GoogleAnalyticsSettingsForm(), GroupForm\GroupForm(), IndividualSubscriptionForm\IndividualSubscriptionForm(), InstallForm\InstallForm(), InstitutionalSubscriptionForm\InstitutionalSubscriptionForm(), IssueForm\IssueForm(), IssueGalleyForm\IssueGalleyForm(), JournalSetupForm\JournalSetupForm(), JournalSetupStep1Form\JournalSetupStep1Form(), JournalSetupStep2Form\JournalSetupStep2Form(), JournalSetupStep3Form\JournalSetupStep3Form(), JournalSiteSettingsForm\JournalSiteSettingsForm(), LanguageSettingsForm\LanguageSettingsForm(), LoginChangePasswordForm\LoginChangePasswordForm(), LuceneSettingsForm\LuceneSettingsForm(), MedraSettingsForm\MedraSettingsForm(), MetadataForm\MetadataForm(), NotificationMailingListForm\NotificationMailingListForm(), OpenAdsSettingsForm\OpenAdsSettingsForm(), PaymentSettingsForm\PaymentSettingsForm(), PayMethodSettingsForm\PayMethodSettingsForm(), PhpMyVisitesSettingsForm\PhpMyVisitesSettingsForm(), PiwikSettingsForm\PiwikSettingsForm(), PKPNotificationSettingsForm\PKPNotificationSettingsForm(), ProfileForm\ProfileForm(), QuickSubmitForm\QuickSubmitForm(), SettingsForm\readInputData(), XMLGalleySettingsForm\readInputData(), InstitutionalSubscriptionForm\readInputData(), ThesisSettingsForm\readInputData(), ExternalFeedForm\readInputData(), AuthorSubmitStep3Form\readInputData(), BooksForReviewSettingsForm\readInputData(), UserIndividualSubscriptionForm\readInputData(), UserInstitutionalSubscriptionForm\readInputData(), SubscriptionTypeForm\readInputData(), SubscriptionPolicyForm\readInputData(), StudentThesisForm\readInputData(), QuickSubmitForm\readInputData(), SubscriptionForm\readInputData(), ThesisForm\readInputData(), BookForReviewForm\readInputData(), MetadataForm\readInputData(), IssueForm\readInputData(), ReferralForm\ReferralForm(), RegistrationForm\RegistrationForm(), ReportGeneratorForm\ReportGeneratorForm(), ReviewFormElementForm\ReviewFormElementForm(), ReviewFormForm\ReviewFormForm(), ReviewFormResponseForm\ReviewFormResponseForm(), SearchForm\SearchForm(), SectionForm\SectionForm(), SettingsForm\SettingsForm(), StaticPagesSettingsForm\StaticPagesSettingsForm(), StudentThesisForm\StudentThesisForm(), SubscriptionForm\SubscriptionForm(), SubscriptionPolicyForm\SubscriptionPolicyForm(), SubscriptionTypeForm\SubscriptionTypeForm(), SuppFileForm\SuppFileForm(), ThesisForm\ThesisForm(), ThesisSettingsForm\ThesisSettingsForm(), UpgradeForm\UpgradeForm(), URNSettingsForm\URNSettingsForm(), UsageStatsSettingsForm\UsageStatsSettingsForm(), UserIndividualSubscriptionForm\UserIndividualSubscriptionForm(), UserInstitutionalSubscriptionForm\UserInstitutionalSubscriptionForm(), UserManagementForm\UserManagementForm(), IssueForm\validate(), VersionForm\VersionForm(), and XMLGalleySettingsForm\XMLGalleySettingsForm().

Form::addError (   $field,
  $message 
)
Form::addErrorField (   $field)

Add an error field for highlighting on form

Parameters
$fieldstring the name of the field where the error occurred

Definition at line 412 of file Form.inc.php.

Referenced by IndividualSubscriptionForm\IndividualSubscriptionForm(), InstitutionalSubscriptionForm\InstitutionalSubscriptionForm(), IssueForm\validate(), ArticleGalleyForm\validate(), SuppFileForm\validate(), IssueGalleyForm\validate(), and CitationForm\validate().

Form::display (   $request = null,
  $template = null 
)

Display the form.

Parameters
$requestPKPRequest
$templatestring the template to be rendered, mandatory if no template has been specified on class instantiation.

Definition at line 142 of file Form.inc.php.

References fetch().

Form::execute (   $object = null)

Execute the form's action. (Note that it is assumed that the form has already been validated.)

Parameters
$objectobject The object edited by this form.
Returns
$object The same object, potentially changed via hook.

Definition at line 302 of file Form.inc.php.

References HookRegistry\call().

Form::fetch ( $request,
  $template = null,
  $display = false 
)

Returns a string of the rendered form

Parameters
$requestPKPRequest
$templatestring the template to be rendered, mandatory if no template has been specified on class instantiation.
$displayboolean
Returns
string the rendered form

Definition at line 154 of file Form.inc.php.

References HookRegistry\call(), getErrorsArray(), getFormLocale(), and isValid().

Referenced by display().

Form::Form (   $template = null,
  $callHooks = true,
  $requiredLocale = null,
  $supportedLocales = null 
)

Constructor.

Parameters
$templatestring the path to the form template file

Definition at line 80 of file Form.inc.php.

References HookRegistry\call(), AppLocale\getPrimaryLocale(), and AppLocale\getSupportedFormLocales().

Form::getData (   $key)

Get the value of a form field.

Parameters
$keystring
Returns
mixed

Definition at line 202 of file Form.inc.php.

Referenced by QuickSubmitForm\display(), SubscriptionForm\display(), CommentForm\email(), EditCommentForm\email(), LoginChangePasswordForm\execute(), ChangePasswordForm\execute(), ReferralPluginSettingsForm\execute(), StopForumSpamSettingsForm\execute(), UsageStatsSettingsForm\execute(), PhpMyVisitesSettingsForm\execute(), PiwikSettingsForm\execute(), GoogleAnalyticsSettingsForm\execute(), SettingsForm\execute(), AbntSettingsForm\execute(), CustomThemeSettingsForm\execute(), SiteSettingsForm\execute(), CategoryForm\execute(), DepositPointForm\execute(), PeerReviewCommentForm\execute(), AuthorDepositForm\execute(), JournalSetupStep1Form\execute(), AuthSourceSettingsForm\execute(), OpenAdsSettingsForm\execute(), ReviewFormResponseForm\execute(), ReviewFormForm\execute(), DuraCloudLoginForm\execute(), NotificationMailingListForm\execute(), GroupForm\execute(), PayMethodSettingsForm\execute(), XMLGalleySettingsForm\execute(), LuceneSettingsForm\execute(), ReferralForm\execute(), DOISettingsForm\execute(), LanguageSettingsForm\execute(), URNSettingsForm\execute(), VersionForm\execute(), EditCommentForm\execute(), ThesisSettingsForm\execute(), JournalSiteSettingsForm\execute(), ReviewFormElementForm\execute(), ContextForm\execute(), EmailTemplateForm\execute(), SearchForm\execute(), GiftIndividualSubscriptionForm\execute(), ExternalFeedForm\execute(), AuthorSubmitStep5Form\execute(), CreateReviewerForm\execute(), UserIndividualSubscriptionForm\execute(), AuthorSubmitStep1Form\execute(), InstitutionalSubscriptionForm\execute(), BooksForReviewSettingsForm\execute(), SubscriptionTypeForm\execute(), ArticleGalleyForm\execute(), NotificationSettingsForm\execute(), AuthorSubmitStep3Form\execute(), UserInstitutionalSubscriptionForm\execute(), CommentForm\execute(), SubscriptionPolicyForm\execute(), ThesisForm\execute(), IssueGalleyForm\execute(), StudentThesisForm\execute(), SectionForm\execute(), RegistrationForm\execute(), QuickSubmitForm\execute(), SuppFileForm\execute(), SubscriptionForm\execute(), FilterForm\execute(), ReportGeneratorForm\execute(), ProfileForm\execute(), UserManagementForm\execute(), BookForReviewForm\execute(), IssueForm\execute(), MetadataForm\execute(), CitationForm\fetch(), LanguageSettingsForm\initData(), SettingsForm\readInputData(), XMLGalleySettingsForm\readInputData(), PayMethodSettingsForm\readInputData(), JournalSiteSettingsForm\readInputData(), LanguageSettingsForm\readInputData(), CreateReviewerForm\readInputData(), InstitutionalSubscriptionForm\readInputData(), ExternalFeedForm\readInputData(), UserIndividualSubscriptionForm\readInputData(), UserInstitutionalSubscriptionForm\readInputData(), SubscriptionTypeForm\readInputData(), QuickSubmitForm\readInputData(), FilterForm\readInputData(), InstallForm\readInputData(), RegistrationForm\readInputData(), SubscriptionForm\readInputData(), UserManagementForm\readInputData(), ProfileForm\readInputData(), IssueForm\readInputData(), CustomBlockEditForm\save(), QuickSubmitForm\scheduleForPublication(), AuthorSubmitSuppFileForm\setSuppFileData(), SuppFileForm\setSuppFileData(), smartyFormLanguageChooser(), DuraCloudLoginForm\validate(), IssueForm\validate(), ArticleGalleyForm\validate(), SuppFileForm\validate(), IssueGalleyForm\validate(), and CitationForm\validate().

Form::getDefaultFormLocale ( )

Get the default form locale.

Returns
string

Definition at line 341 of file Form.inc.php.

References AppLocale\getLocale().

Referenced by getFormLocale().

Form::getErrorsArray ( )

Return set of errors that occurred in form validation. If multiple errors occurred processing a single field, only the first error is included.

Returns
array erroneous fields and associated error messages

Definition at line 429 of file Form.inc.php.

References $errorsArray.

Referenced by fetch(), and validate().

Form::getLocaleFieldNames ( )

Get the list of field names that need to support multiple locales

Returns
array

Definition at line 316 of file Form.inc.php.

References HookRegistry\call().

Referenced by JournalSetupForm\execute(), and smartyFormLanguageChooser().

Form::getRequiredLocale ( )

Get the required locale for this form (i.e. the locale for which required fields must be set, all others being optional)

Returns
string

Definition at line 129 of file Form.inc.php.

Referenced by AuthorSubmitStep3Form\AuthorSubmitStep3Form(), AuthorSubmitSuppFileForm\AuthorSubmitSuppFileForm(), MetadataForm\MetadataForm(), AuthorSubmitStep3Form\readInputData(), and MetadataForm\readInputData().

Form::getTemplate ( )

Get the template

Returns
string

Definition at line 120 of file Form.inc.php.

References $_template.

Form::initData ( )

Initialize form data for a new form.

Definition at line 219 of file Form.inc.php.

References HookRegistry\call().

Form::isLocaleResubmit ( )

Determine whether or not the current request results from a resubmit of locale data resulting from a form language change.

Returns
boolean

Definition at line 332 of file Form.inc.php.

References PKPRequest\getUserVar().

Form::isValid ( )

Check if form passes all validation checks.

Returns
boolean

Definition at line 420 of file Form.inc.php.

Referenced by fetch(), CitationForm\validate(), and validate().

Form::readInputData ( )

Assign form data to user-submitted data. Can be overridden from subclasses.

Definition at line 232 of file Form.inc.php.

Form::readUserDateVars (   $vars)

Adds specified user date variables to input data.

Parameters
$varsarray the names of the date variables to read

Definition at line 379 of file Form.inc.php.

References HookRegistry\call(), PKPRequest\getUserDateVar(), and setData().

Referenced by QuickSubmitForm\readInputData(), and IssueForm\readInputData().

Form::readUserVars (   $vars)

Adds specified user variables to input data.

Parameters
$varsarray the names of the variables to read

Definition at line 363 of file Form.inc.php.

References HookRegistry\call(), PKPRequest\getUserVar(), and setData().

Referenced by FilterForm\FilterForm(), FilterForm\initData(), NotificationSettingsForm\readInputData(), AuthorSubmitStep2Form\readInputData(), UsageStatsSettingsForm\readInputData(), LoginChangePasswordForm\readInputData(), NotificationMailingListForm\readInputData(), EditorDecisionCommentForm\readInputData(), ChangePasswordForm\readInputData(), ReferralPluginSettingsForm\readInputData(), DuraCloudLoginForm\readInputData(), ExternalFeedSettingsForm\readInputData(), StopForumSpamSettingsForm\readInputData(), PhpMyVisitesSettingsForm\readInputData(), PiwikSettingsForm\readInputData(), GoogleAnalyticsSettingsForm\readInputData(), StaticPagesSettingsForm\readInputData(), JournalSetupForm\readInputData(), SettingsForm\readInputData(), AbntSettingsForm\readInputData(), DepositPointForm\readInputData(), PeerReviewCommentForm\readInputData(), AuthorDepositForm\readInputData(), SiteSettingsForm\readInputData(), CustomThemeSettingsForm\readInputData(), CategoryForm\readInputData(), XMLGalleySettingsForm\readInputData(), LuceneSettingsForm\readInputData(), PayMethodSettingsForm\readInputData(), AuthSourceSettingsForm\readInputData(), ReviewFormResponseForm\readInputData(), OpenAdsSettingsForm\readInputData(), LanguageSettingsForm\readInputData(), JournalSiteSettingsForm\readInputData(), CreateReviewerForm\readInputData(), ReviewFormForm\readInputData(), VersionForm\readInputData(), GroupForm\readInputData(), EditCommentForm\readInputData(), AuthorSubmitStep5Form\readInputData(), DOISettingsForm\readInputData(), ReferralForm\readInputData(), ContextForm\readInputData(), DOIExportSettingsForm\readInputData(), InstitutionalSubscriptionForm\readInputData(), URNSettingsForm\readInputData(), ThesisSettingsForm\readInputData(), SearchForm\readInputData(), ExternalFeedForm\readInputData(), CustomBlockEditForm\readInputData(), AuthorSubmitStep3Form\readInputData(), EmailTemplateForm\readInputData(), GiftIndividualSubscriptionForm\readInputData(), ReviewFormElementForm\readInputData(), BooksForReviewSettingsForm\readInputData(), UserIndividualSubscriptionForm\readInputData(), UserInstitutionalSubscriptionForm\readInputData(), AuthorSubmitStep1Form\readInputData(), ArticleGalleyForm\readInputData(), SubscriptionTypeForm\readInputData(), PaymentSettingsForm\readInputData(), AuthorSubmitSuppFileForm\readInputData(), StudentThesisForm\readInputData(), SubscriptionPolicyForm\readInputData(), CitationForm\readInputData(), QuickSubmitForm\readInputData(), CommentForm\readInputData(), SectionForm\readInputData(), FilterForm\readInputData(), RegistrationForm\readInputData(), InstallForm\readInputData(), SubscriptionForm\readInputData(), ThesisForm\readInputData(), IssueGalleyForm\readInputData(), SuppFileForm\readInputData(), UserManagementForm\readInputData(), ProfileForm\readInputData(), BookForReviewForm\readInputData(), ReportGeneratorForm\readInputData(), MetadataForm\readInputData(), and IssueForm\readInputData().

Form::setData (   $key,
  $value 
)
Form::setTemplate (   $template)

Set the template

Parameters
$templatestring

Definition at line 112 of file Form.inc.php.

Form::smartyFormLanguageChooser (   $params,
$smarty 
)

Add hidden form parameters for the localized fields for this form and display the language chooser field

Parameters
$paramsarray
$smartyobject

Definition at line 445 of file Form.inc.php.

References _decomposeArray(), getData(), getFormLocale(), and getLocaleFieldNames().

Form::validate (   $callHooks = true)

Validate form data.

Definition at line 239 of file Form.inc.php.

References $errorFields, addError(), HookRegistry\call(), PKPApplication\getApplication(), getErrorsArray(), and isValid().

Member Data Documentation

Form::$_checks

Validation checks for this form

Definition at line 53 of file Form.inc.php.

Form::$_data

Associative array containing form data

Definition at line 50 of file Form.inc.php.

Form::$_errors

Errors occurring in form validation

Definition at line 56 of file Form.inc.php.

Form::$_template

The template file containing the HTML form

Definition at line 47 of file Form.inc.php.

Referenced by getTemplate().

Form::$cssValidation

Client-side validation rules

Definition at line 68 of file Form.inc.php.

Form::$errorFields

Array of field names where an error occurred

Definition at line 62 of file Form.inc.php.

Referenced by validate().

Form::$errorsArray

Array of field names where an error occurred and the associated error message

Definition at line 59 of file Form.inc.php.

Referenced by getErrorsArray().

Form::$formSectionErrors

Array of errors for the form section currently being processed

Definition at line 65 of file Form.inc.php.


The documentation for this class was generated from the following file: