mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12559] Add forum setting to limit subforum legend
Squashed all commits, they were basically just typos and errors PHPBB3-12559
This commit is contained in:
parent
ce35aa8b0b
commit
6ccffec906
5 changed files with 58 additions and 1 deletions
|
@ -210,6 +210,11 @@
|
|||
<dd><label><input type="radio" class="radio" name="display_subforum_list" value="1"<!-- IF S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="display_subforum_list" value="0"<!-- IF not S_DISPLAY_SUBFORUM_LIST --> id="display_subforum_list" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="display_subforum_limit">{L_LIMIT_SUBFORUMS}{L_COLON}</label><br /><span>{L_LIMIT_SUBFORUMS_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="display_subforum_limit" value="1"<!-- IF S_DISPLAY_SUBFORUM_LIMIT --> id="display_subforum_limit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="display_subforum_limit" value="0"<!-- IF not S_DISPLAY_SUBFORUM_LIMIT --> id="display_subforum_limit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="display_on_index">{L_LIST_INDEX}{L_COLON}</label><br /><span>{L_LIST_INDEX_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="display_on_index" value="1"<!-- IF S_DISPLAY_ON_INDEX --> id="display_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
|
|
|
@ -132,6 +132,7 @@ class acp_forums
|
|||
'forum_image' => $request->variable('forum_image', ''),
|
||||
'forum_style' => $request->variable('forum_style', 0),
|
||||
'display_subforum_list' => $request->variable('display_subforum_list', true),
|
||||
'display_subforum_limit'=> $request->variable('display_subforum_limit', false),
|
||||
'display_on_index' => $request->variable('display_on_index', true),
|
||||
'forum_topics_per_page' => $request->variable('topics_per_page', 0),
|
||||
'enable_indexing' => $request->variable('enable_indexing', true),
|
||||
|
@ -454,6 +455,7 @@ class acp_forums
|
|||
'forum_image' => '',
|
||||
'forum_style' => 0,
|
||||
'display_subforum_list' => true,
|
||||
'display_subforum_limit' => false,
|
||||
'display_on_index' => true,
|
||||
'forum_topics_per_page' => 0,
|
||||
'enable_indexing' => true,
|
||||
|
@ -676,6 +678,7 @@ class acp_forums
|
|||
'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false,
|
||||
'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false,
|
||||
'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false,
|
||||
'S_DISPLAY_SUBFORUM_LIMIT' => ($forum_data['display_subforum_limit']) ? true : false,
|
||||
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
|
||||
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
|
||||
'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false,
|
||||
|
|
|
@ -30,6 +30,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
|
||||
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
|
||||
$parent_id = $visible_forums = 0;
|
||||
$parent_subforum_limit = false;
|
||||
|
||||
// Mark forums read?
|
||||
$mark_read = $request->variable('mark', '');
|
||||
|
@ -266,6 +267,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
|
||||
// Direct child of current branch
|
||||
$parent_id = $forum_id;
|
||||
$parent_subforum_limit = $row['display_subforum_limit'];
|
||||
$forum_rows[$forum_id] = $row;
|
||||
|
||||
if ($row['forum_type'] == FORUM_CAT && $row['parent_id'] == $root_data['forum_id'])
|
||||
|
@ -278,7 +280,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
}
|
||||
else if ($row['forum_type'] != FORUM_CAT)
|
||||
{
|
||||
$subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index']) ? true : false;
|
||||
$subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index'] && !($parent_subforum_limit && $parent_id !== $row['parent_id'])) ? true : false;
|
||||
$subforums[$parent_id][$forum_id]['name'] = $row['forum_name'];
|
||||
$subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
|
||||
$subforums[$parent_id][$forum_id]['children'] = array();
|
||||
|
|
|
@ -129,6 +129,8 @@ $lang = array_merge($lang, array(
|
|||
'GENERAL_FORUM_SETTINGS' => 'General forum settings',
|
||||
|
||||
'LINK' => 'Link',
|
||||
'LIMIT_SUBFORUMS' => 'Limit legend to direct child-subforums',
|
||||
'LIMIT_SUBFORUMS_EXPLAIN' => 'Limits the subforums to be displayed to subforums that are direct descendants (children) of the current forum. Disabling this will display all subforums with the “List subforums in legend” option enabled, regardless of depth.',
|
||||
'LIST_INDEX' => 'List subforum in parent-forum’s legend',
|
||||
'LIST_INDEX_EXPLAIN' => 'Displays this forum on the index and elsewhere as a link within the legend of its parent-forum if the parent-forum’s “List subforums in legend” option is enabled.',
|
||||
'LIST_SUBFORUMS' => 'List subforums in legend',
|
||||
|
|
45
phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php
Normal file
45
phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* @package migration
|
||||
* @copyright (c) 2014 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v310;
|
||||
|
||||
class forums_legend_limit extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array('\phpbb\db\migration\data\v310\beta3');
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_columns' => array(
|
||||
$this->table_prefix . 'forums' => array(
|
||||
'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_columns' => array(
|
||||
$this->table_prefix . 'forums' => array(
|
||||
'display_subforum_limit',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue