示例#1
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('validate', 'url');
     if (!$fieldNode->getAttribute('relative')) {
         $fieldNode->removeAttribute('relative');
     }
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#2
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     foreach ($this->getOptions($field) as $index => $value) {
         $element = $fieldNode->appendChild(new DOMElement('option', $value));
         $element->setAttribute('value', $index);
     }
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#3
0
 public function prepareValueForDisplay($value, $field)
 {
     $value = (array) $value;
     JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php');
     $texts = array();
     foreach (UsersHelper::getGroups() as $group) {
         if (in_array($group->value, $value)) {
             $texts[] = parent::prepareValueForDisplay(trim($group->text, '- '), $field);
         }
     }
     return parent::prepareValueForDisplay($texts, $field);
 }
示例#4
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $input = JFactory::getApplication()->input;
     if (JFactory::getApplication()->isAdmin()) {
         $fieldNode->setAttribute('plugin', JFactory::getConfig()->get('captcha'));
     } else {
         if ($input->get('option') == 'com_users' && $input->get('view') == 'profile' && $input->get('layout') != 'edit' && $input->get('task') != 'save') {
             // The user profile page does show the values by creating the form
             // and getting the values from it so we need to disable the field
             $fieldNode->setAttribute('plugin', null);
         }
     }
     $fieldNode->setAttribute('validate', 'captcha');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#5
0
 public function prepareValueForDisplay($value, $field)
 {
     $value = (array) $value;
     $texts = array();
     foreach ($value as $userId) {
         if (!$userId) {
             continue;
         }
         $user = JFactory::getUser($userId);
         if ($user) {
             $texts[] = $user->name;
         } else {
             $texts[] = $userId;
         }
     }
     return parent::prepareValueForDisplay($texts, $field);
 }
示例#6
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('validate', 'tel');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#7
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('buttons', $field->fieldparams->get('buttons', 0) ? 'true' : 'false');
     $fieldNode->setAttribute('filter', 'JComponentHelper::filterText');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#8
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('hide_default', 'true');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#9
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('filter', 'JComponentHelper::filterText');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }
示例#10
0
 protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form)
 {
     $fieldNode->setAttribute('value_field', 'text');
     $fieldNode->setAttribute('key_field', 'value');
     return parent::postProcessDomNode($field, $fieldNode, $form);
 }