diff --git a/administrator/components/com_users/views/users/tmpl/modal.php b/administrator/components/com_users/views/users/tmpl/modal.php index 9baf6fe79c014..ec412b4e276ea 100644 --- a/administrator/components/com_users/views/users/tmpl/modal.php +++ b/administrator/components/com_users/views/users/tmpl/modal.php @@ -27,13 +27,29 @@ $enabledStates = array(0 => 'icon-publish', 1 => 'icon-unpublish'); $activatedStates = array(0 => 'icon-publish', 1 => 'icon-unpublish'); $userRequired = (int) $input->get('required', 0, 'int'); + +/** + * Mootools compatibility + * + * There is an extra option passed in the url for the iframe &ismoo=0 for the bootstraped field. + * By default the value will be 1 or defaults to mootools behaviour using function jSelectUser() + * + * This should be removed when mootools won't be shipped by Joomla. + */ +$isMoo = $input->getInt('ismoo', 1); + +if ($isMoo) +{ + $onClick = "window.parent.jSelectUser(this);window.parent.jQuery('.modal.in').modal('hide');"; +} + ?>
  + data-user-field="escape($field);?>" value="" onclick="window.parent.jSelectUser(this)"> 
$this)); ?> @@ -79,7 +95,7 @@ + data-user-field="escape($field);?>" onclick=""> escape($item->name); ?> diff --git a/administrator/templates/isis/html/layouts/joomla/form/field/user.php b/administrator/templates/isis/html/layouts/joomla/form/field/user.php index 272db3868b6d2..1ffe7948a7170 100644 --- a/administrator/templates/isis/html/layouts/joomla/form/field/user.php +++ b/administrator/templates/isis/html/layouts/joomla/form/field/user.php @@ -48,7 +48,7 @@ // Set the link for the user selection page $link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&required=' - . ($required ? 1 : 0) . '&field={field-user-id}' + . ($required ? 1 : 0) . '&field={field-user-id}&ismoo=0' . (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '') . (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : ''); diff --git a/templates/protostar/html/layouts/joomla/form/field/user.php b/templates/protostar/html/layouts/joomla/form/field/user.php index e299a4ec624c2..87142b9d32a3f 100644 --- a/templates/protostar/html/layouts/joomla/form/field/user.php +++ b/templates/protostar/html/layouts/joomla/form/field/user.php @@ -48,7 +48,7 @@ // Set the link for the user selection page $link = 'index.php?option=com_users&view=users&layout=modal&tmpl=component&required=' - . ($required ? 1 : 0) . '&field={field-user-id}' + . ($required ? 1 : 0) . '&field={field-user-id}&ismoo=0' . (isset($groups) ? ('&groups=' . base64_encode(json_encode($groups))) : '') . (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : '');