From e5b54e74ba22b487f816c5a5d16758be34be785a Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 15 Jun 2011 20:43:39 -0700 Subject: delete selected items --- include/conversation.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 9ffcbe157..0d3123831 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -114,6 +114,8 @@ function conversation(&$a, $items, $mode, $update) { $noshare_tpl = get_markup_template('like_noshare.tpl'); $tpl = get_markup_template('wall_item.tpl'); $wallwall = get_markup_template('wallwall_item.tpl'); + $droptpl = get_markup_template('wall_item_drop.tpl'); + $fakedrop = get_markup_template('wall_fake_drop.tpl'); $alike = array(); $dlike = array(); @@ -126,7 +128,6 @@ function conversation(&$a, $items, $mode, $update) { // - just loop through the items and format them minimally for display $tpl = get_markup_template('search_item.tpl'); - $droptpl = get_markup_template('wall_fake_drop.tpl'); foreach($items as $item) { @@ -171,14 +172,7 @@ function conversation(&$a, $items, $mode, $update) { } $drop = ''; - $dropping = false; - if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $dropping = true; - - $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); - - // localize_item($item); $drop = replace_macros($droptpl,array('$id' => $item['id'])); @@ -390,7 +384,16 @@ function conversation(&$a, $items, $mode, $update) { ? '' : ''); - $drop = replace_macros(get_markup_template('wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); + + + $drop = ''; + $dropping = false; + + if((intval($item['contact-id']) && $item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) + $dropping = true; + + $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); + $photo = $item['photo']; $thumb = $item['thumb']; @@ -477,6 +480,7 @@ function conversation(&$a, $items, $mode, $update) { '$comment' => $comment )); + $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); @@ -491,6 +495,9 @@ function conversation(&$a, $items, $mode, $update) { if($blowhard_count >= 3) $o .= ''; + if($dropping) + $o .= '
'; + return $o; } -- cgit v1.2.3