예제 #1
0
 public function build()
 {
     $output = "";
     unset($this->attributes['type'], $this->attributes['size']);
     if (parent::build() === false) {
         return;
     }
     switch ($this->status) {
         case "disabled":
         case "show":
             if (!isset($this->value)) {
                 $output = $this->layout['null_label'];
             } else {
                 $output = $this->description;
             }
             $output = "<div class='help-block'>" . $output . "&nbsp;</div>";
             break;
         case "create":
         case "modify":
             $output = Form::select($this->name, $this->options, $this->value, $this->attributes) . $this->extra_output;
             break;
         case "hidden":
             $output = Form::hidden($this->name, $this->value);
             break;
         default:
     }
     $this->output = $output;
 }
예제 #2
0
 public function build()
 {
     $output = "";
     if (!isset($this->style)) {
         $this->style = "margin:0 2px 0 0; vertical-align: middle";
     }
     unset($this->attributes['id']);
     if (parent::build() === false) {
         return;
     }
     switch ($this->status) {
         case "disabled":
         case "show":
             if (!isset($this->value)) {
                 $output = $this->layout['null_label'];
             } else {
                 $output = $this->description;
             }
             $output = "<div class='help-block'>" . $output . "&nbsp;</div>";
             break;
         case "create":
         case "modify":
             $this->attributes['multiple'] = 'multiple';
             $this->attributes['data-placeholder'] = $this->attributes['placeholder'];
             $this->attributes['placeholder'] = null;
             $output .= Form::select($this->name . '[]', $this->options, $this->values, $this->attributes);
             $output .= $this->extra_output;
             break;
         case "hidden":
             $output = Form::hidden($this->name, $this->value);
             break;
         default:
     }
     $this->output = $output;
 }
 /**
  * @return \Illuminate\Http\JsonResponse
  */
 public function renderLocationDrop()
 {
     $selected = $_REQUEST['selected'];
     $dropName = $_REQUEST['dropName'];
     $value = null;
     if ($_REQUEST['value'] != "undefined") {
         $value = $_REQUEST['value'];
     }
     $name = str_replace("parameter", "value", $dropName);
     $arrData = array();
     switch ($selected) {
         case "type":
             $arrData = config('asgard.dynamicfield.config.entity-type');
             break;
         case "template":
             $arrData = $this->template->getTemplates();
             break;
     }
     $html = FormFacade::select($name, $arrData, $value, ['class' => "form-control"]);
     return response()->json(['html' => $html]);
 }