Skip to content

Commit

Permalink
Crypsis - "Topic Icons: Images - Legacy" does not show "New" icons #5237
Browse files Browse the repository at this point in the history
  • Loading branch information
810 committed Mar 30, 2017
1 parent 76a40e5 commit 40130ab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
33 changes: 24 additions & 9 deletions src/libraries/kunena/template/template.php
Expand Up @@ -1280,9 +1280,19 @@ public function getTopicIcon($topic)
$category_iconset = 'default';
}

if (!empty($topic->unread))
{
$icon->src = $icon->new;
}

if (empty($icon->name))
{
$icon->name = "";
}

$iconurl = $this->getTopicIconPath("{$category_iconset}/system/{$icon->src}", true);

return '<img src="' . $iconurl . '" alt="" />';
return '<img src="' . $iconurl . '" alt="' . $icon->name .'" />';
}
}
}
Expand All @@ -1309,10 +1319,12 @@ public function get_xml_icon($src, $id = 0, $style = 'src')
$attributes = $icon[0]->attributes();
$icon = new stdClass;
$icon->id = (int) $attributes->id;
$icon->name = (string) $attributes->name;
$icon->b2 = (string) $attributes->b2;
$icon->b3 = (string) $attributes->b3;
$icon->fa = (string) $attributes->fa;
$icon->src = (string) $attributes->src;
$icon->new = (string) $attributes->new;

return $icon;
}
Expand Down Expand Up @@ -1345,10 +1357,12 @@ public function get_xml_systemicon($src, $id = 0, $style = 'src')
$attributes = $icon[0]->attributes();
$icon = new stdClass;
$icon->id = (int) $attributes->id;
$icon->name = (string) $attributes->name;
$icon->b2 = (string) $attributes->b2;
$icon->b3 = (string) $attributes->b3;
$icon->fa = (string) $attributes->fa;
$icon->src = (string) $attributes->src;
$icon->new = (string) $attributes->new;

return $icon;
}
Expand Down Expand Up @@ -1653,14 +1667,15 @@ public function get_xml_label($src, $id = 0, $style = 'src')
$label = $src->xpath('/kunena-topiclabels/labels/label[@id=0]');
}

$attributes = $label[0]->attributes();
$label = new stdClass;
$label->id = (int) $attributes->id;
$label->b2 = (string) $attributes->b2;
$label->b3 = (string) $attributes->b3;
$label->fa = (string) $attributes->fa;
$label->src = (string) $attributes->src;
$label->name = (string) $attributes->name;
$attributes = $label[0]->attributes();
$label = new stdClass;
$label->id = (int) $attributes->id;
$label->b2 = (string) $attributes->b2;
$label->b3 = (string) $attributes->b3;
$label->fa = (string) $attributes->fa;
$label->src = (string) $attributes->src;
$label->name = (string) $attributes->name;
$label->new = (string) $attributes->new;
$label->labeltype = (string) $attributes->labeltype;

return $label;
Expand Down
16 changes: 8 additions & 8 deletions src/media/kunena/topic_icons/default/systemicons.xml
Expand Up @@ -12,13 +12,13 @@
<description>System topic icons for Kunena</description>

<icons type="system" width="48" height="48">
<icon id="0" name="normal" b2="comments-2" b3="comment" fa="comments-o" src="normal.png"/>
<icon id="1" name="unapproved" b2="eye" b3="eye" fa="eye" src="unapproved.png"/>
<icon id="2" name="deleted" b2="trash" b3="trash" fa="trash-o" src="deleted.png"/>
<icon id="3" name="sticky" b2="pin" b3="pushpin" fa="map-pin" src="sticky.png"/>
<icon id="4" name="locked" b2="lock" b3="file" fa="lock" src="locked.png"/>
<icon id="5" name="moved" b2="contract" b3="contract" fa="compress" src="moved.png"/>
<icon id="6" name="unanswered" b2="comments" b3="comment" fa="comment-o" src="unanswered.png"/>
<icon id="7" name="stickyandlocked" b2="lock" b3="lock" fa="lock" src="sticky_locked.png"/>
<icon id="0" name="normal" b2="comments-2" b3="comment" fa="comments-o" src="normal.png" new="normal_new.png"/>
<icon id="1" name="unapproved" b2="eye" b3="eye" fa="eye" src="unapproved.png" new="unapproved_new.png"/>
<icon id="2" name="deleted" b2="trash" b3="trash" fa="trash-o" src="deleted.png" new="deleted_new.png"/>
<icon id="3" name="sticky" b2="pin" b3="pushpin" fa="map-pin" src="sticky.png" new="sticky_new.png"/>
<icon id="4" name="locked" b2="lock" b3="file" fa="lock" src="locked.png" new="locked_new.png"/>
<icon id="5" name="moved" b2="contract" b3="contract" fa="compress" src="moved.png" new="moved.png"/>
<icon id="6" name="unanswered" b2="comments" b3="comment" fa="comment-o" src="unanswered.png" new="unanswered_new.png"/>
<icon id="7" name="stickyandlocked" b2="lock" b3="lock" fa="lock" src="sticky_locked.png" new="sticky_and_locked_new.png"/>
</icons>
</kunena-systemicons>

0 comments on commit 40130ab

Please sign in to comment.