32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-26 01:57:30 +00:00

Replace JText with use Joomla\CMS\Language\Text;

This commit is contained in:
Tuan Pham Ngoc 2021-07-01 21:41:54 +07:00
parent 4d3e52bd73
commit bab5787a77
9 changed files with 39 additions and 24 deletions

View File

@ -9,6 +9,8 @@
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
/**
* Installation class to perform additional changes during install/uninstall/update
*
@ -56,7 +58,7 @@ class Com_WeblinksInstallerScript
// Check to make sure our data is valid
if (!$category->check())
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
JFactory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
return;
}
@ -64,7 +66,7 @@ class Com_WeblinksInstallerScript
// Now store the category
if (!$category->store(true))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
JFactory::getApplication()->enqueueMessage(Text::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
return;
}

View File

@ -10,6 +10,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
HTMLHelper::_('behavior.formvalidator');
@ -35,7 +36,7 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<div class="form-horizontal">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'details')); ?>
<?php echo HTMLHelper::_('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) ? Text::_('COM_WEBLINKS_NEW_WEBLINK', true) : Text::_('COM_WEBLINKS_EDIT_WEBLINK', true)); ?>
<div class="row">
<div class="col-md-9">
<div class="form-vertical">
@ -49,7 +50,7 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'images', JText::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'images', Text::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
<div class="row">
<div class="col-md-6">
<?php echo $this->form->renderField('images'); ?>
@ -61,7 +62,7 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', JText::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
<div class="row form-horizontal-desktop">
<div class="col-md-6">
<?php echo JLayoutHelper::render('joomla.edit.publishingdata', $this); ?>
@ -75,7 +76,7 @@ $tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=c
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if (!$isModal && $assoc) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<?php echo $this->loadTemplate('associations'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php elseif ($isModal && $assoc) : ?>

View File

@ -9,11 +9,13 @@
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$fieldSets = $this->form->getFieldsets('params'); ?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<div class="tab-pane" id="params-<?php echo $name; ?>">
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
<?php echo '<p class="alert alert-info">' . $this->escape(Text::_($fieldSet->description)) . '</p>'; ?>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<div class="control-group">

View File

@ -9,11 +9,13 @@
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$fieldSets = $this->form->getFieldsets('params'); ?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<div class="tab-pane" id="params-<?php echo $name; ?>">
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
<?php echo '<p class="alert alert-info">' . $this->escape(Text::_($fieldSet->description)) . '</p>'; ?>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<div class="control-group">

View File

@ -8,10 +8,12 @@
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<a class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value='';document.getElementById('batch-user-id').value='';document.getElementById('batch-tag-id').value=''" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</a>
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('weblink.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -10,6 +10,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Component\Weblinks\Site\Helper\RouteHelper;
$class = ' class="first"';
@ -40,7 +41,7 @@ if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) :
<?php if ($this->params->get('show_cat_num_links') == 1) :?>
<dl class="weblink-count"><dt>
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
<?php echo Text::_('COM_WEBLINKS_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>

View File

@ -10,6 +10,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
// HTMLHelper::_('behavior.framework');
@ -30,7 +31,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p> <?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
<p> <?php echo Text::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
<?php else : ?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
@ -38,15 +39,15 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field') != 'hide') : ?>
<div class="btn-group">
<label class="filter-search-lbl element-invisible" for="filter-search"><?php echo JText::_('COM_WEBLINKS_FILTER_LABEL') . '&#160;'; ?></label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" />
<label class="filter-search-lbl element-invisible" for="filter-search"><?php echo Text::_('COM_WEBLINKS_FILTER_LABEL') . '&#160;'; ?></label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo Text::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group pull-right">
<label for="limit" class="element-invisible">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
@ -63,7 +64,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php endif; ?>
<?php if ($this->params->get('show_link_hits', 1)) : ?>
<span class="list-hits badge badge-info pull-right">
<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
</span>
<?php endif; ?>
@ -75,12 +76,12 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<div class="list-title">
<?php if ($this->params->get('icons', 1) == 0) : ?>
<?php echo JText::_('COM_WEBLINKS_LINK'); ?>
<?php echo Text::_('COM_WEBLINKS_LINK'); ?>
<?php elseif ($this->params->get('icons', 1) == 1) : ?>
<?php if (!$this->params->get('link_icons')) : ?>
<?php echo HTMLHelper::_('image', 'system/weblink.png', JText::_('COM_WEBLINKS_LINK'), null, true); ?>
<?php echo HTMLHelper::_('image', 'system/weblink.png', Text::_('COM_WEBLINKS_LINK'), null, true); ?>
<?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="' . Text::_('COM_WEBLINKS_LINK') . '" />'; ?>
<?php endif; ?>
<?php endif; ?>
<?php // Compute the correct link ?>
@ -93,7 +94,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php $height = 500; ?>
<?php endif; ?>
<?php if ($this->items[$i]->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<span class="label label-warning"><?php echo Text::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php

View File

@ -10,6 +10,7 @@
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('behavior.formvalidator');
@ -75,12 +76,12 @@ $params = $this->state->get('params');
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('weblink.save')">
<span class="icon-ok"></span> <?php echo JText::_('JSAVE') ?>
<span class="icon-ok"></span> <?php echo Text::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('weblink.cancel')">
<span class="icon-cancel"></span> <?php echo JText::_('JCANCEL') ?>
<span class="icon-cancel"></span> <?php echo Text::_('JCANCEL') ?>
</button>
</div>
<?php if ($params->get('save_history', 0)) : ?>

View File

@ -8,6 +8,9 @@
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<?php if ($params->get('groupby', 0)) : ?>
@ -64,7 +67,7 @@ defined('_JEXEC') or die;
<?php endif; ?>
<?php if ($params->get('hits', 0)) : ?>
<?php echo '(' . $item->hits . ' ' . JText::_('MOD_WEBLINKS_HITS') . ')'; ?>
<?php echo '(' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . ')'; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
@ -109,7 +112,7 @@ defined('_JEXEC') or die;
<?php endif; ?>
<?php if ($params->get('hits', 0)) : ?>
<?php echo '(' . $item->hits . ' ' . JText::_('MOD_WEBLINKS_HITS') . ')'; ?>
<?php echo '(' . $item->hits . ' ' . Text::_('MOD_WEBLINKS_HITS') . ')'; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>