SectionForm::initData PHP Method

initData() public method

Initialize form data from current settings.
public initData ( $args, $request )
$args array
$request PKPRequest
    function initData($args, $request)
    {
        $journal = $request->getJournal();
        $sectionDao = DAORegistry::getDAO('SectionDAO');
        $sectionId = $this->getSectionId();
        if ($sectionId) {
            $section = $sectionDao->getById($sectionId, $journal->getId());
        }
        if (isset($section)) {
            $this->_data = array('title' => $section->getTitle(null), 'abbrev' => $section->getAbbrev(null), 'reviewFormId' => $section->getReviewFormId(), 'metaIndexed' => !$section->getMetaIndexed(), 'metaReviewed' => !$section->getMetaReviewed(), 'abstractsNotRequired' => $section->getAbstractsNotRequired(), 'identifyType' => $section->getIdentifyType(null), 'editorRestriction' => $section->getEditorRestricted(), 'hideTitle' => $section->getHideTitle(), 'hideAuthor' => $section->getHideAuthor(), 'hideAbout' => $section->getHideAbout(), 'policy' => $section->getPolicy(null), 'wordCount' => $section->getAbstractWordCount());
        }
    }

Usage Example

Example #1
0
 /**
  * Display form to create/edit a section.
  * @param $args array optional, if set the first parameter is the ID of the section to edit
  */
 function editSection($args = array())
 {
     $this->validate();
     $this->setupTemplate(true);
     import('classes.manager.form.SectionForm');
     $sectionForm = new SectionForm(!isset($args) || empty($args) ? null : (int) $args[0]);
     if ($sectionForm->isLocaleResubmit()) {
         $sectionForm->readInputData();
     } else {
         $sectionForm->initData();
     }
     $sectionForm->display();
 }
All Usage Examples Of SectionForm::initData