Skip to content

Commit

Permalink
[4.0] Remove module description popover (joomla#24634)
Browse files Browse the repository at this point in the history
When you go to select a NEW module you have a list of all the modules with a very short 90 character truncated description.

If you hover over that description you get a popover with a short 200 character truncated description.

This popover is not accessible - I doubt even most sighted users will know that it even exists as there is no visual indicator that it exists either.

The original reason for the 90 character truncation was back in the day that this was a modal and there was limited space. That is no longer true  but we do need to have some form of truncation as some 3pd write essays for the description ;)

This PR removes the popover and changes the displayed description to the 200 character version
  • Loading branch information
brianteeman authored and fancyFranci committed Apr 24, 2019
1 parent 84ae714 commit 462ba2e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions administrator/components/com_modules/tmpl/select/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,25 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

HTMLHelper::_('bootstrap.popover');
$document = Factory::getDocument();
?>

<h2 class="mb-3"><?php echo Text::_('COM_MODULES_TYPE_CHOOSE'); ?></h2>
<ul id="new-modules-list" class="list-group">
<?php foreach ($this->items as &$item) : ?>
<?php // Prepare variables for the link. ?>
<?php $link = 'index.php?option=com_modules&task=module.add&eid=' . $item->extension_id; ?>
<?php $name = $this->escape($item->name); ?>
<?php $desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 200); ?>
<?php $short_desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 90); ?>
<?php $link = 'index.php?option=com_modules&task=module.add&eid=' . $item->extension_id; ?>
<?php $name = $this->escape($item->name); ?>
<?php $desc = HTMLHelper::_('string.truncate', $this->escape(strip_tags($item->desc)), 200); ?>

<?php if ($document->direction != 'rtl') : ?>
<li class="list-group-item">
<a href="<?php echo Route::_($link); ?>" class="mr-2">
<strong><?php echo $name; ?></strong></a>
<small class="hasPopover" data-placement="right" title="<?php echo $name; ?>" data-content="<?php echo $desc; ?>"><?php echo $short_desc; ?></small>
<a href="<?php echo Route::_($link); ?>" class="mr-2"><strong><?php echo $name; ?></strong></a>
<small><?php echo $desc; ?></small>
</li>
<?php else : ?>
<li class="list-group-item">
<small rel="popover" data-placement="left" title="<?php echo $name; ?>" data-content="<?php echo $desc; ?>"><?php echo $short_desc; ?></small>
<small><?php echo $desc; ?></small>
<a href="<?php echo Route::_($link); ?>" class="mr-2"><strong><?php echo $name; ?></strong></a>
</li>
<?php endif; ?>
Expand Down

0 comments on commit 462ba2e

Please sign in to comment.