Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 24780-registration-date
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Dec 30, 2019
2 parents 6c07700 + 28974f6 commit 3c8bceb
Show file tree
Hide file tree
Showing 96 changed files with 286 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function getOptions()
$canCreate = AssociationsHelper::allowAdd($extensionName, $typeName);

// Gets existing languages.
$existingLanguages = LanguageHelper::getContentLanguages(array(0, 1));
$existingLanguages = LanguageHelper::getContentLanguages(array(0, 1), false);

$options = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,17 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId
$titleFieldName = self::getTypeFieldName($extensionName, $typeName, 'title');

// Get all content languages.
$languages = LanguageHelper::getContentLanguages(array(0, 1));
$languages = LanguageHelper::getContentLanguages(array(0, 1), false);
$content_languages = array_column($languages, 'lang_code');

// Display warning if Content Language is trashed or deleted
foreach ($items as $item)
{
if (!in_array($item['language'], $content_languages))
{
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_ASSOCIATIONS_CONTENTLANGUAGE_WARNING', $item['language']), 'warning');
}
}

$canEditReference = self::allowEdit($extensionName, $typeName, $itemId);
$canCreate = self::allowAdd($extensionName, $typeName);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_banners/tmpl/banners/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<input type="text" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function fetchAssociations()
$associations[$lang]->title = $categoryTable->title;
}

$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1), false));

if (count($associations) == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function getInput()
$allowSelect = ((string) $this->element['select'] != 'false');
$allowPropagate = ((string) $this->element['propagate'] == 'true');

$languages = LanguageHelper::getContentLanguages(array(0, 1));
$languages = LanguageHelper::getContentLanguages(array(0, 1), false);

// Load language.
Factory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
// Association category items
if ($this->getAssoc())
{
$languages = LanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc');
$languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc');

if (count($languages) > 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Categories\Administrator\Helper\CategoriesHelper;
Expand Down Expand Up @@ -70,16 +72,27 @@ public function association($catid, $extension = 'com_content')

if ($items)
{
$languages = LanguageHelper::getContentLanguages(array(0, 1));
$content_languages = array_column($languages, 'lang_code');

foreach ($items as &$item)
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX';
$url = Route::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8');
$classes = 'badge badge-secondary';
if (in_array($item->lang_code, $content_languages))
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX';
$url = Route::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8');
$classes = 'badge badge-secondary';

$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
}
else
{
// Display warning if Content Language is trashed or deleted
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_ASSOCIATIONS_CONTENTLANGUAGE_WARNING', $item->lang_code), 'warning');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<span class="fa fa-ellipsis-v"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->lft; ?>">
<input type="text" class="hidden" name="order[]" size="5" value="<?php echo $item->lft; ?>">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function fetchAssociations()
$associations[$lang]->title = $contactTable->name;
}

$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1), false));

if (count($associations) == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function getInput()
$allowSelect = ((string) $this->element['select'] != 'false');
$allowPropagate = ((string) $this->element['propagate'] == 'true');

$languages = LanguageHelper::getContentLanguages(array(0, 1));
$languages = LanguageHelper::getContentLanguages(array(0, 1), false);

// Load language
Factory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
// Association contact items
if (Associations::isEnabled())
{
$languages = LanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc');
$languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc');

if (count($languages) > 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Expand Down Expand Up @@ -81,16 +82,27 @@ public function association($contactid)

if ($items)
{
$languages = LanguageHelper::getContentLanguages(array(0, 1));
$content_languages = array_column($languages, 'lang_code');

foreach ($items as &$item)
{
$text = strtoupper($item->lang_sef);
$url = Route::_('index.php?option=com_contact&task=contact.edit&id=' . (int) $item->id);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br>' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'badge badge-secondary';
if (in_array($item->lang_code, $content_languages))
{
$text = strtoupper($item->lang_sef);
$url = Route::_('index.php?option=com_contact&task=contact.edit&id=' . (int) $item->id);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br>' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'badge badge-secondary';

$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
}
else
{
// Display warning if Content Language is trashed or deleted
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_ASSOCIATIONS_CONTENTLANGUAGE_WARNING', $item->lang_code), 'warning');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<input type="text" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function fetchAssociations()
$associations[$lang]->title = $contentTable->title;
}

$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1), false));

if (count($associations) == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function getInput()
$allowSelect = ((string) $this->element['select'] != 'false');
$allowPropagate = ((string) $this->element['propagate'] == 'true');

$languages = LanguageHelper::getContentLanguages(array(0, 1));
$languages = LanguageHelper::getContentLanguages(array(0, 1), false);

// Load language
Factory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ protected function preprocessForm(Form $form, $data, $group = 'content')
// Association content items
if (Associations::isEnabled())
{
$languages = LanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc');
$languages = LanguageHelper::getContentLanguages(false, false, null, 'ordering', 'asc');

if (count($languages) > 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Expand Down Expand Up @@ -74,16 +75,27 @@ public function association($articleid)

if ($items)
{
$languages = LanguageHelper::getContentLanguages(array(0, 1));
$content_languages = array_column($languages, 'lang_code');

foreach ($items as &$item)
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX';
$url = Route::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br>' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'badge badge-secondary';
if (in_array($item->lang_code, $content_languages))
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX';
$url = Route::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id);
$tooltip = '<strong>' . htmlspecialchars($item->language_title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br>' . Text::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'badge badge-secondary';

$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '">' . $text . '</a>'
. '<div role="tooltip" id="tip' . (int) $item->id . '">' . $tooltip . '</div>';
}
else
{
// Display warning if Content Language is trashed or deleted
Factory::getApplication()->enqueueMessage(Text::sprintf('JGLOBAL_ASSOCIATIONS_CONTENTLANGUAGE_WARNING', $item->lang_code), 'warning');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php endif; ?>
</td>
<td class="text-center d-none d-md-table-cell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<input type="text" class="hidden" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<input type="text" class="hidden" name="order[]" size="5" value="<?php echo $item->ordering; ?>">
<?php endif; ?>
</td>
<td class="text-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<?php endif; ?>

<div id="download-message" style="display:none">
<div id="download-message" class="hidden">
<p class="nowarning"><?php echo Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS'); ?></p>
<div class="joomlaupdate_spinner"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

/** @var JoomlaupdateViewDefault $this */
?>
<fieldset>
<legend>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES'); ?>
<?php echo Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES'); ?>
</legend>
<p>
<?php echo JText::sprintf($this->langKey, $this->updateSourceKey); ?>
<?php echo Text::sprintf($this->langKey, $this->updateSourceKey); ?>
</p>
<div class="alert alert-success">
<?php echo JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE', JVERSION); ?>
<?php echo Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE', JVERSION); ?>
</div>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<span class="sortable-handler <?php echo $disableClassName; ?>" title="<?php echo $disabledLabel; ?>">
<span class="fa fa-ellipsis-v" aria-hidden="true"></span>
</span>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
<?php else : ?>
<span class="sortable-handler inactive">
<span class="icon-menu" aria-hidden="true"></span>
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_mails/Model/TemplateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Table\Table;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
Expand Down Expand Up @@ -286,7 +287,7 @@ public function save($data)
$isNew = true;

// Include the plugins for the save events.
\JPluginHelper::importPlugin($this->events_map['save']);
PluginHelper::importPlugin($this->events_map['save']);

// Allow an exception to be thrown.
try
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_mails/tmpl/template/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
</div>
<?php endif; ?>

<?php echo JHtml::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>

<?php if (count($this->form->getFieldset('basic'))) : ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php endif; ?>

<?php echo JHtml::_('uitab.endTabSet'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div>
<?php echo $this->form->renderField('template_id'); ?>
<?php echo $this->form->renderField('language'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
</td>
<td class="d-md-table-cell">
<?php foreach ($this->languages as $language) : ?>
<?php $exists = in_array($language->lang_code, $item->languages); ?>
<a href="<?php echo Route::_('index.php?option=com_mails&task=template.edit&template_id=' . $item->template_id . '&language=' . $language->lang_code); ?>"
<?php echo !$exists ? ' style=""' : ''; ?>>
<a href="<?php echo Route::_('index.php?option=com_mails&task=template.edit&template_id=' . $item->template_id . '&language=' . $language->lang_code); ?>">
<?php if ($language->image) : ?>
<?php echo HTMLHelper::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true); ?>
<?php else : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function fetchAssociations()
$associations[$lang]->title = $menuTable->title;
}

$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1)));
$countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1), false));

if (count($associations) == 0)
{
Expand Down

0 comments on commit 3c8bceb

Please sign in to comment.