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 set($value) { $this->data['multilang'] = true; $langs = $this->type->data_langs($this->data); if (!$langs) { return parent::set($value); } foreach ($langs as $lang => $ldata) { $this->item->{"{$this->name}_{$lang}"} = $value[$lang]; } return $this; }
public function remove($file = false) { $this->type->remove_existed_file($this->item, $this->name, $file); return parent::set(''); }
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; }