Exemplo n.º 1
0
 public function __construct($name, $content = null)
 {
     parent::__construct($name);
     if (is_string($content)) {
         $this->setContent($content);
     }
 }
Exemplo n.º 2
0
 protected function confirmedTitle(Form $form, Field $field, $property)
 {
     $fieldName = $field->getName();
     // If in some lang file the confirmation key is excplicit setted
     if ($directHit = $this->getFirstMatch($this->relativeKey($form, $field, $property))) {
         return $directHit;
     }
     // Otherwise try to translate the confirmation text with the source field
     // name
     // If no confirm key setted break
     if (!($confirmKey = $this->getFirstMatchedKey("forms.base.field_confirmed"))) {
         return;
     }
     $sourceFieldName = str_replace('_confirmation', '', $fieldName);
     $sourceRelativeKey = $this->relativeKey($form, $form->get($sourceFieldName), $property);
     // If the source field is not named break
     if (!($sourceTitle = $this->getFirstMatch($sourceRelativeKey))) {
         return;
     }
     return $this->lang->get($confirmKey, ['attribute' => $sourceTitle]);
 }
Exemplo n.º 3
0
 public function copy($prefix = '')
 {
     $copy = parent::copy($prefix);
     $copy->setMultiLine($this->isMultiLine());
     return $copy;
 }
Exemplo n.º 4
0
 public function isLastField(Field $field)
 {
     $last = count($this->keyOrder) - 1;
     if (isset($this->keyOrder[$last])) {
         if ($this->keyOrder[$last] == $field->getName()) {
             return TRUE;
         }
     }
     return FALSE;
 }
Exemplo n.º 5
0
 public function copy()
 {
     $copy = parent::copy();
     if ($this->columns) {
         $copy->setColumns($this->columns);
     }
     if ($this->grouper) {
         $copy->setGrouper($this->grouper);
     }
     $copy->setSrc($this->src, $this->manualExtractor);
     return $copy;
 }
Exemplo n.º 6
0
 protected function updateAttributes(Attributes $attributes)
 {
     parent::updateAttributes($attributes);
     $attributes->set('type', 'hidden');
     $attributes->set('value', $this->value);
 }
Exemplo n.º 7
0
 public function copy($prefix = '')
 {
     $copy = parent::copy($prefix);
     foreach ($this as $field) {
         $copy->push($field->copy($prefix));
     }
     return $copy;
 }
Exemplo n.º 8
0
 public function copy($prefix = '')
 {
     $copy = parent::copy($prefix);
     if ($this->columns) {
         $copy->setColumns($this->columns);
     }
     $copy->setSrc($this->getSrc(), $this->manualExtractor);
     return $copy;
 }
Exemplo n.º 9
0
 protected function getCacheId(Form $form, Field $field, $property)
 {
     return $form->getName() . '|' . $field->getName() . "|{$property}";
 }
Exemplo n.º 10
0
 protected function fieldKey(Field $field)
 {
     return str_replace('__', '.', $field->getName());
 }
Exemplo n.º 11
0
 public function __toString_()
 {
     $res = parent::__toString();
     die('Karpotten');
 }
Exemplo n.º 12
0
 public function setName($name)
 {
     $cleanedName = str_replace('action_', '', $name);
     $this->value = $cleanedName;
     return parent::setName("action_{$cleanedName}");
 }