Example #1
0
 public function executeSkinList(sfWebRequest $request)
 {
     $this->forms = array();
     $images = array_merge(opSkinClassicConfig::getImages(), opSkinClassicConfig::getThemeImages());
     foreach ($images as $v) {
         $this->forms[$v] = new opSkinClassicImageForm(array(), array('target' => $v));
     }
 }
 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();
 }