public function displaySettingsPanel(XMLElement &$wrapper, $errors = NULL) { Field::displaySettingsPanel($wrapper, $errors); $group = new XMLElement('div'); $group->setAttribute('class', 'two columns'); // Get Role in system $roles = RoleManager::fetch(); $options = array(); if (is_array($roles) && !empty($roles)) { foreach ($roles as $role) { $options[] = array($role->get('id'), $this->get('default_role') == $role->get('id'), $role->get('name')); } } $label = new XMlElement('label', __('Default Member Role')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Select("fields[{$this->get('sortorder')}][default_role]", $options)); $group->appendChild($label); $wrapper->appendChild($group); $div = new XMLElement('div', null, array('class' => 'two columns')); $this->appendShowColumnCheckbox($div); $wrapper->appendChild($div); }
public function displaySettingsPanel(XMLElement &$wrapper, $errors = NULL) { Field::displaySettingsPanel($wrapper, $errors); $group = new XMLElement('div'); $group->setAttribute('class', 'two columns'); // Add Activiation Code Expiry $div = new XMLElement('div'); $div->setAttribute('class', 'column'); $label = Widget::Label(__('Activation Code Expiry')); $label->appendChild(new XMLElement('i', __('How long a member\'s activation code will be valid for before it expires'))); $label->appendChild(Widget::Input("fields[{$this->get('sortorder')}][code_expiry]", $this->get('code_expiry'))); $ul = new XMLElement('ul', NULL, array('class' => 'tags singular')); $tags = fieldMemberActivation::findCodeExpiry(); foreach ($tags as $name => $time) { $ul->appendChild(new XMLElement('li', $name, array('class' => $time))); } $div->appendChild($label); $div->appendChild($ul); if (isset($errors['code_expiry'])) { $div = Widget::Error($div, $errors['code_expiry']); } // Get Roles in system $roles = RoleManager::fetch(); $options = array(); if (is_array($roles) && !empty($roles)) { foreach ($roles as $role) { $options[] = array($role->get('id'), $this->get('activation_role_id') == $role->get('id'), $role->get('name')); } } $label = new XMlElement('label', __('Role for Members who are awaiting activation')); $label->setAttribute('class', 'column'); $label->appendChild(Widget::Select("fields[{$this->get('sortorder')}][activation_role_id]", $options)); $group->appendChild($label); // Add Group $group->appendChild($div); $wrapper->appendChild($group); $div = new XMLElement('div', null, array('class' => 'two columns')); // Add Deny Login $div->appendChild(Widget::Input("fields[{$this->get('sortorder')}][deny_login]", 'no', 'hidden')); $label = Widget::Label(); $label->setAttribute('class', 'column'); $input = Widget::Input("fields[{$this->get('sortorder')}][deny_login]", 'yes', 'checkbox'); if ($this->get('deny_login') == 'yes') { $input->setAttribute('checked', 'checked'); } $label->setValue(__('%s Prevent unactivated members from logging in', array($input->generate()))); $div->appendChild($label); // Add Show Column $this->appendShowColumnCheckbox($div); $wrapper->appendChild($div); }