baseline
[omp.pkp.sfu.ca.git] / classes / monograph / form / MonographArtworkForm.inc.php
blob94ba4a096c9adcf1cc5d684d0b42d6d103980614
1 <?php
3 /**
4 * @file classes/monograph/form/MonographArtworkForm.inc.php
6 * Copyright (c) 2003-2008 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
9 * @class MonographArtworkForm
10 * @ingroup monograph
11 * @see Monograph
13 * @brief Form for uploading artwork.
16 // $Id: MonographArtworkForm.inc.php,v 1.4 2009/06/09 23:37:13 tylerl Exp $
19 import('form.Form');
20 import('inserts.artwork.ArtworkInsert');
22 class MonographArtworkForm extends Form {
24 var $monograph;
25 var $artworkInsert;
27 /**
28 * Constructor.
30 function MonographArtworkForm($template, $monograph) {
31 parent::Form($template);
32 $this->addCheck(new FormValidatorPost($this));
33 $this->monograph =& $monograph;
34 $this->artworkInsert = new ArtworkInsert($monograph->getMonographId());
37 /**
38 * Get a list of fields for which localization should be used.
39 * @return array
41 function getLocaleFieldNames() {
42 return array();
45 /**
46 * Display the form.
48 function display() {
49 $templateMgr =& TemplateManager::getManager();
50 $templateMgr->assign_by_ref('submission', $this->monograph);
52 $this->artworkInsert->display($this);
54 parent::display();
57 function processEvents() {
58 return $this->artworkInsert->processEvents($this);
61 /**
62 * Initialize form data.
64 function initData() {
68 /**
69 * Assign form data to user-submitted data.
71 function readInputData() {
72 $this->readUserVars($this->artworkInsert->listUserVars());
75 /**
76 * Save settings.
78 function execute() {
79 return $this->artworkInsert->execute($this, $this->monograph);