Exemplo n.º 1
0
 /**
  * DOCUMENT ME
  * @param mixed $field
  * @return mixed
  */
 public function renderField($field)
 {
     if ($field->getType() == 'Category') {
         return sprintf('$helper->getCount(\'%s\', $a_category->id)', $field->getName());
     } else {
         return parent::renderField($field);
     }
 }
Exemplo n.º 2
0
 /**
  * DOCUMENT ME
  * @param mixed $field
  * @return mixed
  */
 public function renderField($field)
 {
     if (preg_match('/^tag_/', $field->getName())) {
         $parts = preg_split('/^tag_/', $field->getName());
         return sprintf('$%s->%sCount', $this->getSingularName(), $parts[1]);
     } else {
         return parent::renderField($field);
     }
 }
 /**
  * Returns the configuration for fields in a given context.
  *
  * @param  string $context The Context
  *
  * @return array An array of configuration for all the fields in a given context
  */
 public function getFieldsConfiguration($context)
 {
     $fields = array();
     $i18n_fields = $this->getTranslationFields();
     foreach ($i18n_fields as $i18n_field) {
         if (isset($this->config[$context]['fields'])) {
             foreach ($this->config[$context]['fields'] as $name => $params) {
                 if (!array_key_exists($name, $this->config[$context]['fields'])) {
                     $this->config[$context]['fields'][$i18n_field] = is_array($params) ? $params : array();
                     $fields[$name] = $this->config[$context]['fields'][$i18n_field];
                 }
             }
         }
     }
     $fields = array_merge($fields, parent::getFieldsConfiguration($context));
     return $fields;
 }
Exemplo n.º 4
0
 /**
  * Configures this generator.
  */
 public function configure()
 {
     parent::configure();
     $this->generatorManager->getConfiguration()->getEventDispatcher()->notify(new sfEvent($this, 'dm.admin_generator.post_configure', array('table' => $this->table)));
 }
 public function initialize(sfGeneratorManager $generatorManager)
 {
     parent::initialize($generatorManager);
     $this->setGeneratorClass('sfRestPlugin');
 }
Exemplo n.º 6
0
 public function addCredentialCondition($content, $params = array(), $action = null)
 {
     if (null === $action) {
         return parent::addCredentialCondition($content, $params);
     }
 }