Exemple #1
0
 public function getInput($value)
 {
     if ($value) {
         if (is_array($value)) {
             if (!empty($value['date'])) {
                 $value = sprintf('%s %02d:%02d', $value['date'], $value['hours'], $value['mins']);
             }
         }
     }
     $this->data['show_time'] = $this->getOption('show_time');
     $this->data['date'] = $value ? date(cmsConfig::getInstance()->date_format, strtotime($value)) : '';
     if ($this->data['show_time']) {
         if (!$value) {
             $this->data['hours'] = 0;
             $this->data['mins'] = 0;
         } else {
             list($this->data['hours'], $this->data['mins']) = explode(':', date('H:i', strtotime($value)));
         }
         $this->data['fname_date'] = $this->element_name . '[date]';
         $this->data['fname_hours'] = $this->element_name . '[hours]';
         $this->data['fname_mins'] = $this->element_name . '[mins]';
     } else {
         $this->data['fname_date'] = $this->element_name;
     }
     return parent::getInput($value);
 }
Exemple #2
0
 public function getFilterInput($value)
 {
     if (is_int($value)) {
         $value = $this->getCity($value);
     }
     return parent::getFilterInput($value);
 }
Exemple #3
0
 public function getInput($value)
 {
     $this->data['items'] = $this->getListItems();
     $this->data['is_multiple'] = $this->getProperty('is_multiple');
     $this->data['is_tree'] = $this->getProperty('is_tree');
     $this->data['parent'] = $this->getProperty('parent');
     $this->data['dom_attr'] = array('id' => $this->id, 'required' => array_search(array('required'), $this->getRules()) !== false);
     return parent::getInput($value);
 }
Exemple #4
0
 public function getInput($value)
 {
     $this->data['items'] = $this->getListItems();
     $this->data['is_multiple'] = $this->getProperty('is_multiple');
     $this->data['is_tree'] = $this->getProperty('is_tree');
     $this->data['parent'] = $this->getProperty('parent');
     $this->data['dom_attr'] = array('id' => $this->id);
     return parent::getInput($value);
 }
Exemple #5
0
 public function getInput($value)
 {
     $this->data['allowed_extensions'] = $this->getOption('extensions');
     $this->data['max_size_mb'] = $this->getOption('max_size_mb');
     if ($this->data['max_size_mb']) {
         $this->data['max_size_mb'] *= 1048576;
     } else {
         $this->data['max_size_mb'] = files_convert_bytes(ini_get('post_max_size'));
     }
     return parent::getInput($value);
 }
Exemple #6
0
 public function getInput($value)
 {
     $users_model = cmsCore::getModel('users');
     $items = $this->getProperty('show_all') ? array(0 => LANG_ALL) : array();
     $is_show_guests = (bool) $this->getProperty('show_guests');
     $groups = $users_model->getGroups($is_show_guests);
     foreach ($groups as $group) {
         $items[$group['id']] = $group['title'];
     }
     $this->data['groups'] = $items;
     return parent::getInput($value ? $value : array(0));
 }
Exemple #7
0
 public function getInput($value)
 {
     $this->data['show_time'] = $this->getOption('show_time');
     $this->data['date'] = $value ? date(cmsConfig::getInstance()->date_format, strtotime($value)) : '';
     if ($this->data['show_time']) {
         list($this->data['hours'], $this->data['mins']) = explode(':', date('H:i', strtotime($value)));
         $this->data['fname_date'] = $this->element_name . '[date]';
         $this->data['fname_hours'] = $this->element_name . '[hour]';
         $this->data['fname_mins'] = $this->element_name . '[min]';
     } else {
         $this->data['fname_date'] = $this->element_name;
     }
     return parent::getInput($value);
 }
Exemple #8
0
 public function getInput($value)
 {
     $location_group = $this->getOption('location_group');
     $location_type = $this->getOption('location_type');
     $this->data['items'] = $this->getListItems();
     // если поля не объеденены и это поле выбора города
     if (!$location_group && $location_type == 'cities') {
         $city_name = $this->getLocationTypeValue($value, $location_type);
         $value = array('id' => $value, 'name' => $city_name);
     }
     $this->data['location_group'] = $location_group;
     $this->data['location_type'] = $location_type;
     $this->data['dom_attr'] = array('id' => $this->id, 'data-selected' => is_array($value) ? $value['id'] : $value, 'data-type' => $location_type, 'data-child' => $location_type == 'countries' ? 'regions' : 'cities', 'data-items-url' => href_to('geo', 'get_items'));
     return parent::getInput($value);
 }
Exemple #9
0
 public function getInput($value)
 {
     $this->data['type'] = $this->getProperty('is_password') ? 'password' : 'text';
     $this->data['autocomplete'] = $this->getProperty('autocomplete');
     return parent::getInput($value);
 }
Exemple #10
0
 public function getInput($value)
 {
     $this->data['items'] = $this->getListItems();
     $this->data['selected'] = array();
     if ($value) {
         if (!is_array($value)) {
             $pos = 0;
             foreach ($this->data['items'] as $key => $title) {
                 if (mb_substr($value, $pos, 1) == 1) {
                     $this->data['selected'][] = $key;
                 }
                 $pos++;
                 if ($pos + 1 > mb_strlen($value)) {
                     break;
                 }
             }
         } else {
             $this->data['selected'] = $value;
         }
     }
     return parent::getInput($value);
 }
Exemple #11
0
 public function getInput($value)
 {
     $this->data['images'] = false;
     if ($value) {
         $this->data['images'] = is_array($value) ? $value : cmsModel::yamlToArray($value);
     }
     $this->data['sizes'] = $this->getOption('sizes');
     $this->data['images_controller'] = cmsCore::getController('images');
     return parent::getInput($value);
 }
Exemple #12
0
 public function getInput($value)
 {
     $this->data['items'] = ($this->getProperty('show_all') ? array(0 => LANG_ALL) : array()) + $this->getListItems();
     return parent::getInput($value ? $value : array(0));
 }
Exemple #13
0
 public function getInput($value)
 {
     $this->data['units'] = $this->getProperty('units') ?: $this->getOption('units');
     return parent::getInput($value);
 }
Exemple #14
0
 public function getInput($value)
 {
     $this->data['date'] = $value ? date(cmsConfig::getInstance()->date_format, strtotime($value)) : '';
     return parent::getInput($value);
 }