Skip to content

Commit

Permalink
Dont show a user field on the front end
Browse files Browse the repository at this point in the history
Closes joomla#149
  • Loading branch information
laoneo committed Jun 21, 2016
1 parent c896a70 commit 9070e2e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions libraries/cms/form/field/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,29 @@ protected function getExcluded()
{
return explode(',', $this->element['exclude']);
}

/**
* Transforms the field into an XML element and appends it as child on the given parent. This
* is the default implementation of a field. Form fields which do support to be transformed into
* an XML Element mut implemet the JFormDomfieldinterface.
*
* @param stdClass $field The field.
* @param DOMElement $parent The field node parent.
* @param JForm $form The form.
*
* @return DOMElement
*
* @since 3.7
* @see JFormDomfieldinterface::appendXMLFieldTag
*/
public function appendXMLFieldTag ($field, DOMElement $parent, JForm $form)
{
if (JFactory::getApplication()->isSite())
{
// The user field is not working on the front end
return;
}

return parent::appendXMLFieldTag($field, $parent, $form);
}
}

0 comments on commit 9070e2e

Please sign in to comment.