mirror of
https://github.com/joomla/joomla-cms.git
synced 2024-07-04 19:13:40 +00:00
[4.0] com_menu - Change Featured Icon to Home Icon in (#29016)
* Change Featured Icon to Home Icon in com_menu * Change Icon class * Change Default icon in sidebar menu too * Different class for disabled Home item * Update administrator/components/com_menus/tmpl/items/default.php Co-authored-by: Quy <quy@fluxbb.org> Co-authored-by: Quy <quy@fluxbb.org>
This commit is contained in:
parent
a8dd3a1e70
commit
8cec1f3a0c
|
@ -211,7 +211,7 @@ $assoc = Associations::isEnabled() && $this->state->get('filter.client_id') ==
|
|||
<td class="text-center d-none d-md-table-cell">
|
||||
<?php if ($item->type == 'component') : ?>
|
||||
<?php if ($item->language == '*' || $item->home == '0') : ?>
|
||||
<?php echo HTMLHelper::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange && !$item->protected); ?>
|
||||
<?php echo HTMLHelper::_('jgrid.isdefault', $item->home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange && !$item->protected, 'cb', null, 'home', 'circle'); ?>
|
||||
<?php elseif ($canChange) : ?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_menus&task=items.unsetDefault&cid[]=' . $item->id . '&' . Session::getFormToken() . '=1'); ?>">
|
||||
<?php if ($item->language_image) : ?>
|
||||
|
|
|
@ -110,7 +110,7 @@ if ($iconImage)
|
|||
{
|
||||
if (substr($iconImage, 0, 6) == 'class:' && substr($iconImage, 6) == 'icon-home')
|
||||
{
|
||||
$iconImage = '<span class="home-image fas fa-star" aria-hidden="true"></span>';
|
||||
$iconImage = '<span class="home-image fas fa-home" aria-hidden="true"></span>';
|
||||
$iconImage .= '<span class="sr-only">' . Text::_('JDEFAULT') . '</span>';
|
||||
}
|
||||
elseif (substr($iconImage, 0, 6) == 'image:')
|
||||
|
|
|
@ -175,7 +175,7 @@ abstract class Menu
|
|||
{
|
||||
if (substr($iconImage, 0, 6) === 'class:' && substr($iconImage, 6) === 'icon-home')
|
||||
{
|
||||
$iconImage = '<span class="home-image fas fa-star" aria-hidden="true"></span>';
|
||||
$iconImage = '<span class="home-image fas fa-home" aria-hidden="true"></span>';
|
||||
$iconImage .= '<span class="sr-only">' . Text::_('JDEFAULT') . '</span>';
|
||||
}
|
||||
elseif (substr($iconImage, 0, 6) === 'image:')
|
||||
|
|
|
@ -68,6 +68,16 @@
|
|||
color: var(--atum-text-dark);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
&.home-disabled {
|
||||
opacity: 1;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&.disabled .icon-home {
|
||||
color: $state-warning-bg;
|
||||
border-color: $state-warning-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-joomla::before {
|
||||
|
|
|
@ -89,7 +89,7 @@ abstract class JGrid
|
|||
}
|
||||
else
|
||||
{
|
||||
$html[] = '<a class="tbody-icon disabled jgrid"';
|
||||
$html[] = '<a class="tbody-icon ' . $active_class . '-disabled disabled jgrid"';
|
||||
$html[] = $tip ? ' aria-labelledby="' . $ariaid . '"' : '';
|
||||
$html[] = '>';
|
||||
|
||||
|
@ -258,19 +258,21 @@ abstract class JGrid
|
|||
/**
|
||||
* Returns an isDefault state on a grid
|
||||
*
|
||||
* @param integer $value The state value.
|
||||
* @param integer $i The row index
|
||||
* @param string|array $prefix An optional task prefix or an array of options
|
||||
* @param boolean $enabled An optional setting for access control on the action.
|
||||
* @param string $checkbox An optional prefix for checkboxes.
|
||||
* @param string $formId An optional form selector.
|
||||
* @param integer $value The state value.
|
||||
* @param integer $i The row index
|
||||
* @param string|array $prefix An optional task prefix or an array of options
|
||||
* @param boolean $enabled An optional setting for access control on the action.
|
||||
* @param string $checkbox An optional prefix for checkboxes.
|
||||
* @param string $formId An optional form selector.
|
||||
* @param string $active_class The class for active items.
|
||||
* @param string $inactive_class The class for inactive items.
|
||||
*
|
||||
* @return string The HTML markup
|
||||
*
|
||||
* @see JHtmlJGrid::state()
|
||||
* @since 1.6
|
||||
*/
|
||||
public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb', $formId = null)
|
||||
public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb', $formId = null, $active_class = 'featured', $inactive_class = 'unfeatured')
|
||||
{
|
||||
if (is_array($prefix))
|
||||
{
|
||||
|
@ -281,8 +283,8 @@ abstract class JGrid
|
|||
}
|
||||
|
||||
$states = array(
|
||||
0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, 'unfeatured', 'unfeatured'),
|
||||
1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, 'featured', 'featured'),
|
||||
0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, $inactive_class, $inactive_class),
|
||||
1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, $active_class, $active_class),
|
||||
);
|
||||
|
||||
return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox, $formId);
|
||||
|
|
Loading…
Reference in New Issue
Block a user