1
1
Fork 0

Merge pull request #3978 from annando/always-threads

Threads are now always enabled.
This commit is contained in:
Tobias Diekershoff 2017-11-28 20:19:18 +01:00 committed by GitHub
commit 7b5a0fdbe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 5 additions and 30 deletions

View file

@ -1517,15 +1517,13 @@ function conv_sort(array $item_list, $order)
usort($parents, 'sort_thr_commented'); usort($parents, 'sort_thr_commented');
} }
$thread_allowed = Config::get('system', 'thread_allow') && get_app()->theme_thread_allow;
/* /*
* Plucks children from the item_array, second pass collects eventual orphan * Plucks children from the item_array, second pass collects eventual orphan
* items and add them as children of their top-level post. * items and add them as children of their top-level post.
*/ */
foreach ($parents as $i => $parent) { foreach ($parents as $i => $parent) {
$parents[$i]['children'] = $parents[$i]['children'] =
array_merge(get_item_children($item_array, $parent, $thread_allowed), array_merge(get_item_children($item_array, $parent, true),
get_item_children($item_array, $parent, false)); get_item_children($item_array, $parent, false));
} }
@ -1533,7 +1531,7 @@ function conv_sort(array $item_list, $order)
$parents[$i]['children'] = sort_item_children($parents[$i]['children']); $parents[$i]['children'] = sort_item_children($parents[$i]['children']);
} }
if ($thread_allowed && PConfig::get(local_user(), 'system', 'smart_threading', 0)) { if (PConfig::get(local_user(), 'system', 'smart_threading', 0)) {
foreach ($parents as $i => $parent) { foreach ($parents as $i => $parent) {
$parents[$i] = smart_flatten_conversation($parent); $parents[$i] = smart_flatten_conversation($parent);
} }

View file

@ -814,7 +814,6 @@ function admin_page_site_post(App $a) {
$block_public = ((x($_POST,'block_public')) ? True : False); $block_public = ((x($_POST,'block_public')) ? True : False);
$force_publish = ((x($_POST,'publish_all')) ? True : False); $force_publish = ((x($_POST,'publish_all')) ? True : False);
$global_directory = ((x($_POST,'directory')) ? notags(trim($_POST['directory'])) : ''); $global_directory = ((x($_POST,'directory')) ? notags(trim($_POST['directory'])) : '');
$thread_allow = ((x($_POST,'thread_allow')) ? True : False);
$newuser_private = ((x($_POST,'newuser_private')) ? True : False); $newuser_private = ((x($_POST,'newuser_private')) ? True : False);
$enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False); $enotify_no_content = ((x($_POST,'enotify_no_content')) ? True : False);
$private_addons = ((x($_POST,'private_addons')) ? True : False); $private_addons = ((x($_POST,'private_addons')) ? True : False);
@ -874,9 +873,6 @@ function admin_page_site_post(App $a) {
if ($a->get_path() != "") { if ($a->get_path() != "") {
$diaspora_enabled = false; $diaspora_enabled = false;
} }
if (!$thread_allow) {
$ostatus_disabled = true;
}
if ($ssl_policy != intval(Config::get('system','ssl_policy'))) { if ($ssl_policy != intval(Config::get('system','ssl_policy'))) {
if ($ssl_policy == SSL_POLICY_FULL) { if ($ssl_policy == SSL_POLICY_FULL) {
q("UPDATE `contact` SET q("UPDATE `contact` SET
@ -975,7 +971,6 @@ function admin_page_site_post(App $a) {
Config::set('system', 'allowed_email', $allowed_email); Config::set('system', 'allowed_email', $allowed_email);
Config::set('system', 'block_public', $block_public); Config::set('system', 'block_public', $block_public);
Config::set('system', 'publish_all', $force_publish); Config::set('system', 'publish_all', $force_publish);
Config::set('system', 'thread_allow', $thread_allow);
Config::set('system', 'newuser_private', $newuser_private); Config::set('system', 'newuser_private', $newuser_private);
Config::set('system', 'enotify_no_content', $enotify_no_content); Config::set('system', 'enotify_no_content', $enotify_no_content);
Config::set('system', 'disable_embedded', $disable_embedded); Config::set('system', 'disable_embedded', $disable_embedded);
@ -1214,7 +1209,6 @@ function admin_page_site(App $a) {
'$block_public' => array('block_public', t("Block public"), Config::get('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")), '$block_public' => array('block_public', t("Block public"), Config::get('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")),
'$force_publish' => array('publish_all', t("Force publish"), Config::get('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), '$force_publish' => array('publish_all', t("Force publish"), Config::get('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$global_directory' => array('directory', t("Global directory URL"), Config::get('system','directory'), t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")), '$global_directory' => array('directory', t("Global directory URL"), Config::get('system','directory'), t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")),
'$thread_allow' => array('thread_allow', t("Allow threaded items"), Config::get('system','thread_allow'), t("Allow infinite level threading for items on this site.")),
'$newuser_private' => array('newuser_private', t("Private posts by default for new users"), Config::get('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")), '$newuser_private' => array('newuser_private', t("Private posts by default for new users"), Config::get('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")),
'$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")), '$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")),
'$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")), '$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")),

View file

@ -73,7 +73,6 @@ class App {
public $videowidth = 425; public $videowidth = 425;
public $videoheight = 350; public $videoheight = 350;
public $force_max_items = 0; public $force_max_items = 0;
public $theme_thread_allow = true;
public $theme_events_in_profile = true; public $theme_events_in_profile = true;
/** /**
@ -87,7 +86,6 @@ class App {
'videowidth' => 425, 'videowidth' => 425,
'videoheight' => 350, 'videoheight' => 350,
'force_max_items' => 0, 'force_max_items' => 0,
'thread_allow' => true,
'stylesheet' => '', 'stylesheet' => '',
'template_engine' => 'smarty3', 'template_engine' => 'smarty3',
); );

View file

@ -66,7 +66,7 @@ class Item extends BaseObject
$ssl_state = ((local_user()) ? true : false); $ssl_state = ((local_user()) ? true : false);
$this->redirect_url = 'redir/' . $this->getDataValue('cid'); $this->redirect_url = 'redir/' . $this->getDataValue('cid');
if (Config::get('system', 'thread_allow') && $a->theme_thread_allow && !$this->isToplevel()) { if (!$this->isToplevel()) {
$this->threaded = true; $this->threaded = true;
} }
@ -744,9 +744,6 @@ class Item extends BaseObject
private function getCommentBox($indent) private function getCommentBox($indent)
{ {
$a = self::getApp(); $a = self::getApp();
if (!$this->isToplevel() && !(Config::get('system', 'thread_allow') && $a->theme_thread_allow)) {
return '';
}
$comment_box = ''; $comment_box = '';
$conv = $this->getConversation(); $conv = $this->getConversation();

View file

@ -83,15 +83,8 @@
{{include file="field_select.tpl" field=$community_page_style}} {{include file="field_select.tpl" field=$community_page_style}}
{{include file="field_input.tpl" field=$max_author_posts_community_page}} {{include file="field_input.tpl" field=$max_author_posts_community_page}}
{{if $thread_allow.2}}
{{include file="field_checkbox.tpl" field=$ostatus_disabled}} {{include file="field_checkbox.tpl" field=$ostatus_disabled}}
{{include file="field_checkbox.tpl" field=$ostatus_full_threads}} {{include file="field_checkbox.tpl" field=$ostatus_full_threads}}
{{else}}
<div class='field checkbox' id='div_id_{{$ostatus_disabled.0}}'>
<label for='id_{{$ostatus_disabled.0}}'>{{$ostatus_disabled.1}}</label>
<span id='id_{{$ostatus_disabled.0}}'>{{$ostatus_not_able}}</span>
</div>
{{/if}}
{{if $diaspora_able}} {{if $diaspora_able}}
{{include file="field_checkbox.tpl" field=$diaspora_enabled}} {{include file="field_checkbox.tpl" field=$diaspora_enabled}}
@ -104,7 +97,6 @@
{{include file="field_checkbox.tpl" field=$dfrn_only}} {{include file="field_checkbox.tpl" field=$dfrn_only}}
{{include file="field_input.tpl" field=$global_directory}} {{include file="field_input.tpl" field=$global_directory}}
<div class="submit"><input type="submit" name="republish_directory" value="{{$republish|escape:'html'}}" /></div> <div class="submit"><input type="submit" name="republish_directory" value="{{$republish|escape:'html'}}" /></div>
{{include file="field_checkbox.tpl" field=$thread_allow}}
{{include file="field_checkbox.tpl" field=$newuser_private}} {{include file="field_checkbox.tpl" field=$newuser_private}}
{{include file="field_checkbox.tpl" field=$enotify_no_content}} {{include file="field_checkbox.tpl" field=$enotify_no_content}}
{{include file="field_checkbox.tpl" field=$private_addons}} {{include file="field_checkbox.tpl" field=$private_addons}}

View file

@ -43,7 +43,6 @@
{{include file="field_checkbox.tpl" field=$diaspora_enabled}} {{include file="field_checkbox.tpl" field=$diaspora_enabled}}
{{include file="field_checkbox.tpl" field=$dfrn_only}} {{include file="field_checkbox.tpl" field=$dfrn_only}}
{{include file="field_input.tpl" field=$global_directory}} {{include file="field_input.tpl" field=$global_directory}}
{{include file="field_checkbox.tpl" field=$thread_allow}}
{{include file="field_checkbox.tpl" field=$newuser_private}} {{include file="field_checkbox.tpl" field=$newuser_private}}
{{include file="field_checkbox.tpl" field=$enotify_no_content}} {{include file="field_checkbox.tpl" field=$enotify_no_content}}
{{include file="field_checkbox.tpl" field=$private_addons}} {{include file="field_checkbox.tpl" field=$private_addons}}

View file

@ -16,7 +16,6 @@ function frost_mobile_init(App $a) {
$a->sourcename = 'Friendica mobile web'; $a->sourcename = 'Friendica mobile web';
$a->videowidth = 250; $a->videowidth = 250;
$a->videoheight = 200; $a->videoheight = 200;
$a->theme_thread_allow = false;
$a->force_max_items = 10; $a->force_max_items = 10;
$a->set_template_engine('smarty3'); $a->set_template_engine('smarty3');
} }

View file

@ -43,7 +43,6 @@
{{include file="field_checkbox.tpl" field=$diaspora_enabled}} {{include file="field_checkbox.tpl" field=$diaspora_enabled}}
{{include file="field_checkbox.tpl" field=$dfrn_only}} {{include file="field_checkbox.tpl" field=$dfrn_only}}
{{include file="field_input.tpl" field=$global_directory}} {{include file="field_input.tpl" field=$global_directory}}
{{include file="field_checkbox.tpl" field=$thread_allow}}
{{include file="field_checkbox.tpl" field=$newuser_private}} {{include file="field_checkbox.tpl" field=$newuser_private}}
{{include file="field_checkbox.tpl" field=$enotify_no_content}} {{include file="field_checkbox.tpl" field=$enotify_no_content}}
{{include file="field_checkbox.tpl" field=$private_addons}} {{include file="field_checkbox.tpl" field=$private_addons}}

View file

@ -15,7 +15,6 @@ use Friendica\Core\System;
function frost_init(App $a) { function frost_init(App $a) {
$a->videowidth = 400; $a->videowidth = 400;
$a->videoheight = 330; $a->videoheight = 330;
$a->theme_thread_allow = false;
$a->set_template_engine('smarty3'); $a->set_template_engine('smarty3');
} }