示例#1
0
 public function __construct(array $attributes = array())
 {
     global $core;
     $user = $core->user;
     $is_member = !$user->is_guest;
     $values = array();
     if ($is_member) {
         $values[Comment::AUTHOR] = $user->name;
         $values[Comment::AUTHOR_EMAIL] = $user->email;
     }
     parent::__construct(\ICanBoogie\array_merge_recursive($attributes, array(Form::RENDERER => 'Simple', Form::VALUES => $values, Form::HIDDENS => array(Operation::DESTINATION => 'comments', Operation::NAME => 'save'), Element::CHILDREN => array(Comment::AUTHOR => new Text(array(Element::LABEL => 'Name', Element::REQUIRED => true)), Comment::AUTHOR_EMAIL => new Text(array(Element::LABEL => 'E-mail', Element::REQUIRED => true, Element::VALIDATOR => array('Brickrouge\\Form::validate_email'))), Comment::AUTHOR_URL => new Text(array(Element::LABEL => 'Website')), Comment::CONTENTS => new Element('textarea', array(Element::REQUIRED => true, Element::LABEL_MISSING => 'Message', 'class' => 'span6', 'rows' => 8)), Comment::NOTIFY => new Element(Element::TYPE_RADIO_GROUP, array(Form::LABEL => "Shouhaitez-vous être informé d'une réponse à votre message ?", Element::OPTIONS => array('yes' => "Bien sûr !", 'author' => "Seulement si c'est l'auteur du billet qui répond.", 'no' => "Pas la peine, je viens tous les jours."), Element::DEFAULT_VALUE => 'no', 'class' => 'inputs-list'))), Element::WIDGET_CONSTRUCTOR => 'SubmitComment', 'action' => '#view-comments-submit', 'class' => 'widget-submit-comment')), 'div');
 }
 public function __construct($tags, $dummy = null)
 {
     parent::__construct(\ICanBoogie\array_merge_recursive($tags, array(self::RENDERER => 'Simple', Element::CHILDREN => array('email' => new Text(array(Element::LABEL => 'Votre e-mail', Element::REQUIRED => true, Element::VALIDATOR => array('Brickrouge\\Form::validate_email'))), 'message' => new Element('textarea', array(self::LABEL_MISSING => 'Message', Element::REQUIRED => true))))));
 }
示例#3
0
 public function __construct(array $attribute = [])
 {
     parent::__construct($attribute + [Form::ACTIONS => [new Button("Edit", ['class' => 'btn-primary', 'type' => 'submit'])], Form::HIDDENS => [Operation::DESTINATION => 'posts', Operation::NAME => 'save'], Form::RENDERER => "Group", Element::GROUPS => ['primary' => [Element::WEIGHT => 'bottom', 'class' => 'form-group'], 'row1' => new ColumnedGroup([ColumnedGroup::COLUMNS => 2, 'class' => 'form-group']), 'row2' => new ColumnedGroup([ColumnedGroup::COLUMNS => 2, 'class' => 'form-group'])], Element::CHILDREN => ['name' => new Text([Group::LABEL => "Name", Element::REQUIRED => true, Element::GROUP => 'row1', 'class' => 'form-control']), 'slug' => new Text([Group::LABEL => "Slug", Element::GROUP => 'row1', 'class' => 'form-control']), 'category_id' => new Element('select', [Group::LABEL => "Category", Element::OPTIONS => [null => ''] + $this->app->models['categories']->select('id, name')->order('name')->pairs, Element::REQUIRED => true, Element::GROUP => 'row2', 'class' => 'form-control']), 'user_id' => new Element('select', [Group::LABEL => "Author", Element::OPTIONS => [null => ''] + $this->app->models['users']->select('id, username')->order('username')->pairs, Element::REQUIRED => true, Element::GROUP => 'row2', 'class' => 'form-control']), 'content' => new Element('textarea', [Group::LABEL => "Content", Element::REQUIRED => true, 'class' => 'form-control'])]]);
 }
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes + array(Form::ACTIONS => new Button('Send', array('type' => 'submit', 'class' => 'btn-warning')), Form::RENDERER => 'Simple', Form::HIDDENS => array(Operation::DESTINATION => 'users.noncelogin', Operation::NAME => 'nonce-login-request'), Element::CHILDREN => array('email' => new Text(array(Form::LABEL => 'your_email', Element::REQUIRED => true))), Element::WIDGET_CONSTRUCTOR => 'NonceRequest', 'class' => 'widget-nonce-request', 'name' => 'users/nonce-request'));
 }
示例#5
0
 public function __construct(Module $module, array $attributes = [])
 {
     parent::__construct($attributes + [Form::HIDDENS => [Operation::DESTINATION => $module->id, Operation::NAME => 'export'], Form::ACTIONS => new Button('Export', ['class' => 'btn-primary', 'type' => 'submit']), 'class' => 'form-primary']);
 }
示例#6
0
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes + [Form::ACTIONS => [new Button("Sign in", ['class' => "btn-primary btn-lg btn-block", 'type' => 'submit'])], Form::HIDDENS => [Operation::DESTINATION => 'users', Operation::NAME => 'sign-in'], Element::CHILDREN => [new Element('h4', [Element::INNER_HTML => "Please sign in", 'class' => "form-signin-heading"]), 'username' => new Text([Element::REQUIRED => true, 'autofocus' => true, 'class' => 'form-control', 'placeholder' => 'User name']), 'password' => new Text([Element::REQUIRED => true, 'class' => 'form-control', 'placeholder' => 'Password', 'type' => 'password'])], 'class' => 'form-signin', 'name' => 'users/signin']);
 }
示例#7
0
 public function __construct(array $attributes = [])
 {
     global $core;
     $this->lost_password = new A(I18n\t('lost_password', [], ['scope' => 'users.label', 'default' => 'I forgot my password']), "#lost-password", ['rel' => 'nonce-request']);
     parent::__construct($attributes + [Form::ACTIONS => [new Button('Connect', ['type' => 'submit', 'class' => 'btn-primary'])], Form::RENDERER => 'Simple', Form::HIDDENS => [Operation::DESTINATION => 'users', Operation::NAME => Module::OPERATION_LOGIN, Operation::SESSION_TOKEN => $core->session->token, 'redirect_to' => $core->request['redirect_to']], Element::CHILDREN => [User::USERNAME => new Text([Form::LABEL => 'username', Element::REQUIRED => true, 'autofocus' => true]), User::PASSWORD => new Text([Form::LABEL => 'password', Element::REQUIRED => true, Element::DESCRIPTION => $this->lost_password, 'type' => 'password'])], Element::WIDGET_CONSTRUCTOR => 'Login', 'class' => 'widget-login', 'name' => 'users/login']);
 }
示例#8
0
 public function __construct(array $attributes = array())
 {
     parent::__construct(\ICanBoogie\array_merge_recursive($attributes, array(self::RENDERER => 'Simple', Element::CHILDREN => array('gender' => new Element(Element::TYPE_RADIO_GROUP, array(self::LABEL => 'Salutation', Element::OPTIONS => array('salutation.Misses', 'salutation.Mister'), Element::REQUIRED => true, 'class' => 'inline-inputs')), 'firstname' => new Text(array(self::LABEL => 'Firstname', Element::REQUIRED => true)), 'lastname' => new Text(array(self::LABEL => 'Lastname', Element::REQUIRED => true)), 'company' => new Text(array(self::LABEL => 'Company')), 'email' => new Text(array(self::LABEL => 'E-mail', Element::REQUIRED => true, Element::VALIDATOR => array('Brickrouge\\Form::validate_email'))), 'message' => new Element('textarea', array(self::LABEL => 'Your message', Element::REQUIRED => true))))), 'div');
 }
 public function __construct($tags, $dummy = null)
 {
     parent::__construct(\ICanBoogie\array_merge_recursive($tags, array(Element::CHILDREN => array('gender' => new Element(Element::TYPE_RADIO_GROUP, array(self::LABEL => 'Gender', Element::OPTIONS => array('salutation.misses', 'salutation.miss', 'salutation.mister'), Element::REQUIRED => true)), 'lastname' => new Text(array(self::LABEL => 'Lastname', Element::REQUIRED => true)), 'firstname' => new Text(array(self::LABEL => 'Firstname', Element::REQUIRED => true)), 'media' => new Text(array(self::LABEL => 'Média')), 'email' => new Text(array(self::LABEL => 'E-Mail', Element::REQUIRED => true, Element::VALIDATOR => array('Brickrouge\\Form::validate_email'))), 'subject' => new Text(array(self::LABEL => 'Subject', Element::REQUIRED => true)), 'message' => new Element('textarea', array(self::LABEL => 'Your message'))))));
 }
示例#10
0
 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes + [Form::HIDDENS => [Operation::DESTINATION => 'comments', Operation::NAME => 'submit', 'post_id' => empty($attributes[self::POST_ID]) ? null : $attributes[self::POST_ID]], Form::ACTIONS => [new Button("Submit", ['class' => 'btn-primary', 'type' => 'submit'])], Element::CHILDREN => ['mail' => new Text([Element::REQUIRED => true, Element::VALIDATOR => ['Brickrouge\\Form::validate_email'], 'class' => 'form-control', 'placeholder' => "Your email", 'type' => 'email']), 'username' => new Text([Element::REQUIRED => true, 'class' => 'form-control', 'placeholder' => "Your name", 'size' => 50]), 'content' => new Element('textarea', [Element::REQUIRED => true, 'class' => 'form-control', 'placeholder' => "Your comment", 'rows' => 3])], 'name' => 'comments/submit']);
 }
示例#11
0
 public function __construct(array $attributes = array())
 {
     parent::__construct($attributes + array(Form::ACTIONS => new Button("Continue", array('class' => 'btn btn-primary', 'type' => 'submit')), Form::RENDERER => 'Simple', 'method' => Request::METHOD_PATCH, 'class' => 'form-horizontal'));
 }