aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r--Zotlabs/Widget/Activity_order.php42
-rw-r--r--Zotlabs/Widget/Album.php3
-rw-r--r--Zotlabs/Widget/Channel_activities.php2
-rw-r--r--Zotlabs/Widget/Messages.php20
-rw-r--r--Zotlabs/Widget/Notifications.php52
-rw-r--r--Zotlabs/Widget/Pinned.php95
-rw-r--r--Zotlabs/Widget/Portfolio.php4
7 files changed, 86 insertions, 132 deletions
diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php
index e8ee11508..8d47370db 100644
--- a/Zotlabs/Widget/Activity_order.php
+++ b/Zotlabs/Widget/Activity_order.php
@@ -16,7 +16,7 @@ class Activity_order {
return '';
if(! feature_enabled(local_channel(),'order_tab')) {
- set_pconfig(local_channel(), 'mod_network', 'order', 0);
+ set_pconfig(local_channel(), 'mod_network', 'order', 'created');
return '';
}
@@ -26,17 +26,17 @@ class Activity_order {
if(x($_GET, 'order')) {
switch($_GET['order']){
- case 'post':
+ case 'created':
$postord_active = 'active';
- set_pconfig(local_channel(), 'mod_network', 'order', 1);
+ set_pconfig(local_channel(), 'mod_network', 'order', 'created');
break;
- case 'comment':
+ case 'commented':
$commentord_active = 'active';
- set_pconfig(local_channel(), 'mod_network', 'order', 0);
+ set_pconfig(local_channel(), 'mod_network', 'order', 'commented');
break;
case 'unthreaded':
$unthreaded_active = 'active';
- set_pconfig(local_channel(), 'mod_network', 'order', 2);
+ set_pconfig(local_channel(), 'mod_network', 'order', 'unthreaded');
break;
default:
$commentord_active = 'active';
@@ -44,19 +44,19 @@ class Activity_order {
}
}
else {
- $order = get_pconfig(local_channel(), 'mod_network', 'order', 0);
+ $order = get_pconfig(local_channel(), 'mod_network', 'order', 'created');
switch($order) {
- case 0:
+ case 'commented':
$commentord_active = 'active';
break;
- case 1:
+ case 'created':
$postord_active = 'active';
break;
- case 2:
+ case 'unthreaded':
$unthreaded_active = 'active';
break;
default:
- $commentord_active = 'active';
+ $postord_active = 'active';
}
}
@@ -90,26 +90,26 @@ class Activity_order {
// tabs
- $tabs = [];
+ $tabs[] = [
+ 'label' => t('Posted Date'),
+ 'icon' => '',
+ 'url'=>z_root() . '/' . $cmd . '?order=created' . $filter,
+ 'sel'=> $postord_active,
+ 'title' => t('Order by last posted date'),
+ ];
$tabs[] = [
'label' => t('Commented Date'),
'icon' => '',
- 'url'=>z_root() . '/' . $cmd . '?f=&order=comment' . $filter,
+ 'url'=>z_root() . '/' . $cmd . '?order=commented' . $filter,
'sel'=> $commentord_active,
'title' => t('Order by last commented date'),
];
- $tabs[] = [
- 'label' => t('Posted Date'),
- 'icon' => '',
- 'url'=>z_root() . '/' . $cmd . '?f=&order=post' . $filter,
- 'sel'=> $postord_active,
- 'title' => t('Order by last posted date'),
- ];
+
$tabs[] = array(
'label' => t('Date Unthreaded'),
'icon' => '',
- 'url' => z_root() . '/' . $cmd . '?f=&order=unthreaded' . $filter,
+ 'url' => z_root() . '/' . $cmd . '?order=unthreaded' . $filter,
'sel' => $unthreaded_active,
'title' => t('Order unthreaded by date'),
);
diff --git a/Zotlabs/Widget/Album.php b/Zotlabs/Widget/Album.php
index f1fa69182..667952360 100644
--- a/Zotlabs/Widget/Album.php
+++ b/Zotlabs/Widget/Album.php
@@ -59,6 +59,9 @@ class Album {
//edit album name
$album_edit = null;
+ $ph = photo_factory('');
+ $phototypes = $ph->supportedTypes();
+
$photos = array();
if($r) {
$twist = 'rotright';
diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php
index debaf20d4..2677f82c3 100644
--- a/Zotlabs/Widget/Channel_activities.php
+++ b/Zotlabs/Widget/Channel_activities.php
@@ -223,7 +223,7 @@ class Channel_activities {
$i[] = [
'url' => z_root() . '/manage/' . $rr['channel_id'],
'title' => '',
- 'summary' => '<div class="text-truncate lh-sm"><img src="' . $rr['xchan_photo_s'] . '" class="menu-img-2">' . '<strong>' . $rr['channel_name'] . '</strong><br><small class="opacity-75">' . $rr['xchan_addr'] . '</small></div>',
+ 'summary' => '<div class="text-truncate lh-sm"><img src="' . $rr['xchan_photo_s'] . '" class="menu-img-2">' . '<strong>' . $rr['channel_name'] . '</strong><br><small class="text-body-secondary">' . $rr['xchan_addr'] . '</small></div>',
'footer' => $footer
];
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index f90b4f99e..cc1811ffc 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -28,6 +28,8 @@ class Messages {
intval(TERM_FILE)
);
+ $file_tags = [];
+
if ($r) {
foreach($r as $rr) {
$file_tags[] = $rr['term'];
@@ -42,14 +44,14 @@ class Messages {
'$feature_file' => feature_enabled(local_channel(), 'filing'),
'$file_tags' => $file_tags,
'$strings' => [
- 'messages_title' => t('Public and restricted messages'),
- 'direct_messages_title' => t('Direct messages'),
- 'starred_messages_title' => t('Starred messages'),
+ 'messages_title' => t('Public and restricted conversations'),
+ 'direct_messages_title' => t('Private conversations'),
+ 'starred_messages_title' => t('Starred conversations'),
'filed_messages_title' => t('Filed messages'),
- 'notice_messages_title' => t('Notices'),
+ 'notice_messages_title' => t('Notifications'),
'loading' => t('Loading'),
- 'empty' => t('No messages'),
- 'unseen_count' => t('Unseen'),
+ 'empty' => t('No conversations'),
+ 'unseen_count' => t('Unseen reactions'),
'filter' => t('Filter by name or address'),
'file_filter' => t('Filter by file name')
]
@@ -84,8 +86,6 @@ class Messages {
$entries = [];
$limit = 30;
$order_sql = 'i.created DESC';
- $dummy_order_sql = '';
- $filter_sql = '';
$loadtime = (($offset) ? $_SESSION['messages_loadtime'] : datetime_convert());
$vnotify = get_pconfig(local_channel(), 'system', 'vnotify', -1);
@@ -101,14 +101,18 @@ class Messages {
$vnotify_sql_i = " AND i.verb NOT IN ('Dislike', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
}
+ $filter_sql = '';
if($type !== 'filed' && $author) {
$filter_sql = " AND (i.owner_xchan = '" . protect_sprintf(dbesc($author)) . "') ";
}
+ $filed_filter_sql = '';
if($type === 'filed' && $file) {
$filed_filter_sql = " AND (term.term = '" . protect_sprintf(dbesc($file)) . "') ";
}
+ $dummy_order_sql = '';
+
switch($type) {
case 'direct':
$type_sql = ' AND i.item_private = 2 AND i.item_thread_top = 1 ';
diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php
index 225403535..f9cee6e71 100644
--- a/Zotlabs/Widget/Notifications.php
+++ b/Zotlabs/Widget/Notifications.php
@@ -21,16 +21,16 @@ class Notifications {
'icon' => 'grid-3x3',
'severity' => 'secondary',
'label' => t('Network'),
- 'title' => t('New network activity notifications'),
+ 'title' => t('Unseen network activity'),
'viewall' => [
'url' => 'network',
'label' => t('Network stream')
],
'markall' => [
- 'label' => t('Mark all notifications read')
+ 'label' => t('Mark all read')
],
'filter' => [
- 'posts_label' => t('Show new posts only'),
+ 'posts_label' => t('Conversation starters'),
'name_label' => t('Filter by name or address')
]
];
@@ -40,17 +40,17 @@ class Notifications {
'type' => 'home',
'icon' => 'house',
'severity' => 'danger',
- 'label' => t('Home'),
- 'title' => t('New home activity notifications'),
+ 'label' => t('Channel'),
+ 'title' => t('Unseen channel activity'),
'viewall' => [
'url' => 'channel/' . $channel['channel_address'],
- 'label' => t('Home stream')
+ 'label' => t('Channel stream')
],
'markall' => [
- 'label' => t('Mark all notifications seen')
+ 'label' => t('Mark all seen')
],
'filter' => [
- 'posts_label' => t('Show new posts only'),
+ 'posts_label' => t('Conversation starters'),
'name_label' => t('Filter by name or address')
]
];
@@ -59,17 +59,17 @@ class Notifications {
'type' => 'dm',
'icon' => 'envelope',
'severity' => 'danger',
- 'label' => t('Direct Messages'),
- 'title' => t('New direct messages notifications'),
+ 'label' => t('Private'),
+ 'title' => t('Unseen private activity'),
'viewall' => [
'url' => 'network/?dm=1',
- 'label' => t('Direct messages stream')
+ 'label' => t('Private stream')
],
'markall' => [
- 'label' => t('Mark all notifications read')
+ 'label' => t('Mark all read')
],
'filter' => [
- 'posts_label' => t('Show new posts only'),
+ 'posts_label' => t('Conversation starters'),
'name_label' => t('Filter by name or address')
]
];
@@ -79,13 +79,13 @@ class Notifications {
'icon' => 'calendar-date',
'severity' => 'secondary',
'label' => t('Events'),
- 'title' => t('New events notifications'),
+ 'title' => t('Unseen events activity'),
'viewall' => [
'url' => 'cdav/calendar',
'label' => t('View events')
],
'markall' => [
- 'label' => t('Mark all events seen')
+ 'label' => t('Mark all seen')
]
];
@@ -94,10 +94,10 @@ class Notifications {
'icon' => 'people',
'severity' => 'danger',
'label' => t('New Connections'),
- 'title' => t('New connections notifications'),
+ 'title' => t('New connections'),
'viewall' => [
'url' => 'connections',
- 'label' => t('View all connections')
+ 'label' => t('View all')
]
];
@@ -106,21 +106,21 @@ class Notifications {
'icon' => 'folder',
'severity' => 'danger',
'label' => t('Files'),
- 'title' => t('New files notifications'),
+ 'title' => t('Useen files activity'),
];
$notifications[] = [
'type' => 'notify',
'icon' => 'exclamation-circle',
'severity' => 'danger',
- 'label' => t('Notices'),
- 'title' => t('Notices'),
+ 'label' => t('Notifications'),
+ 'title' => t('Unseen notifications'),
'viewall' => [
'url' => 'notifications/system',
- 'label' => t('View all notices')
+ 'label' => t('View all')
],
'markall' => [
- 'label' => t('Mark all notices seen')
+ 'label' => t('Mark all seen')
]
];
@@ -129,7 +129,7 @@ class Notifications {
'icon' => 'chat-quote',
'severity' => 'secondary',
'label' => t('Forums'),
- 'title' => t('Forums'),
+ 'title' => t('Unseen forums activity'),
'filter' => [
'name_label' => t('Filter by name or address')
]
@@ -142,7 +142,7 @@ class Notifications {
'icon' => 'person-exclamation',
'severity' => 'danger',
'label' => t('Registrations'),
- 'title' => t('New registrations notifications'),
+ 'title' => t('Unseen registration activity'),
];
}
@@ -152,7 +152,7 @@ class Notifications {
'icon' => 'globe',
'severity' => 'secondary',
'label' => t('Public Stream'),
- 'title' => t('New public stream notifications'),
+ 'title' => t('Unseen public stream activity'),
'viewall' => [
'url' => 'pubstream',
'label' => t('Public stream')
@@ -163,7 +163,7 @@ class Notifications {
],
*/
'filter' => [
- 'posts_label' => t('Show new posts only'),
+ 'posts_label' => t('Conversation starters'),
'name_label' => t('Filter by name or address')
]
];
diff --git a/Zotlabs/Widget/Pinned.php b/Zotlabs/Widget/Pinned.php
index be6b98434..7b95d3bc6 100644
--- a/Zotlabs/Widget/Pinned.php
+++ b/Zotlabs/Widget/Pinned.php
@@ -67,19 +67,19 @@ class Pinned {
$attend = null;
$canvote = false;
- $conv_responses = [];
-
- if(in_array($item['obj_type'], ['Event', ACTIVITY_OBJ_EVENT])) {
- $conv_responses['attendyes'] = [ 'title' => t('Attending','title') ];
- $conv_responses['attendno'] = [ 'title' => t('Not attending','title') ];
- $conv_responses['attendmaybe'] = [ 'title' => t('Might attend','title') ];
- if($commentable && $observer) {
- $attend = [ t('I will attend'), t('I will not attend'), t('I might attend') ];
- $isevent = true;
- }
+ $response_verbs[] = 'like';
+
+ if(feature_enabled(\App::$profile['profile_uid'],'dislike')) {
+ $response_verbs[] = 'dislike';
+ }
+
+ $response_verbs[] = 'announce';
+
+ if ($item['obj_type'] === 'Question') {
+ $response_verbs[] = 'answer';
}
- $this->activity($item, $conv_responses);
+ $responses = get_responses($response_verbs, $item);
$verified = (intval($item['item_verified']) ? t('Message signature validated') : '');
$forged = ((! intval($item['item_verified']) && $item['sig']) ? t('Message signature incorrect') : '');
@@ -110,6 +110,9 @@ class Pinned {
'text' => strip_tags($body['html']),
'id' => $item['id'],
'mids' => json_encode([ $midb64 ]),
+ 'mid' => $item['uuid'],
+ 'rawmid' => $item['mid'],
+ 'parent' => $item['parent'],
'isevent' => $isevent,
'attend' => $attend,
'conlabels' => [],
@@ -151,7 +154,7 @@ class Pinned {
'hide' => (! $is_new && isset($observer['xchan_hash']) && $observer['xchan_hash'] != $owner['xchan_hash'] ? t("Don't show") : ''),
// end toolbar buttons
'modal_dismiss' => t('Close'),
- 'responses' => $conv_responses,
+ 'responses' => $responses,
'author_id' => (($author['xchan_addr']) ? $author['xchan_addr'] : $author['xchan_url'])
];
@@ -193,74 +196,14 @@ class Pinned {
if(empty($mids_list))
return [];
- $r = q("SELECT * FROM item WHERE uuid IN ( '%s' ) AND uid = %d AND id = parent AND item_private = 0 ORDER BY created DESC",
+
+ $r = q("SELECT parent AS item_id FROM item WHERE uuid IN ( '%s' ) AND uid = %d AND id = parent AND item_private = 0",
dbesc(implode(",", $mids_list)),
intval($this->uid)
);
- if($r)
- return $r;
-
- return [];
- }
+ return items_by_parent_ids($r, blog_mode: true);
- /*
- * @brief List activities on item
- *
- * @param array $item
- * @param array $conv_responses
- * @return array
- *
- */
- private function activity($item, &$conv_responses) {
-
- foreach(array_keys($conv_responses) as $verb) {
- $verb_sql = '';
-
- switch($verb) {
- case 'like':
- $verb_sql = " AND verb IN ('Like', '" . ACTIVITY_LIKE . "') ";
- break;
- case 'dislike':
- $verb_sql = " AND verb IN ('Dislike', '" . ACTIVITY_DISLIKE . "') ";
- break;
- case 'attendyes':
- $verb_sql = " AND verb IN ('Accept', '" . ACTIVITY_ATTEND . "') ";
- break;
- case 'attendno':
- $verb_sql = " AND verb IN ('Reject', '" . ACTIVITY_ATTENDNO . "') ";
- break;
- case 'attendmaybe':
- $verb_sql = " AND verb IN ('TentativeAccept', '" . ACTIVITY_ATTENDMAYBE . "') ";
- break;
- default:
- break;
- }
-
- $r = q("SELECT * FROM item WHERE parent = %d AND id <> parent $verb_sql AND item_deleted = 0",
- intval($item['id'])
- );
- if(! $r) {
- unset($conv_responses[$verb]);
- continue;
- }
-
- $conv_responses[$verb]['count'] = count($r);
- $conv_responses[$verb]['button'] = get_response_button_text($verb, $conv_responses[$verb]['count']);
-
- foreach($r as $rr) {
-
- $author = q("SELECT * FROM xchan WHERE xchan_hash = '%s' LIMIT 1",
- dbesc($rr['author_xchan'])
- );
- $name = (($author && $author[0]['xchan_name']) ? $author[0]['xchan_name'] : t('Unknown'));
- $conv_responses[$verb]['list'][] = (($rr['author_xchan'] && $author && $author[0]['xchan_photo_s']) ?
- '<a class="dropdown-item" href="' . chanlink_hash($rr['author_xchan']) . '">' . '<img class="menu-img-1" src="' . zid($author[0]['xchan_photo_s']) . '" alt="' . urlencode($name) . '" /> ' . $name . '</a>' :
- '<a class="dropdown-item" href="#" class="disabled">' . $name . '</a>'
- );
- }
- }
-
- $conv_responses['count'] = count($conv_responses);
}
+
}
diff --git a/Zotlabs/Widget/Portfolio.php b/Zotlabs/Widget/Portfolio.php
index bde1c7d6a..1c9dc162a 100644
--- a/Zotlabs/Widget/Portfolio.php
+++ b/Zotlabs/Widget/Portfolio.php
@@ -66,6 +66,10 @@ class Portfolio {
//edit album name
$album_edit = null;
+
+ $ph = photo_factory('');
+ $phototypes = $ph->supportedTypes();
+
$photos = array();
if($r) {
$twist = 'rotright';