Example #1
0
 public function input()
 {
     $input = new Brick('input', null);
     $input->addClass('input');
     $input->attr(array('type' => $this->type(), 'value' => '', 'required' => $this->required(), 'name' => $this->name(), 'autocomplete' => $this->autocomplete() === false ? 'off' : 'on', 'autofocus' => $this->autofocus(), 'placeholder' => $this->i18n($this->placeholder()), 'readonly' => $this->readonly(), 'disabled' => $this->disabled(), 'id' => $this->id()));
     if (!is_array($this->value())) {
         $input->val(html($this->value(), false));
     }
     if ($this->readonly()) {
         $input->attr('tabindex', '-1');
         $input->addClass('input-is-readonly');
     }
     return $input;
 }
 public function inputField($value)
 {
     $site = site();
     $input = new Brick('input', null);
     $input->addClass('input');
     $input->attr(array('type' => $this->type(), 'value' => $value, 'required' => $this->required(), 'name' => $this->name() . '[]', 'autocomplete' => $this->autocomplete() === false ? 'off' : 'on', 'autofocus' => $this->autofocus(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled(), 'id' => $this->id()));
     if (!is_array($value)) {
         $input->val(html($value, false));
     }
     if ($this->readonly()) {
         $input->attr('tabindex', '-1');
         $input->addClass('input-is-readonly');
     }
     // Content page doesn't exist anymore?
     if (!($contentPage = $this->page()->find($value))) {
         return FALSE;
     }
     // Show input field as hidden to keep data on page save/update
     $input->addClass('hidden');
     // Show list of content pages
     $input .= '<div><a href="' . url('panel/pages/' . $contentPage->uri() . '/edit') . '" class="input input-is-readonly">' . $contentPage->title()->kt() . '</a></div>';
     return $input;
 }
Example #3
0
 private function input_lng()
 {
     # Wrapper
     $lng_content = new Brick('div');
     $lng_content->addClass('field-content field-lng');
     # Input (Locked: We use the map UI to update these)
     $lng_input = new Brick('input');
     $lng_input->attr('tabindex', '-1');
     $lng_input->attr('readonly', true);
     $lng_input->addClass('input input-split-right input-is-readonly place-lng');
     $lng_input->attr('placeholder', l::get('fields.place.longitude', 'Longitude'));
     $lng_input->val($this->pick('lng'));
     # Combine & Ship It
     $lng_content->append($lng_input);
     return $lng_content;
 }