Ejemplo n.º 1
0
 protected function initWidget()
 {
     if (!isset($this->entityMeta)) {
         throw new \Psc\Exception('EntityMeta muss für initWidget() gesetzt sein');
     }
     $this->widget = new ComboDropBox2($this->getComboBox(), $this->getDropBox(), $this->getFormLabel() ?: $this->entityMeta->getLabel());
 }
Ejemplo n.º 2
0
 /**
  * Das Label für den Tab selbst
  */
 public function getTabLabel()
 {
     if ($this->context === 'new') {
         return $this->entityMeta->getNewLabel();
     } elseif ($this->context === 'grid') {
         return $this->entityMeta->getGridLabel();
     } elseif ($this->context === self::CONTEXT_SEARCHPANEL) {
         return $this->entityMeta->getSearchLabel();
     } elseif ($this->context === self::CONTEXT_DEFAULT) {
         return $this->entityMeta->getLabel();
     } else {
         throw new \InvalidArgumentException(sprintf("Context '%s' ist unbekannt", $this->context));
     }
 }
Ejemplo n.º 3
0
 public function __construct(EntityMeta $entityMeta, $maxResults = 15)
 {
     $acRequest = $entityMeta->getAutoCompleteRequestMeta(array('term' => NULL));
     $item = new stdClass();
     $item->genitiv = $entityMeta->getGenitiv();
     $item->fields = \Psc\FE\Helper::listStrings($entityMeta->getAutoCompleteFields(), ', ', ' oder ');
     $item->type = $entityMeta->getEntityName();
     $item->url = $acRequest->getUrl();
     $item->label = $entityMeta->getLabel(EntityMeta::CONTEXT_AUTOCOMPLETE);
     $item->data = array();
     parent::__construct($item);
     $this->maxResults = $maxResults;
     // copy from meta
     // (hier die setter nehmen falls wir mal den search panel schön bauen sollten ;))
     $this->setLabel($entityMeta->getAutoCompleteHeadline());
     $this->setAutoCompleteDelay($entityMeta->getAutoCompleteDelay());
     $this->setAutoCompleteBody($acRequest->getBody());
     $this->setAutoCompleteMinLength($entityMeta->getAutoCompleteMinLength());
 }