aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-29 08:45:48 +0000
committerMario <mario@mariovavti.com>2021-06-29 08:45:48 +0000
commit0503914527643210af25d9e036238e6ebfee889e (patch)
treeba9935b5ad2e739a51db3a9e14cf03559a3c8480
parentcb65ae68485ed0abb364bc055ff97a28ed70f899 (diff)
downloadvolse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.tar.gz
volse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.tar.bz2
volse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.zip
fix deleting and starring in unthreaded view
-rw-r--r--Zotlabs/Lib/ThreadItem.php2
-rw-r--r--include/conversation.php22
-rw-r--r--view/tpl/search_item.tpl6
3 files changed, 20 insertions, 10 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index c0d5c001b..618483abe 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -367,7 +367,7 @@ class ThreadItem {
call_hooks('dropdown_extras',$dropdown_extras_arr);
$dropdown_extras = $dropdown_extras_arr['dropdown_extras'];
- $midb64 = 'b64.' . base64url_encode($item['mid']);
+ $midb64 = gen_link_id($item['mid']);
$mids = [ $midb64 ];
$response_mids = [];
foreach($response_verbs as $v) {
diff --git a/include/conversation.php b/include/conversation.php
index 331836846..d10582519 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -730,10 +730,13 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'delete' => t('Delete'),
);
- $star = array(
- 'toggle' => t("Toggle Star Status"),
- 'isstarred' => ((intval($item['item_starred'])) ? true : false),
- );
+ $star = [];
+ if ((local_channel() && local_channel() === intval($item['uid'])) && intval($item['item_thread_top']) && feature_enabled(local_channel(), 'star_posts')) {
+ $star = [
+ 'toggle' => t("Toggle Star Status"),
+ 'isstarred' => ((intval($item['item_starred'])) ? true : false),
+ ];
+ }
$lock = (($item['item_private'] || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid']))
? t('Private Message')
@@ -765,8 +768,12 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$conv_link_mid = (($mode == 'moderate') ? $item['parent_mid'] : $item['mid']);
- $conv_link = ((in_array($item['item_type'],[ ITEM_TYPE_CARD, ITEM_TYPE_ARTICLE] )) ? $item['plink'] : z_root() . '/display/' . gen_link_id($conv_link_mid));
+ $conv_link_module = 'display';
+ if(local_channel()) {
+ $conv_link_module = 'hq';
+ }
+ $conv_link = ((in_array($item['item_type'],[ ITEM_TYPE_CARD, ITEM_TYPE_ARTICLE] )) ? $item['plink'] : z_root() . '/' . $conv_link_module . '/' . gen_link_id($conv_link_mid));
$tmp_item = array(
'template' => $tpl,
@@ -777,7 +784,8 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'delete' => t('Delete'),
'preview_lbl' => $preview_lbl,
'id' => (($preview) ? 'P0' : $item['item_id']),
- 'mids' => json_encode(['b64.' . base64url_encode($item['mid'])]),
+ 'mid' => gen_link_id($item['mid']),
+ 'mids' => json_encode([gen_link_id($item['mid'])]),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link,
'thread_action_menu' => thread_action_menu($item,$mode),
@@ -819,7 +827,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'owner_photo' => $owner_photo,
'plink' => get_plink($item,false),
'edpost' => false,
- 'star' => ((feature_enabled(local_channel(),'star_posts')) ? $star : ''),
+ 'star' => $star,
'drop' => $drop,
'vote' => $likebuttons,
'like' => '',
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index f94aaf37d..49b324f9d 100644
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -71,6 +71,7 @@
<div class="spinner s"></div>
</div>
</div>
+ {{if $item.star || $item.thread_action_menu || $item.drop.dropping}}
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i>
@@ -81,14 +82,15 @@
{{/if}}
{{if $item.thread_action_menu}}
{{foreach $item.thread_action_menu as $mitem}}
- <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-fw fa-{{$mitem.icon}} generic-icons-nav"></i>{{$mitem.title}}</a></li>
+ <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-fw fa-{{$mitem.icon}} generic-icons-nav"></i>{{$mitem.title}}</a>
{{/foreach}}
{{/if}}
{{if $item.drop.dropping}}
- <a class="dropdown-item" href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-fw fa-trash-o generic-icons-nav"></i>{{$item.drop.delete}}</a></li>
+ <a class="dropdown-item" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}', '{{$item.mid}}'); return false;" title="{{$item.drop.delete}}" ><i class="generic-icons-nav fa fa-fw fa-trash-o"></i>{{$item.drop.delete}}</a>
{{/if}}
</div>
</div>
+ {{/if}}
</div>
{{if $item.star && $item.star.isstarred}}
<div class="btn-group" id="star-button-{{$item.id}}">