Skip to content

Commit

Permalink
Namespace JText and JHtml (#20006)
Browse files Browse the repository at this point in the history
  • Loading branch information
hans2103 authored and wilsonge committed Mar 28, 2018
1 parent b2a6817 commit 5daa5bc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions templates/cassiopeia/html/layouts/joomla/form/field/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;

extract($displayData);

/**
Expand Down Expand Up @@ -53,15 +56,15 @@
. (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : '');

// Invalidate the input value if no user selected
if (JText::_('JLIB_FORM_SELECT_USER') === htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'))
if (Text::_('JLIB_FORM_SELECT_USER') === htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'))
{
$userName = '';
}

if (!$readonly)
{
JHtml::_('jquery.framework');
JHtml::_('script', 'system/fields/fielduser.min.js', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('jquery.framework');
HTMLHelper::_('script', 'system/fields/fielduser.min.js', ['version' => 'auto', 'relative' => true]);
}
?>
<?php // Create a dummy text field with the user name. ?>
Expand All @@ -78,20 +81,20 @@
<input
type="text" id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($userName, ENT_COMPAT, 'UTF-8'); ?>"
placeholder="<?php echo JText::_('JLIB_FORM_SELECT_USER'); ?>"
placeholder="<?php echo Text::_('JLIB_FORM_SELECT_USER'); ?>"
readonly
class="field-user-input-name <?php echo $class ? (string) $class : ''?>"
<?php echo $size ? ' size="' . (int) $size . '"' : ''; ?>
<?php echo $required ? 'required' : ''; ?>/>
<?php if (!$readonly) : ?>
<a class="btn btn-primary button-select" title="<?php echo JText::_('JLIB_FORM_CHANGE_USER') ?>"><span class="icon-user"></span></a>
<?php echo JHtml::_(
<a class="btn btn-primary button-select" title="<?php echo Text::_('JLIB_FORM_CHANGE_USER') ?>"><span class="icon-user"></span></a>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'userModal_' . $id,
[
'title' => JText::_('JLIB_FORM_CHANGE_USER'),
'title' => Text::_('JLIB_FORM_CHANGE_USER'),
'closeButton' => true,
'footer' => '<a type="button" class="btn" data-dismiss="modal">' . JText::_('JCANCEL') . '</a>',
'footer' => '<a type="button" class="btn" data-dismiss="modal">' . Text::_('JCANCEL') . '</a>',
]
); ?>
<?php endif; ?>
Expand Down

0 comments on commit 5daa5bc

Please sign in to comment.