public function setup() { parent::setup(); $plugins = $this->getSympalContext()->getSympalConfiguration()->getContentTypePlugins(); $plugins = array_combine($plugins, $plugins); $plugins = array_merge(array('' => ''), $plugins); $this->widgetSchema['plugin_name'] = new sfWidgetFormChoice(array('choices' => $plugins)); $this->widgetSchema['plugin_name']->setLabel('Plugin'); $this->widgetSchema['name']->setLabel('Model name'); $models = Doctrine_Core::loadModels(sfConfig::get('sf_lib_dir') . '/model/doctrine'); foreach ($models as $model) { $table = Doctrine_Core::getTable($model); if (!$table->hasTemplate('sfSympalContentTypeTemplate')) { unset($models[$model]); } } $models = array_merge(array('' => ''), $models); $this->widgetSchema['name'] = new sfWidgetFormChoice(array('choices' => $models)); }
public function setup() { parent::setup(); $field = sfApplicationConfiguration::getActive()->getPluginConfiguration('sfThemePlugin')->getThemeToolkit()->getThemeWidgetAndValidator(); $this->widgetSchema['theme'] = $field['widget']; $this->validatorSchema['theme'] = $field['validator']; $this->widgetSchema['name']->setLabel('Model name'); $models = Doctrine_Core::loadModels(sfConfig::get('sf_lib_dir') . '/model/doctrine'); // Sets up the template widget sfSympalFormToolkit::changeTemplateWidget($this); // Sets up the module widget sfSympalFormToolkit::changeModuleWidget($this); foreach ($models as $model) { $table = Doctrine_Core::getTable($model); if (!$table->hasTemplate('sfSympalContentTypeTemplate')) { unset($models[$model]); } } $models = array_merge(array('' => ''), $models); $this->widgetSchema['name'] = new sfWidgetFormChoice(array('choices' => $models)); }