| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/administrator/components/com_jlexreview/models/fields/ |
Upload File : |
<?php
/**
* @package JLex Review
* @version 4.2.3
* @copyright Copyright (c) 2013-2018 JLexArt. All rights reserved
* @license GNU General Public License version 2 or later;
* @author www.jlexart.com
*/
defined('_JEXEC') or die;
class JFormFieldModal_JUser extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Modal_JUser';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
$app = JFactory::getApplication();
// Build the script.
$script = array();
// Select button script
$script[] = ' function jSelectJUser_' . $this->id . '(_el) {';
$script[] = ' document.getElementById("' . $this->id . '_id").value = jQuery(_el).attr("data-user-value");';
$script[] = ' document.getElementById("' . $this->id . '_name").value = jQuery(_el).attr("data-user-name");';
$script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");';
if (JE_JVERSION=="J3")
{
$script[] = ' jQuery("#modalJUser' . $this->id . '").modal("hide");';
} else {
$script[] = ' SqueezeBox.close();';
}
$script[] = ' }';
// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
// Setup variables for display.
$html = array();
if ($app->isClient("site"))
{
$link = 'index.php?option=com_jlexreview&view=others&task=users&tmpl=component';
} else {
$link = '';
}
$link .= '&function=jSelectJUser_' . $this->id;
if ((int) $this->value > 0)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select("id,name")
->from($db->quoteName('#__users'))
->where($db->quoteName('id') . ' = ' . (int) $this->value);
$db->setQuery($query);
$item = $db->loadObject();
if (!$item)
{
$title = JText::_('JLIB_FORM_SELECT_USER');
} else {
$title = $item->name;
}
}
if (empty($title))
{
$title = JText::_('JLIB_FORM_SELECT_USER');
}
$title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
// The active article id field.
if (0 == (int) $this->value)
{
$value = '';
} else {
$value = (int) $this->value;
}
// The current article display field.
$html[] = '<span class="input-append">';
$html[] = '<input type="text" class="input-medium" id="' . $this->id . '_name" value="' . $title . '" disabled="disabled" size="35" />';
$html[] = '<a href="#modalJUser' . $this->id . '" class="btn hasTooltip btn-primary" role="button" data-toggle="modal" title="'
. JHtml::tooltipText( JText::_('JLIB_FORM_SELECT_USER') ) . '">'
. '<span class="icon-file"></span> '
. JText::_('JSELECT') . '</a>';
$html[] = JHtml::_(
'bootstrap.renderModal',
'modalJUser' . $this->id,
array(
'url' => $link,
'title' => JText::_('JLIB_FORM_SELECT_USER'),
'width' => '800px',
'height' => '400px',
'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
)
);
$html[] = '</span>';
$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . $value . '" />';
return implode("\n", $html);
}
}