This commit is contained in:
Fabio Comuni 2011-10-03 09:38:58 +02:00
parent b476575a98
commit 4d5580ab77
2 changed files with 14 additions and 13 deletions

View File

@ -142,8 +142,8 @@ function conversation(&$a, $items, $mode, $update) {
// array with html for each thread (parent+comments) // array with html for each thread (parent+comments)
$treads = array(); $threads = array();
$treadsid = -1; $threadsid = -1;
if(count($items)) { if(count($items)) {
@ -155,7 +155,7 @@ function conversation(&$a, $items, $mode, $update) {
$tpl = get_markup_template('search_item.tpl'); $tpl = get_markup_template('search_item.tpl');
foreach($items as $item) { foreach($items as $item) {
$treadsid++; $threadsid++;
$comment = ''; $comment = '';
$owner_url = ''; $owner_url = '';
@ -254,7 +254,7 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item); $arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr); call_hooks('display_item', $arr);
$treads[$treadsid] .= $arr['output']; $threads[$threadsid] .= $arr['output'];
} }
@ -336,8 +336,8 @@ function conversation(&$a, $items, $mode, $update) {
$comments_seen = 0; $comments_seen = 0;
$comments_collapsed = false; $comments_collapsed = false;
$treadsid++; $threadsid++;
$treads[$treadsid] = ""; $threads[$threadsid] = "";
} }
else { else {
// prevent private email from leaking into public conversation // prevent private email from leaking into public conversation
@ -351,7 +351,7 @@ function conversation(&$a, $items, $mode, $update) {
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) { if(! $comments_collapsed) {
$treads[$treadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent'] $threads[$threadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
. '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >' . '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
. sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>' . sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
. '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >'; . '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
@ -359,7 +359,7 @@ function conversation(&$a, $items, $mode, $update) {
} }
} }
if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) { if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
$treads[$treadsid] .= '</div>'; $threads[$threadsid] .= '</div>';
} }
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
@ -564,7 +564,7 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item); $arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr); call_hooks('display_item', $arr);
$treads[$treadsid] .= $arr['output']; $threads[$threadsid] .= $arr['output'];
} }
} }
} }
@ -573,11 +573,11 @@ function conversation(&$a, $items, $mode, $update) {
// if author collapsing is in force but didn't get closed, close it off now. // if author collapsing is in force but didn't get closed, close it off now.
/*if($blowhard_count >= 3) /*if($blowhard_count >= 3)
$treads[$treadsid] .= '</div>';*/ $threads[$threadsid] .= '</div>';*/
$page_template = get_markup_template("conversation.tpl"); $page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array( $o .= replace_macros($page_template, array(
'$treads' => $treads, '$threads' => $threads,
'$dropping' => ($dropping?t('Delete Selected Items'):False), '$dropping' => ($dropping?t('Delete Selected Items'):False),
)); ));

View File

@ -1,8 +1,9 @@
{{ for $treads as $tread }} {{ for $threads as $thread }}
<div class="tread-wrapper"> <div class="tread-wrapper">
$tread $thread
</div> </div>
{{ endfor }} {{ endfor }}
{{ if $dropping }} {{ if $dropping }}
<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"> <div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();">
<div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div> <div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>