Commit cb59d4a1 authored by Zot's avatar Zot

thread support

parent 4cd56593
......@@ -235,8 +235,12 @@ class Activity {
if($i['mid'] !== $i['parent_mid']) {
$ret['inReplyTo'] = $i['parent_mid'];
$ret['inReplyTo'] = $i['thr_parent'];
$cnv = get_iconfig($i['parent'],'ostatus','conversation');
if(! $cnv) {
$cnv = $ret['parent_mid'];
}
$reply = true;
if($i['item_private']) {
......@@ -608,8 +612,13 @@ class Activity {
}
}
if($i['id'] != $i['parent']) {
$ret['inReplyTo'] = $i['parent_mid'];
if($i['mid'] != $i['parent_mid']) {
$ret['inReplyTo'] = $i['thr_parent'];
$cnv = get_iconfig($i['parent'],'ostatus','conversation');
if(! $cnv) {
$cnv = $ret['parent_mid'];
}
$reply = true;
if($i['item_private']) {
......@@ -634,6 +643,13 @@ class Activity {
}
if(! $cnv) {
$cnv = get_iconfig($i,'ostatus','conversation');
}
if($cnv) {
$ret['conversation'] = $cnv;
}
$ret['inheritPrivacy'] = true;
$actor = self::encode_person($i['author'],false);
......
......@@ -36,6 +36,7 @@ class ThreadItem {
$this->data = $data;
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
$this->threaded = get_config('system','thread_allow',((defined('NOMADIC')) ? false : true));
$observer = \App::get_observer();
......@@ -409,6 +410,7 @@ class ThreadItem {
'attend_title' => t('Attendance Options'),
'vote_label' => t('Vote'),
'vote_title' => t('Voting Options'),
'comment_lbl' => (($this->is_commentable() && $observer) ? t('Comment') : ''),
'is_comment' => $is_comment,
'is_new' => $is_new,
'owner_url' => $this->get_owner_url(),
......@@ -798,7 +800,7 @@ class ThreadItem {
*/
private function get_comment_box($indent) {
if(!$this->is_toplevel() && !get_config('system','thread_allow')) {
if(!$this->is_toplevel() && !get_config('system','thread_allow',((defined('NOMADIC')) ? false : true))) {
return '';
}
......
......@@ -1432,7 +1432,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(get_config('system','thread_allow',((defined('NOMADIC')) ? false : true))) {
// Fallback to parent_mid if thr_parent is not set
$thr_parent = $item['thr_parent'];
if($thr_parent == '')
......
......@@ -221,8 +221,11 @@ function oembed_fetch_url($embedurl){
if(strpos(strtolower($embedurl),'.pdf') !== false) {
$action = 'allow';
$j = [ 'html' => '<object data="' . $embedurl . '" type="application/pdf" width="500" height="720">' . '<a href="' . $embedurl . '">' . t('View PDF') . '</a></object>', 'width' => 500, 'height' => 720, 'type' => 'pdf' ];
$j = [
'html' => '<object data="' . $embedurl . '" type="application/pdf" style="width: 100%; height: 300px;"></object>',
'title' => t('View PDF'),
'type' => 'pdf'
];
}
if(! $j) {
......
......@@ -120,9 +120,9 @@ function toggleAside() {
$('main').addClass('region_1-on')
$('<div id="overlay"></div>').appendTo('section');
$('#left_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true) + 10,
parent: '#region_1',
spacer: '#left_aside_spacer'
offset_top: parseInt($('aside').css('padding-top')),
parent: 'main',
spacer: '.aside_spacer'
});
}
}
......@@ -103,6 +103,11 @@
<i class="fa fa-thumbs-o-down{{if $item.my_responses.dislike}} ivoted{{/if}}" ></i>
</button>
{{/if}}
{{if $item.comment && $item.thread_level > 1}}
<button type="button" title="{{$item.comment_lbl}}" class="btn btn-outline-secondary btn-sm" onclick="openClose('wall-item-comment-wrapper-{{$item.id}}'); $('#comment-edit-text-{{$item.id}}').click(); return false;">
<i class="fa fa-comment-o"></i>
</button>
{{/if}}
{{if $item.isevent}}
<div class="btn-group">
<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" id="wall-item-attend-menu-{{$item.id}}" title="{{$item.attend_title}}">
......@@ -240,7 +245,7 @@
{{/foreach}}
{{/if}}
{{if $item.comment}}
<div class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
<div id="wall-item-comment-wrapper-{{$item.id}}" class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" {{if $item.thread_level > 1}} style="display:none;"{{/if}}>
{{$item.comment}}
</div>
{{/if}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment