Replace "Re:" with icon see BT#15173

pull/2858/head
Julio Montoya 7 years ago
parent f50267b727
commit d83f9f956c
  1. 23
      main/forum/viewthread.php
  2. 2
      main/inc/lib/display.lib.php

@ -240,20 +240,6 @@ if (($current_forum_category &&
}
}
// The different views of the thread.
if ($origin != 'learnpath') {
/*$actions .= '<a href="'.$forumUrl.'viewthread.php?'.api_get_cidreq().'&'.api_get_cidreq()
.'&forum='.intval($forumId).'&thread='.intval($threadId)
.'&search='.Security::remove_XSS(urlencode($my_search));
echo $my_url.'&view=flat">'
.Display::return_icon('forum_listview.png', get_lang('FlatView'), null, ICON_SIZE_MEDIUM)
.'</a>';
/*
echo $my_url.'&view=nested">'
.Display::return_icon('forum_nestedview.png', get_lang('NestedView'), null, ICON_SIZE_MEDIUM)
.'</a>';*/
}
$template->assign('forum_actions', $actions);
$template->assign('origin', api_get_origin());
@ -638,6 +624,15 @@ foreach ($posts as $post) {
$post['current'] = true;
}
// Replace Re: with an icon
$search = [
get_lang('ReplyShort'),
'Re:',
'AW:',
];
$replace = '<span>'.Display::returnFontAwesomeIcon('mail-reply').'</span>';
$post['post_title'] = str_replace($search,$replace, $post['post_title']);
// The post title
$titlePost = Display::tag('h3', $post['post_title'], ['class' => 'forum_post_title']);
$post['post_title'] = '<a name="post_id_'.$post['post_id'].'"></a>';

@ -2594,7 +2594,7 @@ class Display
/**
* Get a HTML code for a icon by Font Awesome.
*
* @param string $name The icon name
* @param string $name The icon name. Example: "mail-reply"
* @param int|string $size Optional. The size for the icon. (Example: lg, 2, 3, 4, 5)
* @param bool $fixWidth Optional. Whether add the fw class
* @param string $additionalClass Optional. Additional class

Loading…
Cancel
Save