Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
CitationForm Class Reference
Inheritance diagram for CitationForm:
Form

Public Member Functions

 _getStringValueFromMetadataStatement (&$property, &$value)
 
 _orderByDisplayName ($fieldList)
 
 CitationForm (&$request, &$citation, &$assocObject)
 
 execute ()
 
 fetch ($request, $template=CITATION_FORM_FULL_TEMPLATE)
 
getAssocObject ()
 
getCitation ()
 
 getUnsavedChanges ()
 
 initData ()
 
 readInputData ()
 
 setUnsavedChanges ($unsavedChanges)
 
 validate ()
 
- Public Member Functions inherited from Form
 _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)
 

Additional Inherited Members

- Public Attributes inherited from Form
 $_checks
 
 $_data
 
 $_errors
 
 $_template
 
 $cssValidation
 
 $errorFields
 
 $errorsArray
 
 $formSectionErrors
 

Detailed Description

Form for adding/editing a citation.

Definition at line 21 of file CitationForm.inc.php.

Member Function Documentation

CitationForm::_getStringValueFromMetadataStatement ( $property,
$value 
)

Take a structured meta-data statement and transform it into a plain text value that can be displayed to the end-user.

Parameters
$propertyMetadataProperty
$valuemixed
Returns
string

Definition at line 521 of file CitationForm.inc.php.

Referenced by fetch(), and initData().

CitationForm::_orderByDisplayName (   $fieldList)

Alphabetically order the given field list by display name.

Parameters
$fieldListarray expects an array of entries with a sub-key "displayName".
Returns
array the ordered field.

Definition at line 553 of file CitationForm.inc.php.

Referenced by fetch().

CitationForm::CitationForm ( $request,
$citation,
$assocObject 
)

Constructor.

Parameters
$requestPKPRequest
$citationCitation
$assocObjectDataObject

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

References Form\addCheck().

CitationForm::execute ( )

Save citation

Definition at line 278 of file CitationForm.inc.php.

References getCitation(), and DAORegistry\getDAO().

CitationForm::fetch (   $request,
  $template = CITATION_FORM_FULL_TEMPLATE 
)

Fetch the form.

Parameters
$requestRequest
$templatestring the template to render the form
Returns
string the rendered form

Definition at line 297 of file CitationForm.inc.php.

References _getStringValueFromMetadataStatement(), _orderByDisplayName(), Form\addError(), String\diff(), getAssocObject(), getCitation(), DAORegistry\getDAO(), Form\getData(), AppLocale\getLocale(), and getUnsavedChanges().

& CitationForm::getAssocObject ( )

Get the object the citation belongs to.

Returns
DataObject

Definition at line 87 of file CitationForm.inc.php.

Referenced by fetch().

& CitationForm::getCitation ( )

Get the citation

Returns
Citation

Definition at line 79 of file CitationForm.inc.php.

Referenced by execute(), fetch(), initData(), and validate().

CitationForm::getUnsavedChanges ( )

Returns true if the form contains unsaved changes, otherwise false.

Returns
boolean

Definition at line 104 of file CitationForm.inc.php.

Referenced by fetch().

CitationForm::initData ( )

Initialize form data from the associated citation.

Definition at line 114 of file CitationForm.inc.php.

References _getStringValueFromMetadataStatement(), getCitation(), and Form\setData().

CitationForm::readInputData ( )

Initialize form data from user submitted data.

Definition at line 150 of file CitationForm.inc.php.

References Form\readUserVars().

CitationForm::setUnsavedChanges (   $unsavedChanges)

Set true if the form contains unsaved changes.

Parameters
$unsavedChangesboolean

Definition at line 95 of file CitationForm.inc.php.

CitationForm::validate ( )

Custom implementation of Form::validate() that validates meta-data form data and injects it into the internal citation object.

NB: The configuration of the internal citation object would normally be done in readInputData(). Validation and injection can easily be done in one step. It therefore avoids code duplication and improves performance to do both here.

Definition at line 167 of file CitationForm.inc.php.

References Citation\_getSupportedCitationStates(), Form\addError(), Form\addErrorField(), getCitation(), Form\getData(), MetadataDescription\getNamespacedPropertyId(), Form\isValid(), and Form\setData().


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