conversation: new 'categories' and 'folder' elements to $item
remove static "Filed under" e "Category" text from message body both are lists of array whith 'name' : category/folder name 'remove': url to remove 'first': bool first in array 'last' : bool last in array
This commit is contained in:
parent
2bdbdc8d8e
commit
b400ddd22d
2 changed files with 74 additions and 27 deletions
|
|
@ -1016,35 +1016,8 @@ function prepare_body($item,$attach = false) {
|
|||
}
|
||||
$s .= '<div class="clear"></div></div>';
|
||||
}
|
||||
$matches = false;
|
||||
$cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER);
|
||||
if($cnt) {
|
||||
// logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
|
||||
foreach($matches as $mtch) {
|
||||
if(strlen($x))
|
||||
$x .= ',';
|
||||
$x .= xmlify(file_tag_decode($mtch[1]))
|
||||
. ((local_user() == $item['uid']) ? ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>' : '');
|
||||
}
|
||||
if(strlen($x))
|
||||
$s .= '<div class="categorytags"><span>' . t('Categories:') . ' </span>' . $x . '</div>';
|
||||
|
||||
|
||||
}
|
||||
$matches = false;
|
||||
$x = '';
|
||||
$cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
|
||||
if($cnt) {
|
||||
// logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
|
||||
foreach($matches as $mtch) {
|
||||
if(strlen($x))
|
||||
$x .= ' ';
|
||||
$x .= xmlify(file_tag_decode($mtch[1])) . ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
|
||||
}
|
||||
if(strlen($x) && (local_user() == $item['uid']))
|
||||
$s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>';
|
||||
}
|
||||
|
||||
// Look for spoiler
|
||||
$spoilersearch = '<blockquote class="spoiler">';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue