Ejemplo n.º 1
0
 /**
  * Method returns an array with one or two buttons for browsing the collections during publication.
  * The buttons have been added to the current Zend_Form.
  *
  * Wird nur für Collection Roles aufgerufen.
  *
  * @return <Array> of button names
  */
 private function browseButtons()
 {
     $displayGroup = array();
     //show browseDown button only for the last select field
     $level = (int) count($this->collectionIds);
     try {
         $collection = new Opus_Collection($this->collectionIds[$level - 1]);
     } catch (Exception $e) {
         // TODO improve exception handling
         return null;
     }
     if ($collection->hasVisiblePublishChildren()) {
         $downButton = $this->addDownButtontoGroup();
         $this->form->addElement($downButton);
         $displayGroup[] = $downButton->getName();
     }
     $isRoot = $collection->isRoot();
     if (!$isRoot && !is_null($this->collectionIds[0])) {
         // collection has parents -> make button to browse up
         $upButton = $this->addUpButtontoGroup();
         $this->form->addElement($upButton);
         $displayGroup[] = $upButton->getName();
     }
     return $displayGroup;
 }