public function configure()
 {
     $defaults = opSkinClassicConfig::getDefaults();
     $list = array();
     foreach ($defaults as $k => $v) {
         $list[$k] = $v['caption'];
     }
     $this->setWidget('theme', new sfWidgetFormSelect(array('choices' => $list)));
     $this->setValidator('theme', new sfValidatorChoice(array('choices' => array_keys($list))));
     $this->setDefault('theme', opSkinClassicConfig::getCurrentTheme());
     $this->widgetSchema->setNameFormat('preset[%s]');
 }
 public static function cacheCss($event, $content)
 {
     $lastEntry = sfContext::getInstance()->getActionStack()->getLastEntry();
     if (!$lastEntry) {
         return $content;
     }
     if ('opSkinClassicPlugin' === $lastEntry->getModuleName() && 'css' === $lastEntry->getActionName()) {
         $filesystem = new sfFilesystem();
         $dir = sfConfig::get('sf_web_dir') . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'css';
         @$filesystem->mkdirs($dir);
         file_put_contents($dir . DIRECTORY_SEPARATOR . opSkinClassicConfig::getCurrentTheme() . '.css', $content);
     }
     return $content;
 }