Source for file user.php
Documentation is available at user.php
* @package Joomla.Libraries
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Field to select a user ID from a modal list.
* @package Joomla.Libraries
* Method to get the user field input markup.
* @return string The field input markup.
$link =
'index.php?option=com_users&view=users&layout=modal&tmpl=component&field=' .
$this->id
// Initialize some field attributes.
$attr =
!empty($this->class) ?
' class="' .
$this->class .
'"' :
'';
$attr .=
!empty($this->size) ?
' size="' .
$this->size .
'"' :
'';
$attr .=
$this->required ?
' required' :
'';
// Load the modal behavior script.
JHtml::_('behavior.modal', 'a.modal_' .
$this->id);
$script[] =
' function jSelectUser_' .
$this->id .
'(id, title) {';
$script[] =
' var old_id = document.getElementById("' .
$this->id .
'_id").value;';
$script[] =
' if (old_id != id) {';
$script[] =
' document.getElementById("' .
$this->id .
'_id").value = id;';
$script[] =
' document.getElementById("' .
$this->id .
'").value = title;';
$script[] =
' document.getElementById("' .
$this->id .
'").className = document.getElementById("' .
$this->id .
'").className.replace(" invalid" , "");';
$script[] =
' SqueezeBox.close();';
// Add the script to the document head.
// Load the current username if available.
$table->load($this->value);
// Handle the special case for "current".
$table->username =
JText::_('JLIB_FORM_SELECT_USER');
// Create a dummy text field with the user name.
$html[] =
'<div class="input-append">';
$html[] =
' <input type="text" id="' .
$this->id .
'" value="' .
htmlspecialchars($table->name, ENT_COMPAT, 'UTF-8') .
'"'
.
' readonly' .
$attr .
' />';
// Create the user select button.
$html[] =
' <a class="btn btn-primary modal_' .
$this->id .
'" title="' .
JText::_('JLIB_FORM_CHANGE_USER') .
'" href="' .
$link .
'"'
.
' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
$html[] =
'<i class="icon-user"></i></a>';
// Create the real field, hidden, that stored the user id.
$html[] =
'<input type="hidden" id="' .
$this->id .
'_id" name="' .
$this->name .
'" value="' . (int)
$this->value .
'" />';
* Method to get the filtering groups (null means no filtering)
* @return mixed array of filtering groups or null.
* Method to get the users to exclude from the list of users
* @return mixed Array of users to exclude or null to to not exclude them
Documentation generated on Tue, 19 Nov 2013 15:16:20 +0100 by phpDocumentor 1.4.3