1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-12 11:40:26 +01:00

- add module_display to modules table (for modes executed but not displayed)

- correctly assign $id variable for modules (name for modules and id for categories)


git-svn-id: file:///svn/phpbb/trunk@5295 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2005-11-08 19:24:19 +00:00
parent 183e968ce7
commit 8a965db7aa
8 changed files with 24 additions and 4 deletions

View File

@ -154,6 +154,7 @@ class p_master
'name' => (string) $row['module_name'],
'mode' => (string) $row['module_mode'],
'display' => (int) $row['module_display'],
'lang' => (function_exists($row['module_name'])) ? $row['module_name']($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
'langname' => $row['module_langname'],
@ -242,7 +243,7 @@ class p_master
// Execute the main method for the new instance, we send the module
// id and mode as parameters
$this->module->main($this->p_id, $this->p_mode);
$this->module->main(($this->p_name) ? $this->p_name : $this->p_id, $this->p_mode);
return;
}
@ -288,6 +289,11 @@ class p_master
// and a linear list for subcategories/items
foreach ($this->module_ary as $row_id => $itep_ary)
{
if (!$itep_ary['display'])
{
continue;
}
$depth = $itep_ary['depth'];
if ($depth > $current_depth)
@ -304,6 +310,8 @@ class p_master
}
}
$u_title = $module_url . '&i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&mode=' . $itep_ary['mode']);
// Only output a categories items if it's currently selected
if (!$depth || ($depth && (in_array($itep_ary['parent'], array_values($this->module_cache['parents'])) || $itep_ary['parent'] == $this->p_parent)))
{
@ -312,7 +320,7 @@ class p_master
$tpl_ary = array(
'L_TITLE' => $itep_ary['lang'],
'S_SELECTED' => (in_array($itep_ary['id'], array_keys($this->module_cache['parents'])) || $itep_ary['id'] == $this->p_id) ? true : false,
'U_TITLE' => $module_url . '&i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&mode=' . $itep_ary['mode'])
'U_TITLE' => $u_title
);
$template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($itep_ary, CASE_UPPER)));
@ -321,7 +329,7 @@ class p_master
$tpl_ary = array(
'L_TITLE' => $itep_ary['lang'],
'S_SELECTED' => (in_array($itep_ary['id'], array_keys($this->module_cache['parents'])) || $itep_ary['id'] == $this->p_id) ? true : false,
'U_TITLE' => $module_url . '&i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&mode=' . $itep_ary['mode'])
'U_TITLE' => $u_title
);
$template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($itep_ary, CASE_UPPER)));

View File

@ -284,6 +284,7 @@ CREATE TABLE phpbb_moderator_cache (
CREATE TABLE phpbb_modules (
module_id INTEGER NOT NULL,
module_enabled INTEGER DEFAULT 1 NOT NULL,
module_display INTEGER DEFAULT 1 NOT NULL,
module_name VARCHAR(20) NOT NULL,
module_class VARCHAR(4) NOT NULL,
parent_id INTEGER NOT NULL,

View File

@ -289,6 +289,7 @@ GO
CREATE TABLE [phpbb_modules] (
[module_id] [int] IDENTITY (1, 1) NOT NULL ,
[module_enabled] [int] NOT NULL ,
[module_display] [int] NOT NULL ,
[module_name] [varchar] (20) NOT NULL ,
[module_class] [varchar] (4) NOT NULL ,
[parent_id] [int] NOT NULL ,
@ -1343,6 +1344,10 @@ ALTER TABLE [phpbb_modules] WITH NOCHECK ADD
CONSTRAINT [DF_module_module_enabled] DEFAULT (1) FOR [module_enabled]
GO
ALTER TABLE [phpbb_modules] WITH NOCHECK ADD
CONSTRAINT [DF_module_module_display] DEFAULT (1) FOR [module_display]
GO
ALTER TABLE [phpbb_poll_results] WITH NOCHECK ADD
CONSTRAINT [DF_poll_r_poll_option_id] DEFAULT (0) FOR [poll_option_id],
CONSTRAINT [DF_poll_r_topic_id] DEFAULT (0) FOR [topic_id],

View File

@ -334,6 +334,7 @@ CREATE TABLE phpbb_moderator_cache (
CREATE TABLE phpbb_modules (
module_id smallint(5) unsigned NOT NULL auto_increment,
module_enabled tinyint(1) NOT NULL default '1',
module_display tinyint(1) NOT NULL default '1',
module_name varchar(20) NOT NULL default '',
module_class varchar(4) NOT NULL default '',
parent_id smallint(5) unsigned NOT NULL default '0',

View File

@ -700,6 +700,7 @@ CREATE INDEX forum_id03 on phpbb_moderator_cache (forum_id)
CREATE TABLE phpbb_modules (
module_id number(8) NOT NULL,
module_enabled number(1) DEFAULT '1' NOT NULL,
module_display number(1) DEFAULT '1' NOT NULL,
module_name varchar2(20) DEFAULT '' NOT NULL,
module_class varchar2(4) DEFAULT '' NOT NULL,
parent_id number(5) DEFAULT '0' NOT NULL,

View File

@ -457,7 +457,8 @@ CREATE SEQUENCE phpbb_modules_module_id_seq;
CREATE TABLE phpbb_modules (
module_id INT4 DEFAULT nextval('phpbb_modules_module_id_seq'),
module_enabled INT2 DEFAULT '1' NOT NULL,
module_enabled INT2 DEFAULT '1' NOT NULL,
module_display INT2 DEFAULT '1' NOT NULL,
module_name varchar(20) DEFAULT '' NOT NULL,
module_class varchar(4) DEFAULT '' NOT NULL,
parent_id INT4 DEFAULT '0' NOT NULL,

View File

@ -335,6 +335,7 @@ CREATE INDEX forum_id_phpbb_moderator_cache on phpbb_moderator_cache (forum_id);
CREATE TABLE phpbb_modules (
module_id INTEGER PRIMARY KEY NOT NULL,
module_enabled tinyint(1) NOT NULL DEFAULT '1',
module_display tinyint(1) NOT NULL DEFAULT '1',
module_name varchar(20) NOT NULL DEFAULT '',
module_class varchar(4) NOT NULL DEFAULT '',
parent_id smallint(5) NOT NULL DEFAULT '0',

View File

@ -264,6 +264,7 @@ $lang += array(
'POST_FORWARD_PM' => 'Forward message',
'POST_NEW_PM' => 'Post message',
'POST_PM_LOCKED' => 'Private Messaging is locked',
'POST_PM_POST' => 'Quote post',
'POST_QUOTE_PM' => 'Quote message',
'POST_REPLY_PM' => 'Reply to message',
'PRINT_PM' => 'Print View',
@ -344,6 +345,7 @@ $lang += array(
'UCP_PM_DRAFTS' => 'PM Drafts',
'UCP_PM_OPTIONS' => 'Options',
'UCP_PM_POPUP' => 'Private Messages',
'UCP_PM_POPUP_TITLE' => 'Private Message Popup',
'UCP_PM_UNREAD' => 'Unread Messages',
'UCP_PM_VIEW' => 'View Messages',