コード例 #1
0
 public function setup()
 {
     parent::setup();
     $this->widgetSchema['is_indexable'] = new sfWidgetFormChoice(array('choices' => array(0 => 'noindex', 1 => 'index'), 'expanded' => false));
     $this->widgetSchema['is_followable'] = new sfWidgetFormChoice(array('choices' => array(0 => 'nofollow', 1 => 'follow'), 'expanded' => false));
     $this->widgetSchema->setLabels(array('is_indexable' => 'Index', 'is_followable' => 'Follow'));
     $this->setValidator['keywords'] = new sfValidatorString(array('max_length' => 195, 'required' => false), array('max_length' => 'Le texte est trop long. Il faut %max_length% caractères maximums.'));
     $this->setValidator['keywords'] = new sfValidatorString(array('max_length' => 255, 'required' => false), array('max_length' => 'Le texte est trop long. Il faut %max_length% caractères maximums.'));
     unset($this['id']);
 }
コード例 #2
0
 public function setup()
 {
     parent::setup();
     unset($this['id']);
     $this->widgetSchema['is_indexable'] = new sfWidgetFormChoice(array('choices' => array(0 => 'noindex', 1 => 'index'), 'expanded' => false));
     $this->widgetSchema['is_followable'] = new sfWidgetFormChoice(array('choices' => array(0 => 'nofollow', 1 => 'follow'), 'expanded' => false));
     $this->widgetSchema->setLabels(array('is_indexable' => 'Index', 'is_followable' => 'Follow'));
     $this->widgetSchema->setFormFormatterName('div');
     /* Construction des langues du site */
     $lang = unserialize(peanutConfig::get('lang'));
     $default = array();
     if ($lang['lang']) {
         foreach ($lang['lang'] as $key => $value) {
             $default[$key] = strtolower($value);
         }
         $this->embedI18n($default);
         foreach ($default as $lang) {
             $this->widgetSchema->setLabel($lang, 'language-' . $lang);
         }
     } else {
         $this->embedI18n(array('fr'));
         $this->widgetSchema->setLabel('fr', 'Français');
     }
 }