Vous pouvez commenter/noter en utilisant le compte
anonymous (mot de passe:
anonymous)
You can comment/rate using the
anonymous account (password:
anonymous).
Snippets taggés : "labels"
<?php
/**
* Form to add a classified ad.
*
* @author loic.vernet
* @since 7 august 08
*
* @package form
*/
class qbNewThreadForm extends qbThreadForm
{
// Default mask to create fields names
public static $main_fields_name = 'qb_thread';
// Default labels
protected $labels = array(
// Thread
'title' => 'Sujet',
'category_id' => 'Forum',
// Contact form
'qb_post' => 'Post',
);
// Default fields to keep
protected $fields_to_keep = array(
// Thread
'id',
'category_id',
// Post
'qb_post',
);
// Liste of field that can't be modified by direct input values
protected static $protected_fields = array(
);
/**
* Configuration of form.
*/
public function configure()
{
// Build widgets
$this->setWidgetOptions();
// Set wdigets
$this->processWidgets();
// Set validators
$this->processValidators();
// Embed other forms
$this->embedForms();
}
/**
* Set generic options for widgets.
*
* @author loic.vernet
* @since
*/
protected function setWidgetOptions()
{
// name format
$this->widgetSchema->setNameFormat(self::$main_fields_name. '[%s]');
// Set labels
$this->setLabels($this->labels);
// Allow extra fields for all forms
$this->allowExtraFields();
}
/**
* set all widgets.
*
* @author loic.vernet
* @since
*/
public function processWidgets()
{
$this->removeAllFieldsExcept($this->fields_to_keep);
$this->widgetSchema['category_id'] = new sfWidgetFormPropelSelect(
array(
'model' => 'qbCategory',
'add_empty' => false,
//'criteria' => ipAdBasePeer::getCategoriesCriteria()
));
$this->widgetSchema['title'] = new sfWidgetFormInput();
}
/**
* Set all validators.
*
* @author loic.vernet
* @since
*/
public function processValidators()
{
$this->validatorSchema['category_id'] = new sfValidatorString(
array('required' => true),
array('required' => 'Veuillez choisir un forum')
);
$this->validatorSchema['title'] = new sfValidatorString(
array('required' => true),
array('required' => 'Veuillez choisir un titre pour le sujet')
);
}
/**
* Embed other forms to the current form.
*
* @author loic.vernet
* @since
*/
protected function embedForms()
{
}
}