public function save() { foreach ($this->getValues() as $k => $v) { opSkinClassicConfig::set($k, $v); } opToolkit::clearCache(); }
public function save() { $target = $this->getOption('target'); $rawConfig = Doctrine::getTable('SkinConfig')->retrieveByPluginAndName('opSkinClassicPlugin', $target . '_image'); if ($rawConfig) { $file = Doctrine::getTable('File')->findOneByName($rawConfig->value); if ($file) { $file->delete(); } } $file = new File(); $file->setFromValidatedFile($this->getValue('image')); $file->save(); opSkinClassicConfig::set($target . '_image', $file->name); opToolkit::clearCache(); }
public function save() { opSkinClassicConfig::set('theme', $this->getValue('theme')); foreach (opSkinClassicConfig::getAllowdColors() as $k) { opSkinClassicConfig::delete($k); } $configs = array_merge(opSkinClassicConfig::getImages(), opSkinClassicConfig::getThemeImages()); foreach ($configs as $k) { $key = $k . '_image'; $rawConfig = Doctrine::getTable('SkinConfig')->retrieveByPluginAndName('opSkinClassicPlugin', $key); if ($rawConfig) { $file = Doctrine::getTable('File')->findOneByName($rawConfig->value); if ($file) { $file->delete(); } } opSkinClassicConfig::delete($key); } opToolkit::clearCache(); }