/**
  * Creates a new AllianceAdministrationForm object.
  */
 public function __construct()
 {
     if (!defined('DO_NOT_PARSE_ALLIANCE_TEXTS')) {
         define('DO_NOT_PARSE_ALLIANCE_TEXTS', true);
     }
     parent::__construct();
 }
Exemplo n.º 2
0
 /**
  * Creates a new LoginForm object.
  */
 public function __construct()
 {
     if (WCF::getUser()->userID) {
         throw new PermissionDeniedException();
     }
     parent::__construct();
 }
Exemplo n.º 3
0
 public function __construct(Smarty $smarty, Context $context, TranslatorInterface $translator, CustomerFormatter $formatter, CustomerPersister $customerPersister, array $urls)
 {
     parent::__construct($smarty, $translator, $formatter);
     $this->context = $context;
     $this->urls = $urls;
     $this->customerPersister = $customerPersister;
 }
Exemplo n.º 4
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string         $action
  * @param  string         $method
  * @param  int            $tid
  * @param  boolean        $profile
  * @param  int            $uid
  * @param \Phire\Auth\Acl $acl
  * @param  boolean        $register
  * @return self
  */
 public function __construct($action = null, $method = 'post', $tid = 0, $profile = false, $uid = 0, $acl = null, $register = false)
 {
     parent::__construct($action, $method, null, '        ');
     // Create user type fields/form first
     if ($tid == 0) {
         $typesAry = array();
         $types = Table\UserTypes::findAll('id ASC');
         foreach ($types->rows as $type) {
             if ($acl->isAuth('Phire\\Controller\\Phire\\User\\IndexController', 'add_' . $type->id)) {
                 $typesAry[$type->id] = $type->type;
             }
         }
         $this->initFieldsValues = array('type_id' => array('type' => 'select', 'required' => true, 'label' => $this->i18n->__('Select User Type'), 'value' => $typesAry, 'attributes' => array('style' => 'margin: 0 10px 0 0; padding: 6px 5px 7px 5px; height: 32px;')), 'submit' => array('type' => 'submit', 'value' => $this->i18n->__('SELECT'), 'attributes' => array('class' => 'save-btn', 'style' => 'margin: 0; padding: 5px 6px 6px 6px; width: 100px; height: 32px;')));
         $id = 'user-select-form';
         // Else, create initial user fields
     } else {
         $this->initFieldsValues = $this->getInitFields($tid, $profile, $uid, $action, $register);
         if (strpos($action, '/install/user') !== false) {
             $id = 'user-install-form';
         } else {
             if ($profile) {
                 $id = 'user-install-form';
             } else {
                 $id = 'user-form';
             }
         }
     }
     $this->setAttributes('id', $id);
 }
Exemplo n.º 5
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @param  int    $sid
  * @return self
  */
 public function __construct($action = null, $method = 'post', $sid = 0)
 {
     parent::__construct($action, $method, null, '        ');
     $fieldGroups = array();
     $dynamicFields = false;
     $model = str_replace('Form', 'Model', get_class($this));
     $newFields = \Phire\Model\Field::getByModel($model, 0, $sid);
     if ($newFields['dynamic']) {
         $dynamicFields = true;
     }
     if ($newFields['hasFile']) {
         $this->hasFile = true;
     }
     foreach ($newFields as $key => $value) {
         if (is_numeric($key)) {
             $fieldGroups[] = $value;
         }
     }
     $fields1 = array('title' => array('type' => 'text', 'label' => $this->i18n->__('Title'), 'required' => true, 'attributes' => array('size' => 80)), 'domain' => array('type' => 'text', 'label' => $this->i18n->__('Domain'), 'required' => true, 'attributes' => array('size' => 80)), 'document_root' => array('type' => 'text', 'label' => $this->i18n->__('Document Root'), 'required' => true, 'attributes' => array('size' => 80)), 'base_path' => array('type' => 'text', 'label' => $this->i18n->__('Base Path'), 'attributes' => array('size' => 80)));
     if ($sid != 0) {
         $fields1['domain']['attributes']['onkeyup'] = "phire.updateTitle('#site-header-title', this);";
     }
     $fields2 = array('submit' => array('type' => 'submit', 'value' => $this->i18n->__('SAVE'), 'attributes' => array('class' => 'save-btn')), 'update' => array('type' => 'button', 'value' => $this->i18n->__('UPDATE'), 'attributes' => array('onclick' => "return phire.updateForm('#site-form', " . ($this->hasFile || $dynamicFields ? 'true' : 'false') . ");", 'class' => 'update-btn')), 'force_ssl' => array('type' => 'radio', 'label' => $this->i18n->__('Force SSL'), 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '0'), 'live' => array('type' => 'radio', 'label' => $this->i18n->__('Live'), 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '1'), 'id' => array('type' => 'hidden', 'value' => 0), 'update_value' => array('type' => 'hidden', 'value' => 0));
     $allFields = array($fields2);
     if (count($fieldGroups) > 0) {
         foreach ($fieldGroups as $fg) {
             $allFields[] = $fg;
         }
     }
     $allFields[] = $fields1;
     $this->initFieldsValues = $allFields;
     $this->setAttributes('id', 'site-form');
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     $this->compact = true;
     $this->labelWidth = 4;
     $this->controlWidth = 8;
     $this->addText('domain_name', 'Domain Name')->addText('domain_name_short', 'Short Domain Name')->addText('domain_controller', 'Domain Controller')->addText('ldap_port', 'LDAP Port Number')->addText('user', 'Username')->addPassword('password', 'Password')->addText('use_start_tls', 'Use Start TLS')->addText('baseDn', 'Base DN')->addButton('submit', 'Submit', 'btn-primary');
 }
Exemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'spec_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'label', 'options' => array('label' => 'Label')));
     $this->add(array('name' => 'value', 'options' => array('label' => 'Value')));
 }
Exemplo n.º 8
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'document_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'label', 'options' => array('label' => 'Label')));
     $this->add(array('name' => 'file_name', 'options' => array('label' => 'FileName')));
 }
Exemplo n.º 9
0
 public function __construct()
 {
     parent::__construct();
     $this->labelWidth = 3;
     $this->controlWidth = 9;
     $this->compact = true;
     $this->addText('name', 'Name')->addText('host', 'Hostname')->addText('port', 'Port')->addText('ssl', 'SSL')->addText('username', 'Username')->addPassword('password', 'Password')->addButton('submit', 'Submit', 'btn-primary');
 }
Exemplo n.º 10
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'option_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'choice_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'override_name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
 }
Exemplo n.º 11
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @return self
  */
 public function __construct($action = null, $method = 'post')
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = array('name' => array('type' => 'text', 'label' => $this->i18n->__('Name & Order'), 'required' => true, 'attributes' => array('size' => 40, 'style' => 'width: 376px;')), 'order' => array('type' => 'text', 'attributes' => array('size' => 3), 'value' => 0), 'dynamic' => array('type' => 'radio', 'label' => $this->i18n->__('Dynamic') . '?', 'value' => array('0' => $this->i18n->__('No'), '1' => $this->i18n->__('Yes')), 'marked' => '0'), 'id' => array('type' => 'hidden', 'value' => 0), 'update_value' => array('type' => 'hidden', 'value' => 0), 'submit' => array('type' => 'submit', 'label' => ' ', 'value' => $this->i18n->__('SAVE'), 'attributes' => array('class' => 'save-btn', 'style' => 'width: 190px;')), 'update' => array('type' => 'button', 'value' => $this->i18n->__('UPDATE'), 'attributes' => array('onclick' => "return phire.updateForm('#field-group-form', false);", 'class' => 'update-btn', 'style' => 'width: 190px;')));
     if (strpos($_SERVER['REQUEST_URI'], '/edit/') !== false) {
         $this->initFieldsValues['name']['attributes']['onkeyup'] = "phire.updateTitle('#field-group-title', this);";
     }
     $this->setAttributes('id', 'field-group-form');
 }
Exemplo n.º 12
0
 public function __construct(Smarty $smarty, Context $context, TranslatorInterface $translator, CustomerLoginFormatter $formatter, array $urls)
 {
     parent::__construct($smarty, $translator, $formatter);
     $this->context = $context;
     $this->translator = $translator;
     $this->formatter = $formatter;
     $this->urls = $urls;
     $this->constraintTranslator = new ValidateConstraintTranslator($this->translator);
 }
Exemplo n.º 13
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'quantity', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Quantity')));
     $this->add(array('name' => 'price', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Price')));
     $this->add(array('name' => 'retail', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Retail')));
     $this->add(array('name' => 'enabled', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('type' => 'select', 'options' => array(1 => 'Yes', 0 => 'No')), 'options' => array('label' => 'Enabled')));
 }
Exemplo n.º 14
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
     $this->add(array('name' => 'description', 'attributes' => array('type' => 'textarea'), 'options' => array('label' => 'Description')));
     $this->add(array('name' => 'item_number', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Item Number')));
     $this->add(array('name' => 'product_type_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('type' => 'select', 'options' => array('1' => 'Shell', '2' => 'Product')), 'options' => array('label' => 'Product Type')));
 }
Exemplo n.º 15
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'uom_code', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'quantity', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'distributor_item_number', 'attributes' => array('type' => 'text', 'class' => 'span1'), 'options' => array('label' => 'Dist Item#')));
     $this->add(array('name' => 'distributor_uom_code', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Dist UOM')));
     $this->add(array('name' => 'cost', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Cost')));
 }
Exemplo n.º 16
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'option_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'choice_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'product_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Option Group Name (size, color, etc.)')));
     $this->add(array('name' => 'instruction', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Instruction')));
     $this->add(array('name' => 'required', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Required')));
     $this->add(array('name' => 'builder', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('options' => array('0' => 'False', '1' => 'True')), 'options' => array('label' => 'Builder')));
     $this->add(array('name' => 'option_type_id', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('options' => array('' => '---------', '1' => 'Select Box', '2' => 'Radio Buttons', '3' => 'Checkboxes')), 'options' => array('label' => 'Display Options As')));
 }
Exemplo n.º 17
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @param  string $type
  * @param  string $name
  * @param  string $format
  * @param  string $version
  * @return self
  */
 public function __construct($action = null, $method = 'post', $type = null, $name = null, $format = null, $version = null)
 {
     parent::__construct($action, $method, null, '        ');
     $site = Table\Sites::getSite();
     if (strpos($site->domain, 'www.') !== false) {
         $domain = 'ftp.' . str_replace('www.', '', $site->domain);
     } else {
         $domain = $site->domain;
     }
     $rootValue = $_POST && isset($_POST['change_ftp_root']) ? $_POST['change_ftp_root'] : null;
     $fields1 = array('ftp_address' => array('type' => 'text', 'label' => $this->i18n->__('FTP Address'), 'required' => true, 'attributes' => array('size' => 40), 'value' => $domain), 'username' => array('type' => 'text', 'label' => $this->i18n->__('Username'), 'required' => true, 'attributes' => array('size' => 40)), 'password' => array('type' => 'text', 'label' => $this->i18n->__('Password'), 'required' => true, 'attributes' => array('size' => 40)), 'ftp_root' => array('type' => 'radio', 'label' => $this->i18n->__('FTP Root'), 'value' => array('0' => $this->i18n->__('Log directly into the document root.') . '<br /><br />', '1' => $this->i18n->__('No, change the directory to') . ' <input style="margin-left: 5px; width: 150px; height: 15px; font-size: 0.9em;" type="text" size="18" name="change_ftp_root" value="' . $rootValue . '" />'), 'marked' => '0'));
     $fields2 = array('submit' => array('type' => 'submit', 'value' => $this->i18n->__('UPDATE'), 'attributes' => array('class' => 'save-btn')), 'use_pasv' => array('type' => 'radio', 'label' => $this->i18n->__('Use PASV'), 'value' => array('1' => $this->i18n->__('Yes'), '0' => $this->i18n->__('No')), 'marked' => '1'), 'protocol' => array('type' => 'radio', 'label' => $this->i18n->__('Protocol'), 'value' => array('0' => $this->i18n->__('FTP'), '1' => $this->i18n->__('FTPS')), 'marked' => '0'), 'type' => array('type' => 'hidden', 'value' => $type), 'name' => array('type' => 'hidden', 'value' => $name), 'version' => array('type' => 'hidden', 'value' => $version), 'format' => array('type' => 'hidden', 'value' => $format), 'base_path' => array('type' => 'hidden', 'value' => BASE_PATH), 'content_path' => array('type' => 'hidden', 'value' => CONTENT_PATH), 'app_path' => array('type' => 'hidden', 'value' => APP_PATH));
     $this->initFieldsValues = array($fields2, $fields1);
     $this->setAttributes('id', 'update-form');
 }
Exemplo n.º 18
0
 function __construct(ObjectManager $objectManager)
 {
     parent::__construct('comment');
     $hydrator = new DoctrineObject($objectManager);
     $inputFilter = new InputFilter('comment');
     $this->setHydrator($hydrator);
     $this->setInputFilter($inputFilter);
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'clearfix');
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'author', 'options' => ['object_manager' => $objectManager, 'target_class' => 'User\\Entity\\User']]);
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'parent', 'options' => ['object_manager' => $objectManager, 'target_class' => 'Discussion\\Entity\\Comment']]);
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'instance', 'options' => ['object_manager' => $objectManager, 'target_class' => 'Instance\\Entity\\Instance']]);
     $this->add((new Textarea('content'))->setAttribute('placeholder', 'Content'));
     $this->add(new OptInFieldset());
     $this->add((new Submit('start'))->setValue('Reply')->setAttribute('class', 'btn btn-success pull-right'));
     $inputFilter->add(['name' => 'content', 'required' => true]);
     $inputFilter->add(['name' => 'instance', 'required' => true]);
     $inputFilter->add(['name' => 'author', 'required' => true]);
     $inputFilter->add(['name' => 'parent', 'required' => true]);
 }
Exemplo n.º 19
0
 function __construct(HydratorPluginAwareDoctrineObject $hydrator, ObjectManager $objectManager)
 {
     parent::__construct('discussion');
     $inputFilter = new InputFilter('discussion');
     $this->setInputFilter($inputFilter);
     $this->setHydrator($hydrator);
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'clearfix');
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'author', 'options' => ['object_manager' => $objectManager, 'target_class' => 'User\\Entity\\User']]);
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'object', 'options' => ['object_manager' => $objectManager, 'target_class' => 'Uuid\\Entity\\Uuid']]);
     $this->add(['type' => 'Common\\Form\\Element\\ObjectHidden', 'name' => 'instance', 'options' => ['object_manager' => $objectManager, 'target_class' => 'Instance\\Entity\\Instance']]);
     $this->add(new Hidden('terms'));
     $this->add((new Text('title'))->setAttribute('placeholder', 'Title'));
     $this->add((new Textarea('content'))->setAttribute('placeholder', 'Content'));
     $this->add(new OptInFieldset());
     $this->add((new Submit('start'))->setValue('Start discussion')->setAttribute('class', 'btn btn-success pull-right'));
     $inputFilter->add(['name' => 'title', 'required' => true, 'filters' => [['name' => 'StripTags']], 'validators' => [['name' => 'Regex', 'options' => ['pattern' => '~^[a-zA-Z\\-_ 0-9äöüÄÖÜß,\\:\\.]*$~', 'messages' => [Regex::NOT_MATCH => 'Title should not contain special characters']]]]]);
     $inputFilter->add(['name' => 'instance', 'required' => true]);
     $inputFilter->add(['name' => 'content', 'required' => true, 'filters' => [['name' => 'StripTags']]]);
 }
Exemplo n.º 20
0
 public function __construct()
 {
     parent::__construct();
     $this->loadFromConfigYaml(__DIR__ . '/../config/test.yml');
 }
Exemplo n.º 21
0
 public function __construct($id)
 {
     parent::__construct();
     $this->id = $id;
 }
Exemplo n.º 22
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @return self
  */
 public function __construct($action = null, $method = 'post')
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = array('email' => array('type' => 'text', 'label' => $this->i18n->__('Email'), 'required' => true, 'attributes' => array('size' => 30, 'style' => 'display: block; width: 288px; margin: 0 auto;'), 'validators' => new Validator\Email()), 'submit' => array('type' => 'submit', 'label' => '&nbsp;', 'value' => $this->i18n->__('SUBMIT'), 'attributes' => array('class' => 'update-btn', 'style' => 'display: block; width: 300px; margin: 0 auto;')));
     $this->setAttributes('id', 'forgot-form');
 }
Exemplo n.º 23
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string      $action
  * @param  string      $method
  * @param  int         $rid
  * @param  \Pop\Config $config
  * @return self
  */
 public function __construct($action = null, $method = 'post', $rid = 0, $config = null)
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = $this->getInitFields($rid, $config);
     $this->setAttributes('id', 'user-role-form');
 }
Exemplo n.º 24
0
 public function __construct($options = array())
 {
     parent::__construct();
     $this->add(array('type' => 'Zend\\Form\\Element\\Hidden', 'name' => 'parent_product_id', 'attributes' => array('type' => 'hidden'), 'options' => array('label' => '')));
     $this->add(array('type' => 'Zend\\Form\\Element\\Hidden', 'name' => 'product_id', 'attributes' => array('type' => 'hidden'), 'options' => array('label' => '')));
 }
Exemplo n.º 25
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @return self
  */
 public function __construct($action = null, $method = 'post')
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = array('username' => array('type' => 'text', 'label' => $this->i18n->__('Username'), 'required' => true, 'attributes' => array('size' => 30, 'style' => 'display: block; width: 290px; margin: 0 auto;')), 'password' => array('type' => 'password', 'label' => $this->i18n->__('Password'), 'required' => true, 'attributes' => array('size' => 30, 'style' => 'display: block; width: 290px; margin: 0 auto;')), 'submit' => array('type' => 'submit', 'label' => '&nbsp;', 'value' => $this->i18n->__('LOGIN'), 'attributes' => array('class' => 'update-btn', 'style' => 'display: block; width: 300px; margin: 0 auto;')));
     $this->setAttributes('id', 'login-form');
 }
Exemplo n.º 26
0
 public function __construct()
 {
     parent::__construct();
     $this->add(array('name' => 'category_id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'name', 'attributes' => array('type' => 'text'), 'options' => array('label' => 'Name')));
 }
Exemplo n.º 27
0
 public function __construct(Smarty $smarty, Language $language, TranslatorInterface $translator, CustomerAddressPersister $persister, CustomerAddressFormatter $formatter)
 {
     parent::__construct($smarty, $translator, $formatter);
     $this->language = $language;
     $this->persister = $persister;
 }
Exemplo n.º 28
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string $action
  * @param  string $method
  * @return self
  */
 public function __construct($action = null, $method = 'post')
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = array('email' => array('type' => 'text', 'label' => $this->i18n->__('Email'), 'required' => true, 'attributes' => array('size' => 40), 'validators' => new Validator\Email()), 'submit' => array('type' => 'submit', 'label' => '&nbsp;', 'value' => $this->i18n->__('UNSUBSCRIBE'), 'attributes' => array('class' => 'save-btn')));
     $this->setAttributes('id', 'unsubscribe-form');
 }
Exemplo n.º 29
0
 public function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 30
0
 /**
  * Constructor method to instantiate the form object
  *
  * @param  string  $action
  * @param  string  $method
  * @param  int     $tid
  * @return self
  */
 public function __construct($action = null, $method = 'post', $tid = 0)
 {
     parent::__construct($action, $method, null, '        ');
     $this->initFieldsValues = $this->getInitFields($tid);
     $this->setAttributes('id', 'user-type-form');
 }