public function __construct($options = array(), $attributes = array())
 {
     parent::__construct($options, $attributes);
     sfProjectConfiguration::getActive()->loadHelpers('Asset');
     foreach (self::$extensions as $extension) {
         if (!self::$isConfiguredTinyMCE) {
             self::$plugins = array_merge(self::$plugins, call_user_func(array($extension, 'getPlugins')));
             self::$buttons = array_merge_recursive(self::$buttons, call_user_func(array($extension, 'getButtons')));
             self::$buttonOnclickActions = array_merge(self::$buttonOnclickActions, call_user_func(array($extension, 'getButtonOnClickActions')));
             self::$convertCallbackList = array_merge(self::$convertCallbackList, call_user_func(array($extension, 'getConvertCallbacks')));
             self::$htmlConvertList = array_merge(self::$htmlConvertList, call_user_func(array($extension, 'getHtmlConverts')));
         }
         call_user_func_array(array($extension, 'configure'), array(&$this->tinyMCEConfigs));
     }
     if (!empty($this->tinyMCEConfigs['plugins'])) {
         $this->tinyMCEConfigs['plugins'] .= ',';
     }
     $plugins = array();
     foreach (self::$plugins as $name => $path) {
         if (is_numeric($name)) {
             $plugins[] = $path;
         } else {
             $plugins[] = '-' . $name;
             $this->loadPluginList[$name] = $path;
         }
     }
     $this->tinyMCEConfigs['plugins'] .= implode(',', $plugins);
     if (!empty($this->tinyMCEConfigs['theme_advanced_buttons1'])) {
         $this->tinyMCEConfigs['theme_advanced_buttons1'] .= ',';
     }
     $buttons = array();
     foreach (self::$buttons as $key => $button) {
         if (is_numeric($key)) {
             $buttons[] = $button;
         } else {
             $buttons[] = $key;
         }
     }
     $this->tinyMCEConfigs['theme_advanced_buttons1'] .= implode(',', $buttons);
     self::$isConfiguredTinyMCE = true;
 }
 public function __construct($options = array(), $attributes = array())
 {
     sfProjectConfiguration::getActive()->loadHelpers('Asset');
     parent::__construct($options, $attributes);
     if (!isset($options['is_textmode'])) {
         if (Doctrine::getTable('SnsConfig')->get('richtextarea_default_mode', 'text') === 'preview') {
             $this->setOption('is_textmode', false);
         }
     }
     foreach (self::$extensions as $extension) {
         if (!self::$isConfiguredTinyMCE) {
             self::$plugins = array_merge(self::$plugins, call_user_func(array($extension, 'getPlugins')));
             self::$buttons = array_merge_recursive(self::$buttons, call_user_func(array($extension, 'getButtons')));
             self::$buttonOnclickActions = array_merge(self::$buttonOnclickActions, call_user_func(array($extension, 'getButtonOnClickActions')));
             self::$convertCallbackList = array_merge(self::$convertCallbackList, call_user_func(array($extension, 'getConvertCallbacks')));
             self::$htmlConvertList = array_merge(self::$htmlConvertList, call_user_func(array($extension, 'getHtmlConverts')));
         }
     }
     if (!empty($this->tinyMCEConfigs['plugins'])) {
         $this->tinyMCEConfigs['plugins'] .= ',';
     }
     $plugins = array();
     foreach (self::$plugins as $name => $path) {
         if (is_numeric($name)) {
             $plugins[] = $path;
         } else {
             $plugins[] = '-' . $name;
             $this->loadPluginList[$name] = $path;
         }
     }
     $this->tinyMCEConfigs['plugins'] .= implode(',', $plugins);
     if (!empty($this->tinyMCEConfigs['theme_advanced_buttons1'])) {
         $this->tinyMCEConfigs['theme_advanced_buttons1'] .= ',';
     }
     $this->tinyMCEConfigs['theme_advanced_buttons1'] .= implode(',', array_keys(self::getButtons()));
     foreach (self::$extensions as $extension) {
         call_user_func_array(array($extension, 'configure'), array(&$this->tinyMCEConfigs));
     }
     self::$isConfiguredTinyMCE = true;
 }