PHP 클래스 p_master

파일 보기 프로젝트 열기: phpbb/phpbb 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$acl_forum_id
$active_module
$active_module_row_id
$include_path
$module_ary
$p_class
$p_id
$p_mode
$p_name
$p_parent

공개 메소드들

메소드 설명
add_mod_info ( $module_class ) Add custom MOD info language file
adjust_url ( string $url_extra ) Appending url parameter to the currently active module.
assign_tpl_vars ( $module_url ) Build navigation structure
build_tree ( &$modules, &$parents ) Build true binary tree from given array Not in use
display ( $page_title, $display_online_list = false ) Display module
get_branch ( $left_id, $right_id, $remaining ) Get tree branch
get_page_title ( ) Returns the desired page title
get_parents ( $parent_id, $left_id, $right_id, &$all_parents ) Get parents
get_tpl_name ( ) Returns desired template name
is_active ( $id, $mode = false ) Check if a module is active
list_modules ( $p_class ) List modules
load ( string $class, string $name, string $mode = false ) Load module as the current active one without the need for registering it
load_active ( string | false $mode = false, string | false $module_url = false, boolean $execute_module = true ) Loads currently active module
loaded ( string $module_basename, mixed $module_mode = false ) : boolean Check if a certain main module is accessible/loaded By giving the module mode you are able to additionally check for only one mode within the main module
module_auth ( $module_auth, $forum_id ) Check module authorisation.
module_auth_self ( $module_auth ) Check module authorisation.
p_master ( $include_path = false ) Constuctor Set module include path
set_active ( $id = false, $mode = false ) Set active module
set_custom_include_path ( string $include_path ) Set custom include path for modules Schema for inclusion is include_path . modulebase
set_display ( $id, $mode = false, $display = true ) Toggle whether this module will be displayed or not

보호된 메소드들

메소드 설명
get_module_identifier ( string $basename ) : string If the basename contains a \ we don't use that for the URL.
get_short_name ( string $basename ) : string Retrieve shortened module basename for legacy basenames (with xcp_ prefix)
is_full_class ( string $basename ) : boolean Checks whether the given module basename is a correct class name

메소드 상세

add_mod_info() 공개 메소드

Add custom MOD info language file
public add_mod_info ( $module_class )

adjust_url() 공개 메소드

This function is called for adding specific url parameters while executing the current module. It is doing the same as the _module_{name}_url() function, apart from being able to be called after having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters. One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call.
public adjust_url ( string $url_extra )
$url_extra string Extra url parameters, e.g.: &u=$user_id

assign_tpl_vars() 공개 메소드

Build navigation structure
public assign_tpl_vars ( $module_url )

build_tree() 공개 메소드

Build true binary tree from given array Not in use
public build_tree ( &$modules, &$parents )

display() 공개 메소드

Display module
public display ( $page_title, $display_online_list = false )

get_branch() 공개 메소드

Get tree branch
public get_branch ( $left_id, $right_id, $remaining )

get_module_identifier() 보호된 메소드

Firefox is currently unable to correctly copy a urlencoded \ so users will be unable to post links to modules. However we can replace them with dashes and re-replace them later
protected get_module_identifier ( string $basename ) : string
$basename string Basename of the module
리턴 string Identifier that should be used for module link creation

get_page_title() 공개 메소드

Returns the desired page title
public get_page_title ( )

get_parents() 공개 메소드

Get parents
public get_parents ( $parent_id, $left_id, $right_id, &$all_parents )

get_short_name() 보호된 메소드

Retrieve shortened module basename for legacy basenames (with xcp_ prefix)
protected get_short_name ( string $basename ) : string
$basename string A module basename
리턴 string The basename if it starts with phpbb_ or the basename with the current p_class (e.g. acp_) stripped.

get_tpl_name() 공개 메소드

Returns desired template name
public get_tpl_name ( )

is_active() 공개 메소드

Check if a module is active
public is_active ( $id, $mode = false )

is_full_class() 보호된 메소드

Checks whether the given module basename is a correct class name
protected is_full_class ( string $basename ) : boolean
$basename string A module basename
리턴 boolean True if the basename starts with phpbb_ or (x)cp_, false otherwise

list_modules() 공개 메소드

This creates a list, stored in $this->module_ary of all available modules for the given class (ucp, mcp and acp). Additionally $this->module_y_ary is created with indentation information for displaying the module list appropriately. Only modules for which the user has access rights are included in these lists.
public list_modules ( $p_class )

load() 공개 메소드

Load module as the current active one without the need for registering it
public load ( string $class, string $name, string $mode = false )
$class string module class (acp/mcp/ucp)
$name string module name (class name of the module, or its basename phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra)
$mode string mode, as passed through to the module

load_active() 공개 메소드

This method loads a given module, passing it the relevant id and mode.
public load_active ( string | false $mode = false, string | false $module_url = false, boolean $execute_module = true )
$mode string | false mode, as passed through to the module
$module_url string | false If supplied, we use this module url
$execute_module boolean If true, at the end we execute the main method for the new instance

loaded() 공개 메소드

Check if a certain main module is accessible/loaded By giving the module mode you are able to additionally check for only one mode within the main module
public loaded ( string $module_basename, mixed $module_mode = false ) : boolean
$module_basename string The module base name, for example logs, reports, main (for the mcp).
$module_mode mixed The module mode to check. If provided the mode will be checked in addition for presence.
리턴 boolean Returns true if module is loaded and accessible, else returns false

module_auth() 정적인 공개 메소드

This is a static version, it must be given $forum_id. See also module_auth_self.
static public module_auth ( $module_auth, $forum_id )

module_auth_self() 공개 메소드

This is a non-static version that uses $this->acl_forum_id for the forum id.
public module_auth_self ( $module_auth )

p_master() 공개 메소드

Constuctor Set module include path
public p_master ( $include_path = false )

set_active() 공개 메소드

Set active module
public set_active ( $id = false, $mode = false )

set_custom_include_path() 공개 메소드

Set custom include path for modules Schema for inclusion is include_path . modulebase
public set_custom_include_path ( string $include_path )
$include_path string include path to be used.

set_display() 공개 메소드

Toggle whether this module will be displayed or not
public set_display ( $id, $mode = false, $display = true )

프로퍼티 상세

$acl_forum_id 공개적으로 프로퍼티

public $acl_forum_id

$active_module 공개적으로 프로퍼티

public $active_module

$active_module_row_id 공개적으로 프로퍼티

public $active_module_row_id

$include_path 공개적으로 프로퍼티

public $include_path

$module_ary 공개적으로 프로퍼티

public $module_ary

$p_class 공개적으로 프로퍼티

public $p_class

$p_id 공개적으로 프로퍼티

public $p_id

$p_mode 공개적으로 프로퍼티

public $p_mode

$p_name 공개적으로 프로퍼티

public $p_name

$p_parent 공개적으로 프로퍼티

public $p_parent