public function init() { $friend_settings = Engine_Api::_()->getApi('settings', 'core')->user_friends; $this->setTitle('Friendship Settings'); $this->setDescription('USER_FORM_ADMIN_SETTINGS_FRIENDS_DESCRIPTION'); $eligible = new Engine_Form_Element_Radio('eligible'); $eligible->setLabel("Who Can Become Friends"); $eligible->setDescription('USER_FORM_ADMIN_SETTINGS_ELIGIBLE_DESCRIPTION'); $eligible->addMultiOptions(array('2' => 'All Members', '1' => 'Only members in their networks', '0' => 'Nobody')); $eligible->setValue($friend_settings['eligible']); $direction = new Engine_Form_Element_Radio('direction'); $direction->setLabel("Friendship Direction"); $direction->setDescription("USER_FORM_ADMIN_SETTINGS_DIRECTION_DESCRIPTION"); $direction->addMultiOptions(array('1' => 'Two-way Friendships', '0' => 'One-way Friendships')); $direction->setValue($friend_settings['direction']); $verification = new Engine_Form_Element_Radio('verification'); $verification->setLabel("Friendship Verification"); $verification->setDescription("USER_FORM_ADMIN_SETTINGS_VERIFICATION_DESCRIPTION"); $verification->addMultiOptions(array('1' => "Verified Friendships", '0' => "Unverified Friendships")); $verification->setValue($friend_settings['verification']); $lists = new Engine_Form_Element_Radio('lists'); $lists->setLabel("Friend Lists"); $lists->setDescription('USER_FORM_ADMIN_SETTINGS_LISTS_DESCRIPTION'); $lists->addMultiOptions(array('1' => "Yes, users can group their friends into lists", '0' => "No, do not allow friend lists")); $lists->setValue($friend_settings['lists']); $submit = new Engine_Form_Element_Button('submit', array('label' => 'Save Changes', 'ignore' => true, 'type' => 'submit')); $this->addElements(array($eligible, $direction, $verification, $lists, $submit)); }
public function init() { $this->setTitle('Global Settings')->setDescription('These settings affect all members in your community.'); $topic_length = new Engine_Form_Element_Text('topic_length'); $topic_length->setDescription('How many posts will be shown per topic page? (Enter a number between 1 and 999'); $topic_length->setLabel('Posts per topic page'); $topic_length->setValue(25); $forum_length = new Engine_Form_Element_Text('forum_length'); $forum_length->setDescription('How topics will be shown per forum page? (Enter a number between 1 and 999'); $forum_length->setLabel('Topics per forum page'); $forum_length->setValue(25); // Create Elements $bbcode = new Engine_Form_Element_Radio('bbcode'); $bbcode->addMultiOptions(array(1 => 'Yes, members can use BBCode tags.', 0 => 'No, do not let members use BBCode.')); $bbcode->setValue(1); $bbcode->setLabel("Enable BBCode"); $html = new Engine_Form_Element_Radio('html'); $html->addMultiOptions(array(1 => 'Yes, members can use HTML in their posts.', 0 => 'No, strip HTML from posts.')); $html->setValue(0); $html->setLabel("Enable HTML"); // Add elements $this->addElements(array($topic_length, $forum_length, $bbcode, $html)); // Add submit button $submit = new Engine_Form_Element_Button('submit'); $submit->setAttrib('type', 'submit')->setLabel('Save Changes'); $this->addElement($submit); }
public function init() { $this->setMethod("POST"); $this->setTitle("Step 1: Create Account"); $settings = Engine_Api::_()->getApi('settings', 'core'); $approve = new Engine_Form_Element_Radio('approve'); $approve->setLabel("Auto-approve Members"); $approve->setDescription("USER_FORM_ADMIN_SIGNUP_APPROVE_DESCRIPTION"); $approve->addMultiOptions(array(1 => 'Yes, enable members upon signup.', 0 => 'No, do not enable members upon signup.')); $approve->setValue(1); $terms = new Engine_Form_Element_Radio('terms'); $terms->addMultiOptions(array(1 => 'Yes, make members agree to your terms of service on signup.', 0 => 'No, members will not be shown a terms of service checkbox on signup.')); $terms->setValue(1); $terms->setDescription("USER_FORM_ADMIN_SIGNUP_TERMS_DESCRIPTION"); $random = new Engine_Form_Element_Radio('random'); $random->setLabel("Generate Random Passwords?"); $random->setDescription("USER_FORM_ADMIN_SIGNUP_RANDOM_DESCRIPTION"); $random->addMultiOptions(array(1 => 'Yes, generate random passwords and email to new members.', 0 => 'No, let members choose their own passwords.')); $random->setValue(0); $verify_email = new Engine_Form_Element_Radio('verifyemail'); $verify_email->setLabel("Verify Email Address?"); $verify_email->setDescription("USER_FORM_ADMIN_SIGNUP_VERIFYEMAIL_DESCRIPTION"); $verify_email->addMultiOptions(array(2 => 'Yes, verify email addresses.', 1 => 'No, just send members a welcome email', 0 => 'No, do not email new members.')); $verify_email->setValue(0); $invite_only = new Engine_Form_Element_Radio('inviteonly'); $invite_only->setDescription("USER_FORM_ADMIN_SIGNUP_INVITEONLY_DESCRIPTION"); $invite_only->addMultiOptions(array(2 => 'Yes, admins and members must invite new members before they can signup.', 1 => 'Yes, admins must invite new members before they can signup.', 0 => 'No, disable the invite only feature.')); $invite_only->setValue(2); $check_email = new Engine_Form_Element_Radio('checkemail'); $check_email->setDescription("USER_FORM_ADMIN_SIGNUP_CHECKEMAIL_DESCRIPTION"); $check_email->addMultiOptions(array(1 => "Yes, check that a member's email address was invited.", 0 => "No, anyone with an invite code can signup.")); $check_email->setValue(1); $check_email->setLabel("Empty"); /* $invite_count = new Engine_Form_Element_Text('invitecount'); $invite_count->setDescription('How many invites do members get when they signup? (If you want to give a particular member extra invites, you can do so via the View Members page. Please enter a number between 0 and 999 below.'); */ $this->addElements(array($approve, $terms, $random, $verify_email, $invite_only, $check_email)); $terms->getDecorator('HtmlTag2')->setOption('style', 'border-top:none;clear: right;padding-top:0px;padding-bottom:0px;'); $invite_only->getDecorator('HtmlTag2')->setOption('style', 'border-top:none;clear:right; padding-top:0px;padding-bottom:0px;'); $check_email->getDecorator('HtmlTag2')->setOption('style', 'border-top:none; clear:right; float:right;'); // $invite_count->getDecorator('HtmlTag2')->setOption('style', 'border-top:none; clear:right; float:right;'); $invite_only->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper signup-invite-wrapper'); $check_email->getDecorator('HtmlTag2')->setOption('class', 'form-wrapper signup-check-wrapper'); $terms->removeDecorator('label'); $invite_only->removeDecorator('label'); $check_email->getDecorator('label')->setOption('tagOptions', array('style' => 'padding-right:0px;visibility:hidden;', 'class' => 'form-label')); $this->addDisplayGroup(array('terms'), 'term_group'); $this->addDisplayGroup(array('inviteonly', 'checkemail'), 'invite_group'); $term_group = $this->getDisplayGroup('term_group'); $invite_group = $this->getDisplayGroup('invite_group'); $term_group->setLegend("Terms of Service"); $invite_group->setLegend("Invite Only?"); // Init submit $this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true)); $this->populate($settings->getSetting('user_signup')); }
public function init() { $this->setTitle('Global Settings')->setDescription('These settings affect all members in your community.'); // Create Elements $bbcode = new Engine_Form_Element_Radio('bbcode'); $bbcode->addMultiOptions(array(1 => 'Yes, members can use BBCode tags.', 0 => 'No, do not let members use BBCode.')); $bbcode->setValue(1); $bbcode->setLabel("Enable BBCode"); $html = new Engine_Form_Element_Radio('html'); $html->addMultiOptions(array(1 => 'Yes, members can use HTML in their posts.', 0 => 'No, strip HTML from posts.')); $html->setValue(0); $html->setLabel("Enable HTML"); // Add elements $this->addElements(array($bbcode, $html)); // Add submit button $this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true)); }
public function init() { $this->setAttrib('enctype', 'multipart/form-data'); $step_table = Engine_Api::_()->getDbtable('signup', 'user'); $step_row = $step_table->fetchRow($step_table->select()->where('class = ?', 'Contactimporter_Plugin_Signup_Invite')); $count = $step_row->order + 1; $title = $this->getView()->translate('Step %d: Invite Your Friends', $count); $this->setTitle($title)->setDisableTranslator(true); $enable = new Engine_Form_Element_Radio('enable'); $enable->setLabel("Invite Friends"); $enable->setDescription("USER_FORM_ADMIN_SIGNUP_FIELDS_ENABLE_DESCRIPTION"); $enable->addMultiOptions(array(1 => 'Yes, include the "Invite Friends" step during signup.', 0 => 'No, do not include this step.')); $enable->setValue($step_row->enable); $this->addElements(array($enable)); // Init submit $this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true)); }
public function init() { $step_table = Engine_Api::_()->getDbtable('signup', 'user'); $step_row = $step_table->fetchRow($step_table->select()->where('class = ?', 'User_Plugin_Signup_Photo')); $count = $step_row->order + 1; $title = $this->getView()->translate('Step %d: Add Your Photo', $count); $this->setTitle($title)->setDisableTranslator(true); $this->setAttrib('enctype', 'multipart/form-data'); $enable = new Engine_Form_Element_Radio('enable'); $enable->setLabel("User Photo Upload"); $enable->setDescription("Do you want your users to be able to upload a photo of themselves upon signup?"); $enable->addMultiOptions(array(1 => 'Yes, give users the option to upload a photo upon signup.', 0 => 'No, do not allow users to upload a photo upon signup.')); $enable->setValue($step_row->enable); $this->addElements(array($enable)); // Init submit $this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true)); }