public function init() { if ($_SESSION['loggedin']) { $this->defaultSkinFile = __DIR__ . '/LoginControl.loggedin.skin'; } else { $this->defaultSkinFile = __DIR__ . '/LoginControl.loggedout.skin'; } parent::init(); }
/** * @inheritdoc */ protected function init() { parent::init(); $this->datumvon = new InputDateControl($this, 'datumvon'); $this->datumbis = new InputDateControl($this, 'datumbis'); }
/** * @param string|array $match * @param BaseEntity $entity * @param Control $controlContainer * @param $vars * @param $useControl * @return mixed */ private function getReplacement($match, $entity, $controlContainer, $vars, $useControl) { if ($match === 'controls') { // Unter-Controls ausgeben return $controlContainer->renderChildren(); } elseif (is_array($match)) { if (array_key_exists($match[0], $vars)) { // Zusammengesetzter Wert $variable = $match[0]; $property = $match[1]; return $vars[$variable]->{$property}; } elseif (Configuration::get($match[0] . '.' . $match[1]) !== null) { // Konfigurations-Wert return Configuration::get($match[0] . '.' . $match[1]); } } elseif (array_key_exists($match, $vars)) { // Ein Wert im Variablen-Array return $this->getWertFromVars($match, $vars); } elseif ($entity !== null && $match === $entity->primaryKey) { // Primärschlüssel des Entity return $entity->id; } elseif ($controlContainer !== null && $controlContainer->get($match) !== null) { // Control ausgeben [nur HTML] return $controlContainer->get($match)->toHtml(); } elseif ($entity !== null && $entity->hasField($match)) { // String-Repräsentation eines Felds [oder das Control] return $this->getWertFromEntity($match, $entity, $useControl); } elseif ($entity !== null && $entity->getParserText($match) !== '') { // Text aus dem Entity return $entity->getParserText($match); } return ''; }
/** * Initialisieren des Controls */ public function init() { parent::init(); }
/** * @param BaseEntity $entity */ protected function setEntity(BaseEntity $entity) { $this->controls->setEntity($entity); }
/** * Fügt dem EditControl eine neue Zeile hinzu * @param $row * @param Control|null $control * @param boolean|null $readOnly * @return $this */ public function addRow($row, $control = null, $readOnly = null) { if ($readOnly == null) { $readOnly = $this->readOnly; } if (isset($control)) { if (!$control instanceof Control) { throw new Exception('Kein gültiges Control übergeben'); } if ($control instanceof InputControl) { $control->setReadOnly($readOnly); } if ($control instanceof LookupBoxControl) { $control->setReadOnly($readOnly); } $this->rows[] = array('field' => '', 'header' => $row, 'control' => $control, 'readOnly' => $readOnly); } else { if ($this->entity == null) { throw new Exception('Kein Entity gesetzt'); } if ($row == '-') { $this->rows[] = array('field' => $row, 'control' => null, 'readOnly' => true); } elseif (substr($row, 0, 1) == '*') { $this->rows[] = array('field' => $row, 'control' => null, 'readOnly' => true); } else { $this->rows[] = array('field' => $row, 'header' => $this->entity->felder[$row]->getDescription(), 'control' => $this->entity->felder[$row]->getEditControl($readOnly), 'readOnly' => $readOnly); } } return $this; }