32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-26 18:10:11 +00:00

Replace JHtml with HTMLHelper

This commit is contained in:
Tuan Pham Ngoc 2021-07-01 21:37:36 +07:00
parent 84d245a445
commit 4d3e52bd73
8 changed files with 38 additions and 30 deletions

View File

@ -212,7 +212,7 @@ class WeblinkField extends FormField
// New weblink modal // New weblink modal
if ($allowNew) if ($allowNew)
{ {
$html .= \JHtml::_( $html .= HTMLHelper::_(
'bootstrap.renderModal', 'bootstrap.renderModal',
'ModalNew' . $modalId, 'ModalNew' . $modalId,
array( array(

View File

@ -9,8 +9,9 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
JHtml::_('behavior.formvalidator'); HTMLHelper::_('behavior.formvalidator');
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$input = $app->input; $input = $app->input;
@ -32,9 +33,9 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
<div class="form-horizontal"> <div class="form-horizontal">
<?php echo JHtml::_('uitab.startTabSet', 'myTab', array('active' => 'details')); ?> <?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'details')); ?>
<?php echo JHtml::_('uitab.addTab', 'myTab', 'details', empty($this->item->id) ? JText::_('COM_WEBLINKS_NEW_WEBLINK', true) : JText::_('COM_WEBLINKS_EDIT_WEBLINK', true)); ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', empty($this->item->id) ? JText::_('COM_WEBLINKS_NEW_WEBLINK', true) : JText::_('COM_WEBLINKS_EDIT_WEBLINK', true)); ?>
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
<div class="form-vertical"> <div class="form-vertical">
@ -46,9 +47,9 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo JLayoutHelper::render('joomla.edit.global', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
</div> </div>
</div> </div>
<?php echo JHtml::_('uitab.endTab'); ?> <?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo JHtml::_('uitab.addTab', 'myTab', 'images', JText::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'images', JText::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<?php echo $this->form->renderField('images'); ?> <?php echo $this->form->renderField('images'); ?>
@ -58,9 +59,9 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
</div> </div>
</div> </div>
<?php echo JHtml::_('uitab.endTab'); ?> <?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo JHtml::_('uitab.addTab', 'myTab', 'publishing', JText::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', JText::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
<div class="row form-horizontal-desktop"> <div class="row form-horizontal-desktop">
<div class="col-md-6"> <div class="col-md-6">
<?php echo JLayoutHelper::render('joomla.edit.publishingdata', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.publishingdata', $this); ?>
@ -69,23 +70,23 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo JLayoutHelper::render('joomla.edit.metadata', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.metadata', $this); ?>
</div> </div>
</div> </div>
<?php echo JHtml::_('uitab.endTab'); ?> <?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if (!$isModal && $assoc) : ?> <?php if (!$isModal && $assoc) : ?>
<?php echo JHtml::_('uitab.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<?php echo $this->loadTemplate('associations'); ?> <?php echo $this->loadTemplate('associations'); ?>
<?php echo JHtml::_('uitab.endTab'); ?> <?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php elseif ($isModal && $assoc) : ?> <?php elseif ($isModal && $assoc) : ?>
<div class="hidden"><?php echo $this->loadTemplate('associations'); ?></div> <div class="hidden"><?php echo $this->loadTemplate('associations'); ?></div>
<?php endif; ?> <?php endif; ?>
<?php echo JHtml::_('uitab.endTabSet'); ?> <?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div> </div>
<input type="hidden" name="task" value="" /> <input type="hidden" name="task" value="" />
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>" /> <input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>" />
<?php echo JHtml::_('form.token'); ?> <?php echo HTMLHelper::_('form.token'); ?>
</form> </form>

View File

@ -7,7 +7,10 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt * @license GNU General Public License version 2 or later; see LICENSE.txt
*/ */
defined('_JEXEC') or die; defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
use Joomla\CMS\HTML\HTMLHelper;
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0. // @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0.
$function = JFactory::getApplication()->input->getCmd('function', 'jEditWeblink_' . (int) $this->item->id); $function = JFactory::getApplication()->input->getCmd('function', 'jEditWeblink_' . (int) $this->item->id);

View File

@ -18,7 +18,7 @@ use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\Weblinks\Administrator\View\Weblinks\HtmlView $this */ /** @var \Joomla\Component\Weblinks\Administrator\View\Weblinks\HtmlView $this */
JHtml::_('behavior.multiselect'); HTMLHelper::_('behavior.multiselect');
$user = Factory::getApplication()->getIdentity(); $user = Factory::getApplication()->getIdentity();
$userId = $user->get('id'); $userId = $user->get('id');
@ -65,13 +65,13 @@ if ($saveOrder && !empty($this->items))
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?> <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th> </th>
<th scope="col"> <th scope="col">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?> <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th> </th>
<th scope="col" class="w-10 d-none d-md-table-cell"> <th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
</th> </th>
<th scope="col" class="w-10 d-none d-md-table-cell"> <th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?> <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
</th> </th>
<?php if ($assoc) : ?> <?php if ($assoc) : ?>
<th scope="col" class="w-10"> <th scope="col" class="w-10">
@ -84,7 +84,7 @@ if ($saveOrder && !empty($this->items))
</th> </th>
<?php endif; ?> <?php endif; ?>
<th scope="col" class="w-5 d-none d-md-table-cell"> <th scope="col" class="w-5 d-none d-md-table-cell">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -152,7 +152,7 @@ if ($saveOrder && !empty($this->items))
<?php if ($assoc) : ?> <?php if ($assoc) : ?>
<td class="hidden-phone hidden-tablet"> <td class="hidden-phone hidden-tablet">
<?php if ($item->association) : ?> <?php if ($item->association) : ?>
<?php echo JHtml::_('weblinksadministrator.association', $item->id); ?> <?php echo HTMLHelper::_('weblinksadministrator.association', $item->id); ?>
<?php endif; ?> <?php endif; ?>
</td> </td>
<?php endif; ?> <?php endif; ?>

View File

@ -9,9 +9,10 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Component\Weblinks\Site\Helper\RouteHelper; use Joomla\Component\Weblinks\Site\Helper\RouteHelper;
JHtml::_('bootstrap.tooltip'); HTMLHelper::_('bootstrap.tooltip');
$class = ' class="first"'; $class = ' class="first"';
@ -31,7 +32,7 @@ if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) :
<a href="<?php echo JRoute::_(RouteHelper::getCategoryRoute($item->id));?>"> <a href="<?php echo JRoute::_(RouteHelper::getCategoryRoute($item->id));?>">
<?php echo $this->escape($item->title); ?></a> <?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_num_links_cat') == 1) :?> <?php if ($this->params->get('show_cat_num_links_cat') == 1) :?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::tooltipText('COM_WEBLINKS_NUM_ITEMS'); ?>"> <span class="badge badge-info tip hasTooltip" title="<?php echo HTMLHelper::tooltipText('COM_WEBLINKS_NUM_ITEMS'); ?>">
<?php echo $item->numitems; ?> <?php echo $item->numitems; ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
@ -43,7 +44,7 @@ if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) :
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?> <?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
<?php if ($item->description) : ?> <?php if ($item->description) : ?>
<div class="category-desc"> <div class="category-desc">
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_weblinks.categories'); ?> <?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_weblinks.categories'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>

View File

@ -9,6 +9,7 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Component\Weblinks\Site\Helper\RouteHelper; use Joomla\Component\Weblinks\Site\Helper\RouteHelper;
$class = ' class="first"'; $class = ' class="first"';
@ -32,7 +33,7 @@ if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) :
<?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($this->params->get('show_subcat_desc') == 1) :?>
<?php if ($child->description) : ?> <?php if ($child->description) : ?>
<div class="category-desc"> <div class="category-desc">
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_weblinks.category'); ?> <?php echo HTMLHelper::_('content.prepare', $child->description, '', 'com_weblinks.category'); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>

View File

@ -9,7 +9,9 @@
defined('_JEXEC') or die; defined('_JEXEC') or die;
// JHtml::_('behavior.framework'); use Joomla\CMS\HTML\HTMLHelper;
// HTMLHelper::_('behavior.framework');
// Create a shortcut for params. // Create a shortcut for params.
$params = &$this->category->params; $params = &$this->category->params;
@ -67,7 +69,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php if ($canEdit) : ?> <?php if ($canEdit) : ?>
<span class="list-edit pull-left width-50"> <span class="list-edit pull-left width-50">
<?php echo JHtml::_('weblinkicon.edit', $item, $params); ?> <?php echo HTMLHelper::_('weblinkicon.edit', $item, $params); ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
@ -76,7 +78,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php echo JText::_('COM_WEBLINKS_LINK'); ?> <?php echo JText::_('COM_WEBLINKS_LINK'); ?>
<?php elseif ($this->params->get('icons', 1) == 1) : ?> <?php elseif ($this->params->get('icons', 1) == 1) : ?>
<?php if (!$this->params->get('link_icons')) : ?> <?php if (!$this->params->get('link_icons')) : ?>
<?php echo JHtml::_('image', 'system/weblink.png', JText::_('COM_WEBLINKS_LINK'), null, true); ?> <?php echo HTMLHelper::_('image', 'system/weblink.png', JText::_('COM_WEBLINKS_LINK'), null, true); ?>
<?php else: ?> <?php else: ?>
<?php echo '<img src="' . $this->params->get('link_icons') . '" alt="' . JText::_('COM_WEBLINKS_LINK') . '" />'; ?> <?php echo '<img src="' . $this->params->get('link_icons') . '" alt="' . JText::_('COM_WEBLINKS_LINK') . '" />'; ?>
<?php endif; ?> <?php endif; ?>
@ -111,7 +113,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
break; break;
case 3: case 3:
// Open in a modal window // Open in a modal window
JHtml::_('behavior.modal', 'a.modal'); HTMLHelper::_('behavior.modal', 'a.modal');
echo '<a class="modal" href="' . $link . '" rel="{handler: \'iframe\', size: {x:' . $this->escape($width) . ', y:' . $this->escape($height) . '}}">' . echo '<a class="modal" href="' . $link . '" rel="{handler: \'iframe\', size: {x:' . $this->escape($width) . ', y:' . $this->escape($height) . '}}">' .
$this->escape($item->title) . ' </a>'; $this->escape($item->title) . ' </a>';
break; break;

View File

@ -13,7 +13,7 @@ use Joomla\CMS\HTML\HTMLHelper;
HTMLHelper::_('behavior.keepalive'); HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('behavior.formvalidator'); HTMLHelper::_('behavior.formvalidator');
// JHtml::_('behavior.modal', 'a.modal_jform_contenthistory'); // HTMLHelper::_('behavior.modal', 'a.modal_jform_contenthistory');
$captchaEnabled = false; $captchaEnabled = false;
$captchaSet = $this->params->get('captcha', JFactory::getApplication()->get('captcha', '0')); $captchaSet = $this->params->get('captcha', JFactory::getApplication()->get('captcha', '0'));
@ -92,6 +92,6 @@ $params = $this->state->get('params');
<input type="hidden" name="return" value="<?php echo $this->return_page;?>" /> <input type="hidden" name="return" value="<?php echo $this->return_page;?>" />
<input type="hidden" name="task" value="" /> <input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?> <?php echo HTMLHelper::_('form.token'); ?>
</form> </form>
</div> </div>