Example #1
0
 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, trim(strstr($this->rel_key, '.'), '.'));
     }
     parent::getValue();
     if (count($this->local_options)) {
         $description_arr = array();
         $this->fill_tags = "";
         foreach ($this->options as $value => $description) {
             if (in_array($value, $this->values)) {
                 $description_arr[] = $description;
                 $row = new \stdClass();
                 $row->key = $value;
                 $row->value = $description;
                 $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
             }
         }
         $this->description = implode($this->separator, $description_arr);
     } elseif ($this->relation != null) {
         if ($this->is_refill) {
             $values = explode($this->serialization_sep, $this->value);
             $entity = get_class($this->relation->getRelated());
             $related = $entity::whereIn($this->record_id, $values)->get();
         } else {
             $related = $this->relation->get();
         }
         $name = $this->rel_field;
         $key = $this->record_id;
         $this->fill_tags = "";
         if (count($related)) {
             foreach ($related as $item) {
                 $row = new \stdClass();
                 $row->{$key} = $item->{$key};
                 $row->{$name} = $item->{$name};
                 $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
                 $description_arr[] = $item->{$name};
             }
             $this->description = implode($this->separator, $description_arr);
         }
     } else {
         if ($this->value) {
             $values = explode($this->serialization_sep, $this->value);
             $name = $this->record_label;
             $key = $this->record_id;
             $this->fill_tags = "";
             if (count($values)) {
                 //var_dump($values);
                 foreach ($values as $item) {
                     $row = new \stdClass();
                     $row->{$key} = $item;
                     $row->{$name} = $item;
                     $this->fill_tags .= "\n                      \$('#{$this->name}').tagsinput('add', " . json_encode($row) . ");";
                     $description_arr[] = $item;
                 }
                 $this->description = implode($this->separator, $description_arr);
             }
         }
     }
 }
Example #2
0
 public function getValue()
 {
     parent::getValue();
     if (\Request::isMethod('post') && !\Input::exists($this->name)) {
         $this->value = $this->unchecked_value;
     }
     $this->checked = (bool) ($this->value == $this->checked_value);
 }
Example #3
0
 public function getValue()
 {
     parent::getValue();
     foreach ($this->options as $value => $description) {
         if ($this->value == $value) {
             $this->description = $description;
         }
     }
 }
Example #4
0
 public function getValue()
 {
     Field::getValue();
     $this->values = explode($this->serialization_sep, $this->value);
     foreach ($this->values as $value) {
         $values[] = $this->isoDateToHuman($value);
     }
     if (isset($values)) {
         $this->value = implode($this->serialization_sep, $values);
     }
 }
Example #5
0
 function getValue()
 {
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
Example #6
0
 public function getValue()
 {
     parent::getValue();
     $this->values = explode($this->serialization_sep, $this->value);
     $description_arr = array();
     foreach ($this->options as $value => $description) {
         if (in_array($value, $this->values)) {
             $description_arr[] = $description;
         }
     }
     $this->description = implode($this->separator, $description_arr);
 }
Example #7
0
 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, preg_replace('#([a-z0-9_-]+\\.)?(.*)#i', '$2', $this->rel_key));
     }
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
 public function getValue()
 {
     if (!$this->is_local && !$this->record_label && $this->rel_field != "") {
         $this->remote($this->rel_field, trim(strstr($this->rel_key, '.'), '.'));
     }
     parent::getValue();
     if (count($this->local_options)) {
         foreach ($this->options as $value => $description) {
             if ($this->value == $value) {
                 $this->description = $description;
             }
         }
     }
 }
Example #9
0
 function getValue()
 {
     parent::getValue();
     $this->checked = (bool) ($this->value == $this->checked_value);
 }