/**
  * init
  */
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'label' => 'Keyword', 'name' => 'q', 'class' => 'form-control']);
     $moduleOptions = app()->instance()->make('platform_core_extension')->getModuleOptions();
     $this->addElement(['plugin' => 'select', 'name' => 'module', 'label' => 'Module', 'required' => false, 'class' => 'form-control', 'value' => 'core', 'options' => $moduleOptions]);
 }
示例#2
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'name' => 'q', 'label' => 'Keyword', 'placeholder' => 'Name, Email, ...', 'class' => 'form-control', 'value' => '']);
     $this->addElement(['plugin' => 'select', 'name' => 'gender', 'label' => 'Browse For', 'class' => 'form-control', 'required' => true, 'options' => [['value' => '1', 'label' => 'Male'], ['value' => '2', 'label' => 'Female'], ['value' => '', 'label' => 'All']], 'value' => '']);
     $this->addElement(['plugin' => 'select', 'name' => 'online', 'label' => 'Online', 'class' => 'form-control', 'required' => true, 'options' => [['value' => '1', 'label' => 'Yes'], ['value' => '2', 'label' => 'No'], ['value' => '', 'label' => 'All']], 'value' => '']);
 }
 /**
  * init
  */
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'label' => 'Keyword', 'placeholder' => 'Title', 'name' => 'q', 'class' => 'form-control']);
     $this->addElement(['plugin' => 'select', 'name' => 'category', 'label' => 'Category', 'class' => 'form-control', 'options' => app()->blogService()->getCategoryOptions()]);
     $this->addElement(['plugin' => 'select', 'name' => 'created', 'label' => 'Created', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => 'today', 'label' => 'Today'], ['value' => '7days', 'label' => 'This week'], ['value' => 'this_month', 'label' => 'This month']]]);
 }
 /**
  * init
  */
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'label' => 'Keyword', 'name' => 'q', 'class' => 'form-control']);
     $langOptions = app()->phraseService()->getLanguageOptions();
     $this->addElement(['plugin' => 'select', 'name' => 'langId', 'label' => 'Language', 'required' => true, 'class' => 'form-control', 'value' => 'en', 'options' => $langOptions]);
 }
 /**
  * Overwrite init method
  */
 protected function init()
 {
     parent::init();
     $this->setTitle('Block Settings');
     $this->setNote('Block Settings');
     $this->addElement(['plugin' => 'hidden', 'name' => 'base_script', 'value' => 'view', 'required' => true]);
 }
 protected function init()
 {
     parent::init();
     $rule = $this->getRule();
     $this->setTitle($rule->getTitle());
     $this->setNote($rule->getDescription());
 }
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->setTitle('Edit Decorator');
     $this->addElement(['plugin' => 'hidden', 'name' => 'step', 'value' => 2]);
     $this->addElement(['plugin' => 'hidden', 'name' => 'decorator', 'value' => 'panel']);
     $this->addElement(['plugin' => 'hidden', 'name' => 'blockId']);
 }
示例#8
0
 /**
  * init
  */
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'label' => 'Keyword', 'name' => 'q', 'class' => 'form-control']);
     $this->addElement(['plugin' => 'select', 'name' => 'approve', 'label' => 'Approval', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '0', 'label' => 'No'], ['value' => '1', 'label' => 'Approved']]]);
     $this->addElement(['plugin' => 'select', 'name' => 'active', 'label' => 'Active', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '0', 'label' => 'No'], ['value' => '1', 'label' => 'Active']]]);
     $this->addElement(['plugin' => 'select', 'name' => 'created', 'label' => 'Created', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '1hour', 'label' => '60 minutes'], ['value' => 'today', 'label' => 'Today'], ['value' => '24hours', 'label' => '24 hours'], ['value' => '7days', 'label' => '7 days'], ['value' => '30days', 'label' => '30 days'], ['value' => 'this_month', 'label' => 'This month'], ['value' => '30days', 'label' => 'This year']]]);
 }
 /**
  * init
  */
 protected function init()
 {
     parent::init();
     $this->setMethod('get');
     $roleOptions = app()->aclService()->getRoleOptions();
     $groupOptions = app()->aclService()->getGroupOptions();
     $this->addElement(['plugin' => 'select', 'name' => 'roleId', 'label' => 'Role', 'required' => true, 'class' => 'form-control', 'value' => 'en', 'options' => $roleOptions]);
     $this->addElement(['plugin' => 'select', 'name' => 'groupId', 'label' => 'Permissions', 'required' => true, 'class' => 'form-control', 'value' => 'en', 'options' => $groupOptions]);
 }
 protected function init()
 {
     parent::init();
     $this->setTitle('message_compose.form_title');
     $this->setNote('message_compose.form_note');
     $this->addElement(['plugin' => 'hidden', 'name' => 'send']);
     $this->addElement(['plugin' => 'suggest', 'name' => 'recipients', 'label' => 'compose_message.recipient_label', 'placeholder' => 'compose_message.recipient_placeholder', 'note' => 'compose_message.recipient_note', 'multiple' => true, 'class' => 'form-control']);
     $this->addElement(['plugin' => 'text', 'name' => 'subject', 'maxlength' => 200, 'label' => 'compose_message.subject_label', 'placeholder' => 'compose_message.subject_placeholder', 'note' => 'compose_message.subject_note', 'required' => true, 'class' => 'form-control']);
     $this->addElement(['plugin' => 'textarea', 'name' => 'content', 'label' => 'compose_message.content_label', 'placeholder' => 'compose_message.content_placeholder', 'note' => 'compose_message.content_note', 'required' => true, 'class' => 'form-control']);
 }
示例#11
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->setAction(app()->routing()->getUrl('blogs'));
     $this->setMethod('get');
     $this->addElement(['plugin' => 'text', 'label' => 'core.keyword', 'name' => 'q', 'placeholder' => 'blog.search_blogs', 'class' => 'form-control']);
     $this->addElement(['plugin' => 'select', 'name' => 'order', 'required' => true, 'label' => 'Browse by', 'options' => [['value' => 'recent', 'label' => 'Recent']], 'value' => 'recent', 'class' => 'form-control']);
     $this->addElement(['plugin' => 'submit', 'label' => 'core.search', 'class' => 'btn btn-primary']);
     $this->setData($_GET);
 }
示例#12
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->setTitle('manage_process_form_step.form_add_title');
     $this->setNote('manage_process_form_step.form_add_note');
     $this->addElement(['plugin' => 'text', 'name' => 'step_name', 'label' => 'manage_process_form_step.step_name_label', 'note' => 'manage_process_form_step.step_name_note', 'required' => true, 'maxlength' => 20]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_active', 'label' => 'manage_process_form_step.active_label', 'note' => 'manage_process_form_step.active_note', 'value' => '1', 'required' => true]);
     $this->addElement(['plugin' => 'text', 'name' => 'step_number', 'label' => 'manage_process_form_step.step_number_label', 'note' => 'manage_process_form_step.step_number_note', 'value' => '1', 'required' => true]);
     $this->addElement(['plugin' => 'text', 'name' => 'sort_order', 'label' => 'manage_process_form_step.sort_order_label', 'note' => 'manage_process_form_step.sort_order_note', 'value' => '1', 'required' => true]);
 }
示例#13
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->setTitle('manage_process_form_section.form_add_title');
     $this->setNote('manage_process_form_section.form_add_note');
     $this->addElement(['plugin' => 'text', 'name' => 'section_name', 'label' => 'manage_process_form_section.section_name_label', 'note' => 'manage_process_form_section.section_name_note', 'required' => true, 'maxlength' => 20]);
     $this->addElement(['plugin' => 'radio', 'name' => 'step_id', 'label' => 'manage_process_form_section.step_label', 'note' => 'manage_process_form_section.step_note', 'required' => true, 'options' => app()->instance()->make('platform_core_process')->getStepOptions($this->getContentType(), $this->getActionType())]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_active', 'label' => 'manage_process_form_section.active_label', 'note' => 'manage_process_form_section.active_note', 'value' => '1']);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_required', 'label' => 'manage_process_form_section.required_label', 'note' => 'manage_process_form_section.required_note', 'value' => '0']);
     $this->addElement(['plugin' => 'text', 'name' => 'sort_order', 'label' => 'manage_process_form_section.section_sort_order_label', 'note' => 'manage_process_form_section.section_sort_order_note', 'value' => '0', 'required' => true]);
 }
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $item = $this->getNotificationType();
     $this->setTitle($item->getTitle());
     $this->setNote('form_notification_type_setting.form_note');
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_active', 'label' => 'form_notification_type_setting.is_active_label', 'note' => 'form_notification_type_setting.is_active_note', 'value' => 1]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_mail', 'label' => 'form_notification_type_setting.is_mail_label', 'note' => 'form_notification_type_setting.is_mail_note', 'value' => 1]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_push', 'label' => 'form_notification_type_setting.is_push_label', 'note' => 'form_notification_type_setting.is_push_note', 'value' => 1]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_sms', 'label' => 'form_notification_type_setting.is_sms_label', 'note' => 'form_notification_type_setting.is_sms_note', 'value' => 1]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'user_edit', 'label' => 'form_notification_type_setting.show_on_user_config_label', 'note' => 'form_notification_type_setting.show_on_user_config_note', 'value' => 1]);
 }
示例#15
0
 protected function init()
 {
     parent::init();
     $this->addElement(['plugin' => 'text', 'label' => 'Keyword', 'name' => 'q', 'class' => 'form-control']);
     $this->addElement(['plugin' => 'select', 'name' => 'gender', 'label' => 'Gender', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => 'male', 'label' => 'Male'], ['value' => 'female', 'label' => 'Female']]]);
     $roleOptions = app()->aclService()->getRoleOptions('user');
     array_unshift($roleOptions, ['value' => 'all', 'label' => 'All']);
     $this->addElement(['plugin' => 'select', 'name' => 'role', 'label' => 'Role', 'required' => true, 'class' => 'form-control', 'options' => $roleOptions]);
     $this->addElement(['plugin' => 'select', 'name' => 'approve', 'label' => 'Approval', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '0', 'label' => 'No'], ['value' => '1', 'label' => 'Approved']]]);
     $this->addElement(['plugin' => 'select', 'name' => 'active', 'label' => 'Active', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '0', 'label' => 'No'], ['value' => '1', 'label' => 'Active']]]);
     $this->addElement(['plugin' => 'select', 'name' => 'created', 'label' => 'Created', 'class' => 'form-control', 'required' => true, 'options' => [['value' => 'all', 'label' => 'All'], ['value' => '1hour', 'label' => '60 minutes'], ['value' => 'today', 'label' => 'Today'], ['value' => '24hours', 'label' => '24 hours'], ['value' => '7days', 'label' => '7 days'], ['value' => '30days', 'label' => '30 days'], ['value' => 'this_month', 'label' => 'This month'], ['value' => '30days', 'label' => 'This year']]]);
 }
示例#16
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $field = $this->getField();
     $section = $field->getSection();
     $stepId = $section->getStepId();
     $this->setTitle('manage_process_form_field.form_title');
     $this->setNote('manage_process_form_field.form_note');
     $this->addElement(['plugin' => 'text', 'name' => 'field_name', 'required' => true, 'label' => 'manage_process_form_field.field_name_label', 'note' => 'manage_process_form_field.field_name_note', 'disabled' => true]);
     $this->addElement(['plugin' => 'radio', 'name' => 'section_id', 'label' => 'manage_process_form_field.section_label', 'note' => 'manage_process_form_field.section_note', 'required' => true, 'options' => app()->instance()->make('platform_core_process')->getSectionOptions($stepId)]);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_active', 'label' => 'manage_process_form_field.active_label', 'note' => 'manage_process_form_field.active_note', 'value' => '0']);
     $this->addElement(['plugin' => 'yesno', 'name' => 'is_required', 'label' => 'manage_process_form_field.required_label', 'note' => 'manage_process_form_field.required_note', 'value' => '0']);
     $this->addElement(['plugin' => 'radio', 'name' => 'plugin_id', 'label' => 'manage_process_form_field.plugin_label', 'note' => 'manage_process_form_field.plugin_note', 'required' => true, 'value' => 'text', 'optionTextKey' => 'core.form_plugin_opt_', 'options' => app()->instance()->make('platform_core_process')->getPluginOptions()]);
 }
示例#17
0
 /**
  *
  */
 protected function init()
 {
     parent::init();
     $this->setTitle('manage_process_delete_field.form_title');
     $this->setNote('manage_process_delete_field.form_note');
 }
 /**
  * init
  */
 protected function init()
 {
     parent::init();
     $roleTypeOptions = app()->aclService()->getRoleTypeOptions();
     $this->addElement(['plugin' => 'select', 'name' => 'roleType', 'label' => 'Type', 'required' => true, 'class' => 'form-control', 'value' => 'en', 'options' => $roleTypeOptions]);
 }
示例#19
0
 /**
  *
  */
 public function testHtmlForm()
 {
     $form = new Form();
     $manager = new Manager();
     $faker = $this->getFaker();
     $name = 'field_';
     $iteration = 0;
     foreach ($manager->getPlugins() as $pluginName => $pluginClass) {
         $form->addElement(['plugin' => $pluginName, 'name' => $name . '_' . ++$iteration, 'label' => $faker->sentence, 'note' => $faker->paragraph, 'placeholder' => $faker->sentence]);
     }
     // add more options
     $form->addElement(['name' => 'custom_1', 'plugin' => 'textarea', 'htmlEditor' => true, 'pluginOptions' => ['key' => 'value'], 'value' => 'some test contain']);
     $form->addElement(['name' => 'custom_2', 'plugin' => 'multiselect', 'required' => true, 'htmlEditor' => true, 'value' => 'some test contain', 'options' => [['label' => $faker->sentence, 'value' => $iteration++], ['label' => $faker->sentence, 'value' => $iteration++], ['label' => $faker->sentence, 'value' => $iteration++]]]);
     $form->addElement(['name' => 'custom_3', 'plugin' => 'multicheckbox', 'required' => true, 'htmlEditor' => true, 'value' => 'some test contain', 'options' => [['label' => $faker->sentence, 'value' => $iteration++], ['label' => $faker->sentence, 'value' => $iteration++], ['label' => $faker->sentence, 'value' => $iteration++]]]);
     foreach ($manager->getDecorators() as $renderName => $renderValue) {
         $form->renderElements($renderName);
     }
     $data = $form->getData();
     $form->setData($data);
     $form->isValid($data);
     $form->getByNames();
     $form->getElements();
     $form->getElement('name_1');
     $form->getElement('name__');
     $form->removeElement('name_1');
     $form->getValue();
     $form->setMethod('get');
     $this->assertEquals($form->getAttribute('method'), 'GET');
     $form->setAction('/');
     $this->assertEquals('/', $form->getAttribute('action'));
     $form->setEnctype('multipart/form-data');
     $this->assertEquals('multipart/form-data', $form->getAttribute('enctype'));
 }