예제 #1
0
 public function displaySettingsPanel(XMLElement &$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     // Validator ----------------------------------------------------------
     $group = new XMLElement('div');
     $group->setAttribute('class', 'two columns');
     $label = Widget::Label(__('Minimum Length'));
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Input("fields[{$order}][length]", $this->get('length')));
     $group->appendChild($label);
     // Strength -----------------------------------------------------------
     $values = fieldMemberPassword::$_strengths;
     foreach ($values as &$value) {
         $value[1] = $value[0] == $this->get('strength');
     }
     $label = Widget::Label(__('Minimum Strength'));
     $label->setAttribute('class', 'column');
     $label->appendChild(Widget::Select("fields[{$order}][strength]", $values));
     $group->appendChild($label);
     $wrapper->appendChild($group);
     // Add Activiation Code Expiry ------------------------------------------
     $div = new XMLElement('div');
     $label = Widget::Label(__('Recovery Code Expiry'));
     $label->appendChild(new XMLElement('i', __('How long a member\'s recovery 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 = fieldMemberPassword::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']);
     }
     $wrapper->appendChild($div);
     // Add checkboxes
     $div = new XMLElement('div', null, array('class' => 'two columns'));
     $this->appendRequiredCheckbox($div);
     $this->appendShowColumnCheckbox($div);
     $wrapper->appendChild($div);
 }
예제 #2
0
 public function displaySettingsPanel(&$wrapper, $errors = NULL)
 {
     parent::displaySettingsPanel($wrapper, $errors);
     $order = $this->get('sortorder');
     // Validator ----------------------------------------------------------
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $label = Widget::Label(__('Minimum Length'));
     $label->appendChild(Widget::Input("fields[{$order}][length]", $this->get('length')));
     $group->appendChild($label);
     // Strength -----------------------------------------------------------
     $values = fieldMemberPassword::$_strengths;
     foreach ($values as &$value) {
         $value[1] = $value[0] == $this->get('strength');
     }
     $label = Widget::Label(__('Minimum Strength'));
     $label->appendChild(Widget::Select("fields[{$order}][strength]", $values));
     $group->appendChild($label);
     $wrapper->appendChild($group);
     // Salt ---------------------------------------------------------------
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $label = Widget::Label(__('Password Salt'));
     $label->appendChild(new XMLElement('i', __('A salt gives your passwords extra security. It cannot be changed once set')));
     $input = Widget::Input("fields[{$order}][salt]", $this->get('salt'));
     if ($this->get('salt')) {
         $input->setAttribute('disabled', 'disabled');
     }
     $label->appendChild($input);
     if (isset($errors['salt'])) {
         $label = Widget::wrapFormElementWithError($label, $errors['salt']);
     }
     $group->appendChild($label);
     // Add Activiation Code Expiry
     $div = new XMLElement('div');
     $label = Widget::Label(__('Recovery Code Expiry'));
     $label->appendChild(new XMLElement('i', __('How long a member\'s recovery 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 = fieldMemberPassword::findCodeExpiry();
     foreach ($tags as $name => $time) {
         $ul->appendChild(new XMLElement('li', $name, array('class' => $time)));
     }
     if (isset($errors['code_expiry'])) {
         $label = Widget::wrapFormElementWithError($label, $errors['code_expiry']);
     }
     $div->appendChild($label);
     $div->appendChild($ul);
     $group->appendChild($div);
     $wrapper->appendChild($group);
     // Add checkboxes
     $div = new XMLElement('div', null, array('class' => 'compact'));
     $this->appendRequiredCheckbox($div);
     $this->appendShowColumnCheckbox($div);
     $wrapper->appendChild($div);
 }