Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 8 additions & 46 deletions administrator/components/com_content/src/Service/HTML/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ public function edit($article, $params, $attribs = array(), $legacy = false)
return;
}

// Set the link class
$attribs['class'] = 'dropdown-item';

// Show checked_out icon if the article is checked out by a different user
if (property_exists($article, 'checked_out')
&& property_exists($article, 'checked_out_time')
Expand All @@ -130,11 +127,13 @@ public function edit($article, $params, $attribs = array(), $legacy = false)
{
$checkoutUser = Factory::getUser($article->checked_out);
$date = HTMLHelper::_('date', $article->checked_out_time);
$tooltip = Text::_('JLIB_HTML_CHECKED_OUT') . ' :: ' . Text::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name)
$tooltip = Text::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name)
. ' <br> ' . $date;

$text = LayoutHelper::render('joomla.content.icons.edit_lock', array('tooltip' => $tooltip, 'legacy' => $legacy));
$text = LayoutHelper::render('joomla.content.icons.edit_lock', array('article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy));

$attribs['role'] = 'button';
$attribs['aria-describedby'] = 'editarticle-' . (int) $article->id;
$output = HTMLHelper::_('link', '#', $text, $attribs);

return $output;
Expand All @@ -145,58 +144,21 @@ public function edit($article, $params, $attribs = array(), $legacy = false)

if ($article->state == Workflow::CONDITION_UNPUBLISHED)
{
$overlib = Text::_('JUNPUBLISHED');
$tooltip = Text::_('COM_CONTENT_EDIT_UNPUBLISHED_ARTICLE');
}
else
{
$overlib = Text::_('JPUBLISHED');
$tooltip = Text::_('COM_CONTENT_EDIT_PUBLISHED_ARTICLE');
}

$date = HTMLHelper::_('date', $article->created);
$author = $article->created_by_alias ?: $article->author;

$overlib .= '&lt;br&gt;';
$overlib .= $date;
$overlib .= '&lt;br&gt;';
$overlib .= Text::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));

$text = LayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'overlib' => $overlib, 'legacy' => $legacy));
$text = LayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'tooltip' => $tooltip, 'legacy' => $legacy));

$attribs['title'] = Text::_('JGLOBAL_EDIT_TITLE');
$attribs['aria-describedby'] = 'editarticle-' . (int) $article->id;
$output = HTMLHelper::_('link', Route::_($url), $text, $attribs);

return $output;
}

/**
* Method to generate a popup link to print an article
*
* @param object $article The article information
* @param Registry $params The item parameters
* @param array $attribs Optional attributes for the link
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML markup for the popup link
*
* @since 4.0.0
*/
public function print_popup($article, $params, $attribs = array(), $legacy = false)
{
$url = RouteHelper::getArticleRoute($article->slug, $article->catid, $article->language);
$url .= '&tmpl=component&print=1&layout=default';

$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';

$text = LayoutHelper::render('joomla.content.icons.print_popup', array('params' => $params, 'legacy' => $legacy));

$attribs['title'] = Text::sprintf('JGLOBAL_PRINT_TITLE', htmlspecialchars($article->title, ENT_QUOTES, 'UTF-8'));
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$attribs['rel'] = 'nofollow';
$attribs['class'] = 'dropdown-item';

return HTMLHelper::_('link', Route::_($url), $text, $attribs);
}

/**
* Method to generate a link to print an article
*
Expand Down
3 changes: 2 additions & 1 deletion language/en-GB/com_content.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ COM_CONTENT_CONTENT_TYPE_CATEGORY="Article Category"
COM_CONTENT_CREATE_ARTICLE="Submit new article"
COM_CONTENT_CREATED_DATE="Created Date"
COM_CONTENT_CREATED_DATE_ON="Created: %s"
COM_CONTENT_EDIT_ITEM="Edit Article"
COM_CONTENT_EDIT_PUBLISHED_ARTICLE="Published Article"
COM_CONTENT_EDIT_UNPUBLISHED_ARTICLE="Unpublished Article"
COM_CONTENT_ERROR_ARTICLE_NOT_FOUND="Article not found"
COM_CONTENT_ERROR_LOGIN_TO_VIEW_ARTICLE="Please login to view the article"
COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND="Parent category not found"
Expand Down
11 changes: 2 additions & 9 deletions layouts/joomla/content/icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,16 @@

defined('_JEXEC') or die;

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

$canEdit = $displayData['params']->get('access-edit');
$articleId = $displayData['item']->id;
?>

<?php if ($canEdit) : ?>
<div class="icons">
<?php Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('bootstrap.js.bundle'); ?>
<div class="btn-group float-right">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton-<?php echo $articleId; ?>" aria-label="<?php echo Text::_('JUSER_TOOLS'); ?>"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="fas fa-cog fa-fw" aria-hidden="true"></span>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton-<?php echo $articleId; ?>">
<div class="float-right">
<div>
<?php echo HTMLHelper::_('icon.edit', $displayData['item'], $displayData['params']); ?>
</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions layouts/joomla/content/icons/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
defined('_JEXEC') or die;

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

$article = $displayData['article'];
$overlib = $displayData['overlib'];
$tooltip = $displayData['tooltip'];
$nowDate = strtotime(Factory::getDate());

$icon = $article->state ? 'edit' : 'eye-slash';
Expand All @@ -25,7 +24,11 @@
{
$icon = 'eye-slash';
}
$aria_described = 'editarticle-' . (int) $article->id;

?>
<span class="hasTooltip fas fa-<?php echo $icon; ?> fa-fw" title="<?php echo HTMLHelper::tooltipText(Text::_('COM_CONTENT_EDIT_ITEM'), $overlib, 0, 0); ?>"></span>
<?php echo Text::_('JGLOBAL_EDIT'); ?>
<span class="fas fa-<?php echo $icon; ?>" aria-hidden="true"></span>
<?php echo Text::_('JGLOBAL_EDIT'); ?>
<div role="tooltip" id="<?php echo $aria_described; ?>">
<?php echo $tooltip; ?>
</div>
10 changes: 7 additions & 3 deletions layouts/joomla/content/icons/edit_lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@

defined('_JEXEC') or die;

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

$article = $displayData['article'];
$tooltip = $displayData['tooltip'];

$aria_described = 'editarticle-' . (int) $article->id;
?>
<span class="hasTooltip fas fa-lock fa-fw" title="<?php echo HTMLHelper::tooltipText($tooltip . '', 0); ?>"></span>
<?php echo Text::_('JLIB_HTML_CHECKED_OUT'); ?>
<span class="hasTooltip fas fa-lock" aria-hidden="true"></span>
<?php echo Text::_('JLIB_HTML_CHECKED_OUT'); ?>
<div role="tooltip" id="<?php echo $aria_described; ?>">
<?php echo $tooltip; ?>
</div>
17 changes: 11 additions & 6 deletions templates/cassiopeia/scss/blocks/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
&.input-full {
max-width: 100%;
}

}

.spacer hr {
Expand Down Expand Up @@ -48,7 +47,6 @@ td .form-control {
position: static;
margin-left: 0;
}

}

.modal label {
Expand All @@ -74,10 +72,17 @@ td .form-control {
z-index: $zindex-tooltip;
display: none;
max-width: 100%;
padding: .25em;
margin: .25em;
color: $white;
background: $black;
padding: .5em;
margin: .5em;
color: $black;
background: $white-offset;
border: 1px solid $gray-600;
border-radius: $border-radius;
box-shadow: 0 0 .5rem rgba(0, 0, 0, .8);

&[id^=editarticle-] {
margin-inline-start: -10em;
}

[dir=ltr] & {
text-align: left;
Expand Down