aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php75
1 files changed, 43 insertions, 32 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 79fe12d54..6dfefa707 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1,7 +1,9 @@
<?php /** @file */
-use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Activity;
+use Zotlabs\Lib\Apps;
+use Zotlabs\Lib\Config;
+use Zotlabs\Lib\PConfig;
require_once('include/items.php');
@@ -437,17 +439,22 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$uploading = false;
- if(local_channel()) {
- $cur_channel = App::get_channel();
- if($cur_channel['channel_allow_cid'] === '' && $cur_channel['channel_allow_gid'] === ''
- && $cur_channel['channel_deny_cid'] === '' && $cur_channel['channel_deny_gid'] === ''
+ $channel = App::get_channel();
+ $observer = App::get_observer();
+
+ if (local_channel()) {
+ // Allow uploading if there is no default privacy and the view_storage permission is set to PERMS_PUBLIC
+ if ($channel['channel_allow_cid'] === '' && $channel['channel_allow_gid'] === ''
+ && $channel['channel_deny_cid'] === '' && $channel['channel_deny_gid'] === ''
&& intval(\Zotlabs\Access\PermissionLimits::Get(local_channel(),'view_storage')) === PERMS_PUBLIC) {
$uploading = true;
}
- }
- $channel = App::get_channel();
- $observer = App::get_observer();
+ // Allow uploading if OCAP tokens are enabled
+ if (PConfig::Get(local_channel(), 'system', 'ocap_enabled')) {
+ $uploading = true;
+ }
+ }
if (!$update) {
$_SESSION['return_url'] = App::$query_string;
@@ -816,7 +823,7 @@ function thread_action_menu($item,$mode = '') {
$menu[] = [
'menu' => 'unfollow_thread',
'title' => t('Unfollow Thread'),
- 'icon' => 'minus',
+ 'icon' => 'dash',
'action' => 'dounsubthread(' . $item['id'] . '); return false;',
'href' => '#'
];
@@ -998,10 +1005,10 @@ function builtin_activity_puller($item, &$conv_responses) {
$name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown'));
- $moderate = ((intval($item['item_blocked']) === ITEM_MODERATED) ? '<a href="moderate/' . $item['id'] . '/approve" onclick="moderate_approve(' . $item['id'] . '); return false;" class="text-success pe-2" title="' . t('Approve this item') . '"><i class="fa fa-check" ></i></a><a href="moderate/' . $item['id'] . '/drop" onclick="moderate_drop(' . $item['id'] . '); return false;" class="text-danger pe-2" title="' . t('Delete this item') . '"><i class="fa fa-trash-o" ></i></a>' : '');
+ $moderate = ((intval($item['item_blocked']) === ITEM_MODERATED) ? '<a href="moderate/' . $item['id'] . '/approve" onclick="moderate_approve(' . $item['id'] . '); return false;" class="text-success pe-2" title="' . t('Approve this item') . '"><i class="bi bi-check-lg" ></i></a><a href="moderate/' . $item['id'] . '/drop" onclick="moderate_drop(' . $item['id'] . '); return false;" class="text-danger pe-2" title="' . t('Delete this item') . '"><i class="bi bi-trash" ></i></a>' : '');
$url = (($item['author_xchan'] && $item['author']['xchan_photo_s'])
- ? '<div class="dropdown-item">' . $moderate . '<a href="' . chanlink_hash($item['author_xchan']) . '" class="text-reset">' . '<img class="menu-img-1" src="' . zid($item['author']['xchan_photo_s']) . '" alt="' . urlencode($name) . '" /> ' . $name . '</a></div>'
+ ? '<div class="dropdown-item">' . $moderate . '<a href="' . chanlink_hash($item['author_xchan']) . '" class="text-reset">' . '<img class="menu-img-1" src="' . $item['author']['xchan_photo_s'] . '" alt="' . urlencode($name) . '" loading="lazy" /> ' . $name . '</a></div>'
: '<a class="dropdown-item" href="#" class="disabled">' . $name . '</a>'
);
@@ -1182,6 +1189,7 @@ function hz_status_editor($x, $popup = false) {
'$modalerroralbum' => t('Error getting album'),
'$nocomment_enabled' => t('Comments enabled'),
'$nocomment_disabled' => t('Comments disabled'),
+ '$confirmdelete' => t('Confirm delete'),
'$auto_save_draft' => $feature_auto_save_draft,
'$reset' => $reset,
'$popup' => $popup
@@ -1247,6 +1255,7 @@ function hz_status_editor($x, $popup = false) {
'$writefiles' => $writefiles,
'$bold' => t('Bold'),
'$italic' => t('Italic'),
+ '$highlighter' => t('Highlight selected text'),
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
@@ -1262,7 +1271,7 @@ function hz_status_editor($x, $popup = false) {
'$poll_option_label' => t('Option'),
'$poll_add_option_label' => t('Add option'),
'$poll_expire_unit_label' => [t('Minutes'), t('Hours'), t('Days')],
- '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers"), '', '', [t('No'), t('Yes')]],
+ '$multiple_answers' => ['poll_multiple_answers', t("Allow multiple answers"), '', '', [t('No'), t('Yes')],null,null],
'$consensus' => ((array_key_exists('item',$x)) ? $x['item']['item_consensus'] : 0),
'$nocommenttitle' => t('Disable comments'),
'$nocommenttitlesub' => t('Toggle comments'),
@@ -1336,7 +1345,7 @@ function get_item_children($arr, $parent) {
$children = array();
foreach($arr as $item) {
if($item['id'] != $item['parent']) {
- if(get_config('system','thread_allow')) {
+ if(Config::Get('system','thread_allow')) {
// Fallback to parent_mid if thr_parent is not set
$thr_parent = $item['thr_parent'];
if($thr_parent == '')
@@ -1465,14 +1474,18 @@ function render_location_default($item) {
$location = $item['location'];
$coord = $item['coord'];
- if($coord) {
+ if ($coord) {
if($location)
- $location .= '&nbsp;<span class="smalltext">(' . $coord . ')</span>';
+ $location .= '&nbsp;(' . $coord . ')';
else
- $location = '<span class="smalltext">' . $coord . '</span>';
+ $location = $coord;
}
- return $location;
+ if (!$location) {
+ return '';
+ }
+
+ return '<i class="bi bi-geo-alt" title="' . $location . '"></i>';
}
@@ -1523,6 +1536,12 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) {
$ret = array();
foreach($response_verbs as $v) {
+ if ($v === 'answer') {
+ // we require the structure to collect the response hashes
+ // but we do not use them for display - do not collect them.
+ continue;
+ }
+
$ret[$v] = [];
$ret[$v]['count'] = $conv_responses[$v][$item['mid']] ?? 0;
$ret[$v]['list'] = ((isset($conv_responses[$v][$item['mid']])) ? $conv_responses[$v][$item['mid'] . '-l'] : '');
@@ -1531,14 +1550,6 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) {
$ret[$v]['modal'] = (($ret[$v]['count'] > MAX_LIKERS) ? true : false);
}
- $count = 0;
- foreach ($ret as $key) {
- if ($key['count'] == true)
- $count++;
- }
-
- $ret['count'] = $count;
-
//logger('ret: ' . print_r($ret,true));
return $ret;
@@ -1547,25 +1558,25 @@ function get_responses($conv_responses,$response_verbs,$ob,$item) {
function get_response_button_text($v,$count) {
switch($v) {
case 'like':
- return ['label' => tt('Like','Likes',$count,'noun'), 'icon' => 'thumbs-o-up', 'class' => 'like'];
+ return ['label' => tt('Like','Likes',$count,'noun'), 'icon' => 'hand-thumbs-up', 'class' => 'like', 'onclick' => 'dolike'];
break;
case 'announce':
- return ['label' => tt('Repeat','Repeats',$count,'noun'), 'icon' => 'retweet', 'class' => 'announce'];
+ return ['label' => tt('Repeat','Repeats',$count,'noun'), 'icon' => 'repeat', 'class' => 'announce', 'onclick' => 'jotShare'];
break;
case 'dislike':
- return ['label' => tt('Dislike','Dislikes',$count,'noun'), 'icon' => 'thumbs-o-down', 'class' => 'dislike'];
+ return ['label' => tt('Dislike','Dislikes',$count,'noun'), 'icon' => 'hand-thumbs-down', 'class' => 'dislike', 'onclick' => 'dolike'];
break;
case 'attendyes':
- return ['label' => tt('Attending','Attending',$count,'noun'), 'icon' => 'calendar-check-o', 'class' => 'attendyes'];
+ return ['label' => tt('Attending','Attending',$count,'noun'), 'icon' => 'calendar-check', 'class' => 'attendyes', 'onclick' => 'dolike'];
break;
case 'attendno':
- return ['label' => tt('Not Attending','Not Attending',$count,'noun'), 'icon' => 'calendar-times-o', 'class' => 'attendno'];
+ return ['label' => tt('Not Attending','Not Attending',$count,'noun'), 'icon' => 'calendar-x', 'class' => 'attendno', 'onclick' => 'dolike'];
break;
case 'attendmaybe':
- return ['label' => tt('Undecided','Undecided',$count,'noun'), 'icon' => 'calendar-o', 'class' => 'attendmaybe'];
+ return ['label' => tt('Undecided','Undecided',$count,'noun'), 'icon' => 'calendar', 'class' => 'attendmaybe', 'onclick' => 'dolike'];
break;
default:
- return '';
+ return [];
break;
}
}