Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Form Class Reference
Inheritance diagram for Form:
AddThisSettingsForm AdvancedSearchReviewerFilterForm ApprovedProofForm AuthorForm CatalogEntryFormatMetadataForm CategoryForm ChangePasswordForm ChapterForm ContextSettingsForm ContextSiteSettingsForm ContributorForm DOISettingsForm EditorDecisionForm FilterForm FooterCategoryForm GenreForm IdentificationCodeForm InstallForm InstallLanguageForm LibraryFileForm LimitFilesForm LoginChangePasswordForm ManageSubmissionFilesForm MarketForm NewNoteForm NotificationMailingListForm PKPAnnouncementForm PKPAnnouncementTypeForm PKPAuditorReminderForm PKPFileAuditorForm PKPNotificationSettingsForm PKPProfileForm PKPRegistrationForm PKPReportGeneratorForm PKPSubmissionMetadataViewForm PreparedEmailForm PublicationDateForm PublicationFormatForm RepresentativeForm ReviewerForm ReviewerReviewForm ReviewReminderForm SalesRightsForm SeriesForm SettingsFileUploadForm SocialMediaForm SponsorForm SpotlightForm SubmissionChecklistForm SubmissionFilesMetadataForm SubmissionSubmitForm ThankReviewerForm UnassignReviewerForm UpgradeForm UploadPluginForm UsageStatsSettingsForm UserDisableForm UserEmailForm UserForm UserGroupForm

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
 
 $requiredLocale
 
 $supportedLocales
 

Detailed Description

Class defining basic operations for handling HTML forms.

Definition at line 47 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 480 of file Form.inc.php.

Referenced by smartyFormLanguageChooser().

Form::addCheck (   $formValidator)

Add a validation check to the form.

Parameters
$formValidatorFormValidator

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

Referenced by AdvancedSearchReviewerForm\AdvancedSearchReviewerForm(), AuditorReminderForm\AuditorReminderForm(), AuthorForm\AuthorForm(), CatalogEntryFormatMetadataForm\CatalogEntryFormatMetadataForm(), CatalogEntrySubmissionReviewForm\CatalogEntrySubmissionReviewForm(), ChapterForm\ChapterForm(), ContactForm\ContactForm(), ContextSiteSettingsForm\ContextSiteSettingsForm(), ContributorForm\ContributorForm(), CreateReviewerForm\CreateReviewerForm(), EmailTemplatesForm\EmailTemplatesForm(), EnrollExistingReviewerForm\EnrollExistingReviewerForm(), GenreForm\GenreForm(), IdentificationCodeForm\IdentificationCodeForm(), LibraryFileForm\LibraryFileForm(), LoginChangePasswordForm\LoginChangePasswordForm(), MarketForm\MarketForm(), MastheadForm\MastheadForm(), NewNoteForm\NewNoteForm(), PKPAuditorReminderForm\PKPAuditorReminderForm(), PKPNotificationSettingsForm\PKPNotificationSettingsForm(), PKPSubmissionSubmitStep1Form\PKPSubmissionSubmitStep1Form(), PreparedEmailForm\PreparedEmailForm(), PublicationDateForm\PublicationDateForm(), PublicationFormatForm\PublicationFormatForm(), RepresentativeForm\RepresentativeForm(), ReviewerForm\ReviewerForm(), ReviewerReviewStep3Form\ReviewerReviewStep3Form(), ReviewReminderForm\ReviewReminderForm(), SalesRightsForm\SalesRightsForm(), SearchByNameReviewerForm\SearchByNameReviewerForm(), SettingsFileUploadForm\SettingsFileUploadForm(), SiteSetupForm\SiteSetupForm(), SponsorForm\SponsorForm(), SubmissionStageForm\SubmissionStageForm(), ThankReviewerForm\ThankReviewerForm(), UpgradeForm\UpgradeForm(), and UserForm\UserForm().

Form::addError (   $field,
  $message 
)

Add an error to the form. Errors are typically assigned as the form is validated.

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

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

Referenced by SeriesForm\validate(), and validate().

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 413 of file Form.inc.php.

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 151 of file Form.inc.php.

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 303 of file Form.inc.php.

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 163 of file Form.inc.php.

Referenced by getRequiredLocale().

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

Constructor.

Parameters
$templatestring the path to the form template file

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

Form::getData (   $key)

Get the value of a form field.

Parameters
$keystring
Returns
mixed

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

Referenced by UserGroupForm\_setUserGroupLocaleFields(), SiteSetupForm\deleteFile(), RegistrationForm\execute(), PressSiteSettingsForm\execute(), SubmissionFilesArtworkMetadataForm\execute(), LoginChangePasswordForm\execute(), EnrollExistingReviewerForm\execute(), EditLibraryFileForm\execute(), PromoteForm\execute(), SubmissionSubmitStep3Form\execute(), CatalogEntrySubmissionReviewForm\execute(), SubmissionMetadataViewForm\execute(), MastheadForm\execute(), CreateReviewerForm\execute(), NewSiteImageFileForm\execute(), NewContextImageFileForm\execute(), NotificationSettingsForm\execute(), ContributorForm\execute(), UnassignReviewerForm\execute(), InstallLanguageForm\execute(), SponsorForm\execute(), NewNoteForm\execute(), ThankReviewerForm\execute(), ReviewReminderForm\execute(), ReviewerReviewStep3Form\execute(), ReviewerReviewStep1Form\execute(), GenreForm\execute(), ChapterForm\execute(), PublicationFormatForm\execute(), SiteSetupForm\execute(), PKPAuditorReminderForm\execute(), IdentificationCodeForm\execute(), RepresentativeForm\execute(), PKPSubmissionSubmitStep1Form\execute(), PublicationDateForm\execute(), SalesRightsForm\execute(), AuthorForm\execute(), CatalogEntryFormatMetadataForm\execute(), MarketForm\execute(), ReviewerForm\execute(), InstallLanguageForm\fetch(), AnnouncementSettingsForm\fetch(), SettingsFileUploadForm\fetchTemporaryFile(), MastheadForm\initData(), PKPFileAuditorForm\initData(), UserForm\readInputData(), SubmissionMetadataViewForm\readInputData(), ManageSubmissionFilesForm\readInputData(), PKPReportGeneratorForm\readInputData(), ReviewerForm\readInputData(), SettingsFileUploadForm\removeTemporaryFile(), SiteSetupForm\renderFileView(), SubmissionSubmitStep1Form\setSubmissionData(), PKPSubmissionSubmitStep1Form\setSubmissionData(), smartyFormLanguageChooser(), PKPSubmissionSubmitStep1Form\validate(), and SubmissionSubmitStep1Form\validate().

Form::getDefaultFormLocale ( )

Get the default form locale.

Returns
string

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

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 430 of file Form.inc.php.

Form::getFormLocale ( )

Get the current form locale.

Returns
string

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

Referenced by PKPSubmissionSubmitStep1Form\initData().

Form::getLocaleFieldNames ( )

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

Returns
array

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

Referenced by ContextSettingsForm\execute(), and SiteSetupForm\execute().

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 138 of file Form.inc.php.

References fetch().

Form::getTemplate ( )

Get the template

Returns
string

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

Form::initData ( )

Initialize form data for a new form.

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

Referenced by PKPLoginHandler\changePassword(), UserGridHandler\updateUser(), and PKPSubmissionInformationCenterHandler\viewNotes().

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 333 of file Form.inc.php.

Form::isValid ( )

Check if form passes all validation checks.

Returns
boolean

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

Form::readInputData ( )

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

Definition at line 240 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 380 of file Form.inc.php.

Form::readUserVars (   $vars)

Adds specified user variables to input data.

Parameters
$varsarray the names of the variables to read

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

Referenced by EditorDecisionForm\getStageId(), ManageSubmissionFilesForm\initData(), PKPFileAuditorForm\initData(), NotificationSettingsForm\readInputData(), SubmissionSubmitStep3Form\readInputData(), SearchByNameReviewerForm\readInputData(), AdvancedSearchReviewerForm\readInputData(), SubmissionFilesArtworkMetadataForm\readInputData(), CatalogEntrySubmissionReviewForm\readInputData(), EnrollExistingReviewerForm\readInputData(), LoginChangePasswordForm\readInputData(), ReviewerReviewStep3Form\readInputData(), CreateReviewerForm\readInputData(), NewSiteImageFileForm\readInputData(), SubmissionSubmitStep1Form\readInputData(), SubmissionMetadataViewForm\readInputData(), SettingsFileUploadForm\readInputData(), LibraryFileForm\readInputData(), NewContextImageFileForm\readInputData(), ContextSiteSettingsForm\readInputData(), ContributorForm\readInputData(), SponsorForm\readInputData(), NewNoteForm\readInputData(), ThankReviewerForm\readInputData(), ReviewReminderForm\readInputData(), GenreForm\readInputData(), ReviewerReviewStep1Form\readInputData(), PreparedEmailForm\readInputData(), ChapterForm\readInputData(), UnassignReviewerForm\readInputData(), PublicationFormatForm\readInputData(), PKPAuditorReminderForm\readInputData(), SiteSetupForm\readInputData(), PKPSubmissionSubmitStep1Form\readInputData(), RepresentativeForm\readInputData(), IdentificationCodeForm\readInputData(), AuthorForm\readInputData(), SalesRightsForm\readInputData(), PublicationDateForm\readInputData(), CatalogEntryFormatMetadataForm\readInputData(), MarketForm\readInputData(), and ReviewerForm\readInputData().

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 446 of file Form.inc.php.

References _decomposeArray(), and getData().

Form::validate (   $callHooks = true)

Validate form data.

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

References $errorFields, and addError().

Member Data Documentation

Form::$_checks

Validation checks for this form

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

Form::$_data

Associative array containing form data

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

Form::$_errors

Errors occurring in form validation

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

Form::$_template

The template file containing the HTML form

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

Form::$cssValidation

Client-side validation rules

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

Form::$errorFields

Array of field names where an error occurred

Definition at line 65 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 62 of file Form.inc.php.

Form::$formSectionErrors

Array of errors for the form section currently being processed

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

string Form::$requiredLocale

Symbolic name of required locale

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

array Form::$supportedLocales

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