/** * Build a generator form for this post * * @param \IPS\faker\Decorators\Form $form * @return void */ public function buildGenerateForm(&$form) { $form->add(new \IPS\Helpers\Form\Url('item_url', NULL, TRUE)); $form->add(new \IPS\Helpers\Form\Select('author_type', 'random_fake', TRUE, array('options' => array('random_fake' => 'faker_random_fake', 'guest' => 'guest'), 'unlimited' => '-1', 'unlimitedLang' => "faker_custom_author", 'unlimitedToggles' => array('faker_custom_author')))); $form->add(new \IPS\Helpers\Form\Member('author', NULL, FALSE, array(), NULL, NULL, NULL, 'faker_custom_author')); $form->add(new \IPS\Helpers\Form\NumberRange('comment_range', array('start' => 3, 'end' => 5), TRUE, array('start' => array('min' => 1)))); // $form->add( new \IPS\Helpers\Form\YesNo( 'hide_comment', 0 ) ); @TODO }
/** * Build a generator form for this comment * * @param \IPS\faker\Decorators\Form $form * @return void */ public function buildGenerateForm(&$form) { $groups = \IPS\Member\Group::groups(); $groupOpts = array(); foreach ($groups as $group) { $groupOpts[$group->g_id] = $group->name; } $form->langPrefix = 'core_members_faker_activerecords'; $form->add(new \IPS\Helpers\Form\NumberRange('record_range', array('start' => 3, 'end' => 5), TRUE, array('start' => array('min' => 1)))); $form->add(new \IPS\Helpers\Form\Select('member_group', \IPS\Settings::i()->member_group, true, array('options' => $groupOpts))); $form->add(new \IPS\Helpers\Form\YesNo('profile_photo', true)); $form->add(new \IPS\Helpers\Form\YesNo('password')); }
/** * Build a generator form for this node * * @param \IPS\faker\Decorators\Form $form * @return void */ public function buildGenerateForm(&$form) { $form->add(new \IPS\Helpers\Form\YesNo('description', FALSE)); $form->add(new \IPS\Helpers\Form\NumberRange('node_range', array('start' => 3, 'end' => 5), TRUE, array('start' => array('min' => 1)))); $form->add(new \IPS\Helpers\Form\Radio('forum_type', 'normal', TRUE, array('options' => array('normal' => 'forum_type_normal', 'qa' => 'forum_type_qa'), 'toggles' => array('normal' => array('forum_password_on', 'forum_ipseo_priority', 'forum_viglink', 'forum_min_posts_view', 'forum_can_view_others', 'forum_permission_showtopic', 'forum_permission_custom_error', "form_new_header_permissions", "form_new_tab_forum_display", "form_new_tab_posting_settings", "form_new_header_forum_display_topic", 'forum_preview_posts', 'forum_icon'), 'qa' => array('forum_password_on', 'forum_ipseo_priority', 'forum_viglink', 'forum_min_posts_view', 'forum_can_view_others_qa', 'forum_permission_showtopic_qa', 'forum_permission_custom_error', "form_new_header_permissions", "form_new_tab_forum_display", "form_new_tab_posting_settings", "form_new_header_forum_display_question", 'forum_can_view_others_qa', 'bw_enable_answers_member', 'forum_qa_rate_questions', 'forum_qa_rate_answers', 'forum_preview_posts_qa', 'forum_icon'), 'redirect' => array('forum_password_on', 'forum_redirect_url', 'forum_redirect_hits'))))); $form->add(new \IPS\Helpers\Form\Node('parent_ids', NULL, FALSE, array('class' => '\\IPS\\forums\\Forum', 'multiple' => TRUE, 'disabled' => array(), 'zeroVal' => 'node_no_parentf', 'permissionCheck' => function ($node) { return !isset(\IPS\Request::i()->id) or $node->id != \IPS\Request::i()->id and !$node->isChildOf($node::load(\IPS\Request::i()->id)); }), function ($val) { if (!$val and \IPS\Request::i()->forum_type !== 'category') { throw new \DomainException('faker_parent_id_error'); } })); // $form->add( new \IPS\Helpers\Form\YesNo( 'icon', FALSE ) ); @TODO $form->add(new \IPS\Helpers\Form\YesNo('password_on', FALSE, FALSE, array('togglesOn' => array('password', 'password_override')), NULL, NULL, NULL, 'password_on')); $form->add(new \IPS\Helpers\Form\Password('password', NULL, FALSE, array(), NULL, NULL, NULL, 'password')); /* Defaults */ $hiddenValues = array('forum_ipseo_priority' => '0.1', 'forum_min_posts_view' => 0, 'forum_can_view_others' => TRUE, 'forum_can_view_others_qa' => TRUE, 'forum_permission_showtopic' => TRUE, 'forum_permission_showtopic_qa' => TRUE, 'forum_sort_key' => 'last_post', 'forum_show_rules' => 0, 'forum_preview_posts' => FALSE, 'forum_preview_posts_qa' => FALSE, 'forum_inc_postcount' => TRUE, 'forum_allow_poll' => TRUE, 'forum_min_posts_post' => TRUE, 'bw_disable_tagging' => FALSE, 'bw_disable_prefixes' => FALSE); $form->hiddenValues = array_merge($form->hiddenValues, $hiddenValues); }
/** * Build a generator form for this content item * * @param \IPS\faker\Decorators\Form $form * @return void */ public function buildGenerateForm(&$form) { $form->add(new \IPS\Helpers\Form\Node('nodes', null, true, array('url' => \IPS\Http\Url::internal('app=forums&module=forums&controller=forums&do=createMenu'), 'class' => static::$nodeClass, 'multiple' => true))); $form->add(new \IPS\Helpers\Form\Select('author_type', 'random_fake', true, array('options' => array('random_fake' => 'faker_random_fake', 'guest' => 'guest'), 'unlimited' => '-1', 'unlimitedLang' => "faker_custom_author", 'unlimitedToggles' => array('faker_custom_author')))); $form->add(new \IPS\Helpers\Form\Member('author', null, false, array(), null, null, null, 'faker_custom_author')); $form->add(new \IPS\Helpers\Form\NumberRange('item_range', array('start' => 3, 'end' => 5), true, array('start' => array('min' => 1)))); $form->add(new \IPS\Helpers\Form\YesNo('add_comments', 0, false, array('togglesOn' => array('faker_comment_range')))); $form->add(new \IPS\Helpers\Form\NumberRange('comment_range', array('start' => 3, 'end' => 5), false, array('start' => array('min' => 1)), null, null, null, 'faker_comment_range')); $form->add(new \IPS\Helpers\Form\YesNo('add_tags', 0)); $form->add(new \IPS\Helpers\Form\CheckboxSet('after_posting', array(), false, array('options' => array('lock' => 'lock', 'pin' => 'pin', 'hide' => 'hide', 'feature' => 'feature')))); }