Skip to content

Commit

Permalink
extend JLayout iconclass with check and replace iconstate icons by JL…
Browse files Browse the repository at this point in the history
…ayout iconclass
  • Loading branch information
hans2103 committed Sep 11, 2020
1 parent 45fb827 commit e0dbb6a
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 39 deletions.
Expand Up @@ -27,10 +27,10 @@
$canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin');

$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);

Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true);
Expand Down Expand Up @@ -102,7 +102,7 @@
<tr class="row<?php echo $i % 2; ?>">
<?php if (!empty($this->typeSupports['state'])) : ?>
<td class="text-center">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->state)]]); ?>
</td>
<?php endif; ?>
<th scope="row" class="has-context">
Expand Down
Expand Up @@ -36,10 +36,10 @@
$canManageCheckin = Factory::getUser()->authorise('core.manage', 'com_checkin');

$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);

$this->document->addScriptOptions('associations-modal', ['func' => $function]);
Expand Down Expand Up @@ -101,7 +101,7 @@
<tr class="row<?php echo $i % 2; ?>">
<?php if (!empty($this->typeSupports['state'])) : ?>
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->state)]]); ?>
</td>
<?php endif; ?>
<th scope="row" class="has-context">
Expand Down
Expand Up @@ -72,10 +72,10 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);
?>
<?php foreach ($this->items as $i => $item) : ?>
Expand All @@ -102,7 +102,7 @@
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->published)]]); ?>
</td>
<th scope="row">
<?php echo LayoutHelper::render('joomla.html.treeprefix', array('level' => $item->level)); ?>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_contact/tmpl/contacts/modal.php
Expand Up @@ -88,10 +88,10 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);
?>
<?php foreach ($this->items as $i => $item) : ?>
Expand All @@ -117,7 +117,7 @@
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->published)]]); ?>
</td>
<th scope="row">
<a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($onclick); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->name); ?>" data-uri="<?php echo $this->escape(RouteHelper::getContactRoute($item->id, $item->catid, $item->language)); ?>" data-language="<?php echo $this->escape($lang); ?>">
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_content/tmpl/articles/modal.php
Expand Up @@ -91,9 +91,9 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
-2 => 'trash',
0 => 'times',
1 => 'check',
);
?>
<?php foreach ($this->items as $i => $item) : ?>
Expand All @@ -119,7 +119,7 @@
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->state)]]); ?>
</td>
<th scope="row">
<?php $attribs = 'data-function="' . $this->escape($onclick) . '"'
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_fields/tmpl/fields/modal.php
Expand Up @@ -73,16 +73,16 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);
foreach ($this->items as $i => $item) :
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->state)]]); ?>
</td>
<th scope="row" class="has-context">
<a class="btn btn-sm btn-block btn-success" href="#" onclick="Joomla.fieldIns('<?php echo $this->escape($item->id); ?>', '<?php echo $this->escape($editor); ?>');"><?php echo $this->escape($item->title); ?></a>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_modules/tmpl/modules/modal.php
Expand Up @@ -79,16 +79,16 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);
foreach ($this->items as $i => $item) :
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->published)]]); ?>
</td>
<td scope="row" class="has-context">
<a class="js-module-insert btn btn-sm btn-block btn-success" href="#" data-module="<?php echo $item->id; ?>" data-editor="<?php echo $this->escape($editor); ?>">
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php
Expand Up @@ -68,10 +68,10 @@
<tbody>
<?php
$iconStates = array(
-2 => 'fas fa-trash',
0 => 'fas fa-times',
1 => 'fas fa-check',
2 => 'fas fa-folder',
-2 => 'trash',
0 => 'times',
1 => 'check',
2 => 'folder',
);
?>
<?php foreach ($this->items as $i => $item) : ?>
Expand All @@ -97,7 +97,7 @@
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="text-center tbody-icon">
<span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => $iconStates[$this->escape($item->published)]]); ?>
</td>
<th scope="row">
<a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->name)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(RouteHelper::getNewsfeedRoute($item->id, $item->catid, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);">
Expand Down
1 change: 1 addition & 0 deletions layouts/joomla/icon/iconclass.php
Expand Up @@ -41,6 +41,7 @@
$icon = 'fas fa-folder-open';
break;

case 'check':
case 'publish':
$icon = 'fas fa-check';
break;
Expand Down

0 comments on commit e0dbb6a

Please sign in to comment.