aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-10-12 12:13:44 +0200
committerMario Vavti <mario@mariovavti.com>2016-10-12 12:13:44 +0200
commitcf547be1d6900d12719a9372cbc1a5d433d31863 (patch)
tree03a525cf40905adafc21b0c4146e467bad288437 /include/conversation.php
parent29617737ca2c03c800ebbe4701dc21cf9f25ce22 (diff)
parent16da1a4e810889448eecbd13d68183a820bcebe2 (diff)
downloadvolse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.tar.gz
volse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.tar.bz2
volse-hubzilla-cf547be1d6900d12719a9372cbc1a5d433d31863.zip
Merge branch '1.14RC'
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php46
1 files changed, 33 insertions, 13 deletions
diff --git a/include/conversation.php b/include/conversation.php
index b53498d20..287dd4983 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -712,10 +712,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'forged' => $forged,
'txt_cats' => t('Categories:'),
'txt_folders' => t('Filed under:'),
- 'has_cats' => ((count($categories)) ? 'true' : ''),
- 'has_folders' => ((count($folders)) ? 'true' : ''),
- 'categories' => $categories,
- 'folders' => $folders,
+ 'has_cats' => ((count($body['categories'])) ? 'true' : ''),
+ 'has_folders' => ((count($body['folders'])) ? 'true' : ''),
'text' => strip_tags($body['html']),
'ago' => relative_date($item['created']),
'app' => $item['app'],
@@ -723,7 +721,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
- 'expiretime' => (($item['expires'] !== NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
+ 'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'location' => $location,
'indent' => '',
'owner_name' => $owner_name,
@@ -941,12 +939,9 @@ function item_photo_menu($item){
$clean_url = normalise_link($item['author-link']);
}
- $poco_rating = get_config('system','poco_rating_enable');
- // if unset default to enabled
- if($poco_rating === false)
- $poco_rating = true;
+ $rating_enabled = get_config('system','rating_enabled');
- $ratings_url = (($poco_rating) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : '');
+ $ratings_url = (($rating_enabled) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : '');
$post_menu = Array(
t("View Source") => $vsrc_link,
@@ -1056,6 +1051,9 @@ function builtin_activity_puller($item, &$conv_responses) {
$conv_responses[$mode][$item['thr_parent']] ++;
$conv_responses[$mode][$item['thr_parent'] . '-l'][] = $url;
+ if(get_observer_hash() && get_observer_hash() === $item['author_xchan']) {
+ $conv_responses[$mode][$item['thr_parent'] . '-m'] = true;
+ }
// there can only be one activity verb per item so if we found anything, we can stop looking
return;
@@ -1121,6 +1119,10 @@ function status_editor($a, $x, $popup = false) {
$feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools');
if(x($x, 'hide_voting'))
$feature_voting = false;
+
+ $feature_nocomment = feature_enabled($x['profile_uid'], 'disable_comments');
+ if(x($x, 'disable_comments'))
+ $feature_nocomment = false;
$feature_expire = ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false);
if(x($x, 'hide_expire'))
@@ -1190,12 +1192,12 @@ function status_editor($a, $x, $popup = false) {
'$modalerrorlist' => t('Error getting album list'),
'$modalerrorlink' => t('Error getting photo link'),
'$modalerroralbum' => t('Error getting album'),
+ '$nocomment_enabled' => t('Comments enabled'),
+ '$nocomment_disabled' => t('Comments disabled'),
));
$tpl = get_markup_template('jot.tpl');
- $jotplugins = '';
-
$preview = t('Preview');
if(x($x, 'hide_preview'))
$preview = '';
@@ -1212,8 +1214,18 @@ function status_editor($a, $x, $popup = false) {
if(! $cipher)
$cipher = 'aes256';
+ // avoid illegal offset errors
+ if(! array_key_exists('permissions',$x))
+ $x['permissions'] = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
+
+ $jotplugins = '';
call_hooks('jot_tool', $jotplugins);
+ $jotnets = '';
+ if(x($x,'jotnets')) {
+ call_hooks('jot_networks', $jotnets);
+ }
+
$o .= replace_macros($tpl, array(
'$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string),
'$action' => z_root() . '/item',
@@ -1239,6 +1251,10 @@ function status_editor($a, $x, $popup = false) {
'$voting' => t('Toggle voting'),
'$feature_voting' => $feature_voting,
'$consensus' => 0,
+ '$nocommenttitle' => t('Disable comments'),
+ '$nocommenttitlesub' => t('Toggle comments'),
+ '$feature_nocomment' => $feature_nocomment,
+ '$nocomment' => 0,
'$clearloc' => $clearloc,
'$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''),
'$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')),
@@ -1266,6 +1282,8 @@ function status_editor($a, $x, $popup = false) {
'$preview' => $preview,
'$source' => ((x($x, 'source')) ? $x['source'] : ''),
'$jotplugins' => $jotplugins,
+ '$jotnets' => $jotnets,
+ '$jotnets_label' => t('Other networks and post services'),
'$defexpire' => $defexpire,
'$feature_expire' => $feature_expire,
'$expires' => t('Set expiration date'),
@@ -1608,6 +1626,8 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
$uid = ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : local_channel());
+ $account_id = ((App::$profile['profile_uid']) ? App::$profile['channel_account_id'] : App::$channel['channel_account_id']);
+
if($uid == local_channel()) {
$cal_link = '';
@@ -1710,7 +1730,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
);
}
- if(feature_enabled($uid,'wiki') && (get_config('system','server_role') !== 'basic')) {
+ if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) {
$tabs[] = array(
'label' => t('Wiki'),
'url' => z_root() . '/wiki/' . $nickname,