/** * Produces metadata overview page of a document. * @return Opus_Document */ public function indexAction() { $docId = $this->getRequest()->getParam('id'); $document = $this->documentsHelper->getDocumentForId($docId); if (isset($document)) { $this->view->document = $document; $this->view->documentAdapter = new Util_DocumentAdapter($this->view, $document); $form = new Admin_Form_Document(); $form->populateFromModel($document); $form->prepareRenderingAsView(); $this->view->contentWrapperDisabled = true; $this->_helper->breadcrumbs()->setDocumentBreadcrumb($document); $this->renderForm(new Admin_Form_Wrapper($form)); } else { // missing or bad parameter => go back to main page return $this->_redirectTo('index', array('failure' => $this->view->translate('admin_document_error_novalidid')), 'documents', 'admin'); } }
/** * Für ein leeres Dokument werden fast alle Unterformulare entfernt. Weiterhin angezeigt werden die ActionBox, und * die InfoBox, */ public function testPrepareRenderingAsViewForEmptyDocument() { $form = new Admin_Form_Document(); $document = $this->createTestDocument(); $form->populateFromModel($document); $form->prepareRenderingAsView(); $this->verifySubForms($form, array('ActionBox', 'InfoBox', 'Bibliographic')); }