public function set($value) { if (is_array($value)) { $delimiter = $this->data['delimiter'] ? $this->data['delimiter'] : ','; $value = implode($delimiter, $value); } return parent::set($value); }
public function render($values = array()) { if (empty($values)) { $values = array(0 => 'Нет', 1 => 'Да'); } $v = parent::render(); return $values[$v]; }
public function render() { if (!$this->type->access($this->name, $this->data, 'container_render', $this->item, $this)) { return ''; } $values = $this->value(); if (!is_array($values)) { return parent::render(); } return $values[CMS::site_lang()]; }
public function render() { $data = $this->data; $value = parent::value(); return CMS_Fields_Types_DateStr::format_date($value, $data); }
public function render($force_format = false) { $data = $this->data; $value = parent::value(); if (empty($value)) { return ''; } if (!isset($data['valid1970']) && CMS::date('Ymd', $value) == '19700101') { return ''; } if (isset($data['format'])) { $format = $data['format']; } if ($force_format) { $format = $force_format; } if (empty($format)) { $format = 'd.m.Y'; if (isset($data['with_time']) && $data['with_time']) { $format = 'd.m.Y - H:i'; } if (isset($data['with_seconds']) && $data['with_seconds']) { $format = 'd.m.Y - H:i:s'; } } $value = CMS::date($format, $value); return $value; }
public function remove($file = false) { $this->type->remove_existed_file($this->item, $this->name, $file); return parent::set(''); }
public function __construct($name, $data, $item, $type) { parent::__construct($name, $data, $item, $type); $this->lazy_parms['0gif'] = CMS::stdfile_url('images/0.gif'); }
public function has_spliter() { $spliter = $this->get_spliter(); if ($spliter) { return (bool) strpos(parent::value(), $spliter); } return false; }
public function set($value) { if (IO_FS::exists($value)) { $ext = ''; if ($m = Core_Regexps::match_with_results('{\\.([^\\.]+)$}', $value)) { $ext = strtolower(trim($m[1])); } $filename = $this->type->uploaded_file_name($this->name, $this->data, $this->item, $ext); $dir = $this->type->uploaded_file_dir($this->name, $this->data, $this->item); if ($dir) { if (!IO_FS::exists($dir)) { CMS::mkdirs($dir); } $_dir = preg_replace('{^\\./}', '', $dir); copy($value, "{$dir}/{$filename}"); IO_FS::rm($uploaded); $value = "{$_dir}/{$filename}"; return parent::set($value); } } return $this; }