mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-03 04:55:36 +02:00
*** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@5304 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5c6f71cdb9
commit
5e606fc6b5
@ -376,123 +376,4 @@ class p_master
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unified module system
|
||||
*
|
||||
* Functions for the ACP
|
||||
*/
|
||||
class p_master_acp extends p_master
|
||||
{
|
||||
/**
|
||||
* Move modules
|
||||
*
|
||||
* Private function used with the ACP module management system for moving modules
|
||||
* within the tree. The movement of modules is limited to their category, they
|
||||
* cannot be moved between categories (reducing complication for users and admins)
|
||||
*
|
||||
* @access private
|
||||
function move($frop_id, $to_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$moved_forums = get_forup_branch($frop_id, 'children', 'descending');
|
||||
$frop_data = $moved_forums[0];
|
||||
$diff = count($moved_forums) * 2;
|
||||
|
||||
$moved_ids = array();
|
||||
for ($i = 0; $i < count($moved_forums); ++$i)
|
||||
{
|
||||
$moved_ids[] = $moved_forums[$i]['forup_id'];
|
||||
}
|
||||
|
||||
// Resync parents
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET right_id = right_id - $diff, forup_parents = ''
|
||||
WHERE left_id < " . $frop_data['right_id'] . "
|
||||
AND right_id > " . $frop_data['right_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Resync righthand side of tree
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET left_id = left_id - $diff, right_id = right_id - $diff, forup_parents = ''
|
||||
WHERE left_id > " . $frop_data['right_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
if ($to_id > 0)
|
||||
{
|
||||
$to_data = get_forup_info($to_id);
|
||||
|
||||
// Resync new parents
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET right_id = right_id + $diff, forup_parents = ''
|
||||
WHERE " . $to_data['right_id'] . ' BETWEEN left_id AND right_id
|
||||
AND forup_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Resync the righthand side of the tree
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET left_id = left_id + $diff, right_id = right_id + $diff, forup_parents = ''
|
||||
WHERE left_id > " . $to_data['right_id'] . '
|
||||
AND forup_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Resync moved branch
|
||||
$to_data['right_id'] += $diff;
|
||||
if ($to_data['right_id'] > $frop_data['right_id'])
|
||||
{
|
||||
$diff = '+ ' . ($to_data['right_id'] - $frop_data['right_id'] - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$diff = '- ' . abs($to_data['right_id'] - $frop_data['right_id'] - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT MAX(right_id) AS right_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forup_id NOT IN (' . implode(', ', $moved_ids) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$diff = '+ ' . ($row['right_id'] - $frop_data['left_id'] + 1);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . "
|
||||
SET left_id = left_id $diff, right_id = right_id $diff, forup_parents = ''
|
||||
WHERE forup_id IN (" . implode(', ', $moved_ids) . ')';
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Unified module system
|
||||
*
|
||||
* This class provides a unified system for the creation and management of
|
||||
* modules used by the ACP, MCP and UCP.
|
||||
*/
|
||||
class p_module
|
||||
{
|
||||
var $tpl_name;
|
||||
|
||||
function p_module()
|
||||
{
|
||||
}
|
||||
|
||||
function check_version()
|
||||
{
|
||||
}
|
||||
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
function install()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user