Class: Module
Source Location: /include/module.php
Class Module
Inherited Properties, Constants, and Methods
Method Summary
| static
string
|
create_confirm_href() |
Create onClick action string (with href="javascript:void(0);"). |
| static
string
|
create_href() |
Create onClick action string (with href="javascript:void(0);"). |
| static
string
|
create_href_js() |
Create onClick action string destined for js code. |
| static
mixed
|
&static_get_module_variable() |
Returns value of a module variable. If the variable is not set, function will return value given as third parameter. |
| Module |
__construct() |
Constructor. Should not be called directly using new Module('name'). |
| string |
create_back_href() |
Creates link that will lead back to previous page content. |
| string |
create_confirm_unique_href() |
Similar to create_href, but variables passed to this function will only be accessible in module that called this function. |
| string |
create_unique_href() |
Similar to create_href, but variables passed to this function will only be accessible in module that called this function. |
| string |
create_unique_key() |
Returns unique key name, generated from unique name of this module (function get_path) and string parameter. |
| true |
displayed() |
Returns whether this module instance was already displayed. |
| mixed |
display_module() |
Call method of the module passed as first parameter, which name is passed as second parameter. |
| void |
freeze_module() |
Makes child module to not loose its module variables |
| module |
&get_child() |
Gets child module with specified node id. |
| mixed |
get_html_of_module() |
Call method of the module passed as first parameter, which name is passed as second parameter. |
| array |
get_jses() |
Returns list of jses to evaluate. |
| mixed |
&get_module_variable() |
Returns value of a module variable. If the variable is not set, function will return value given as second parameter. |
| string |
get_path() |
Returns unique path of calling module. |
| bool |
get_reload() |
Returns current reload settings. |
| mixed |
init_module() |
Creates module instance which name is given as first parameter. |
| bool |
is_back() |
Checks if set_back_location was used. |
| true |
is_fast_process() |
Returns whether this module instance has fast processing turned on. |
| void |
js() |
Appends js code to list of jses to evaluate. |
| mixed |
pack_module() |
Creates instance of module given as first parameter as a child of the module that has called this function. |
| void |
set_module_variable() |
Sets variable that will be available only for module instance that called this function. |
| void |
set_reload() |
Mark module to force its reload or prevent being reloaded. |
| bool |
share_module_variable() |
Share variable passed as first parameter with module passed as second parameter. |
Methods
static string create_confirm_href(
string
$confirm, [
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Create onClick action string (with href="javascript:void(0);").
Use variables passed as first parameter, to generate variables accessible by $_REQUEST array. This function will trigger js confirm dialog before launching processing. If cancelled, no processing will be done. <xmp> print('<a '.$this->create_href(array('somekey'=>'somevalue'))).'>Link</a>'); </xmp>
Parameters:
|
string |
$confirm: |
question displayed in confirmation box |
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
static string create_href(
[
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Create onClick action string (with href="javascript:void(0);").
Use variables passed as first parameter, to generate variables accessible by $_REQUEST array. <xmp> print('<a '.$this->create_href(array('somekey'=>'somevalue'))).'>Link</a>'); </xmp>
Parameters:
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
static string create_href_js(
[
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Create onClick action string destined for js code.
Use variables passed as first parameter, to generate variables accessible by $_REQUEST array. <xmp> print('<a '.$this->create_href(array('somekey'=>'somevalue'))).'>Link</a>'); </xmp>
Parameters:
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
static void register_method(
$name,
$func
)
|
|
Parameters:
API Tags:
static mixed &static_get_module_variable(
integer
$path, string
$name, [string
$default = null], mixed
3
)
|
|
Returns value of a module variable. If the variable is not set, function will return value given as third parameter.
For details concerning module variables, see set_module_variable.
Parameters:
|
mixed |
3: |
default value |
|
integer |
$path: |
client id |
|
string |
$name: |
module path (returned by get_path() method); |
|
string |
$default: |
key |
API Tags:
| Return: | value |
| Access: | public |
static bool static_isset_module_variable(
integer
$path, string
$name, string
2
)
|
|
Checks if variable exists.
For details concerning module variables, see set_module_variable.
Parameters:
|
string |
2: |
key |
|
integer |
$path: |
client id |
|
string |
$name: |
module path (returned by get_path() method); |
API Tags:
| Return: | true if variable exists, false otherwise |
| Access: | public |
static void static_set_module_variable(
integer
$path, string
$name, string
$value, mixed
3
)
|
|
Sets variable that will be available only for module instance that called this function.
Note that after page refresh, this variable will preserve its value in contrary to module field variables. Module variables are hold separately for every client.
Parameters:
|
mixed |
3: |
value |
|
integer |
$path: |
client id |
|
string |
$name: |
module path (returned by get_path() method); |
|
string |
$value: |
key |
API Tags:
static void static_unset_module_variable(
$path,
$name
)
|
|
Parameters:
API Tags:
Module __construct(
string
$type,
$parent,
$name,
$clear_vars
)
|
|
Constructor. Should not be called directly using new Module('name').
Use $this->pack_module or $this->init_module (inside other module).
Parameters:
|
string |
$type: |
module name |
|
|
$parent: |
|
|
|
$name: |
|
|
|
$clear_vars: |
|
API Tags:
Redefinition of:
- ModulePrimitive::__construct()
void call_callback_href(
$func, [
$args = null]
)
|
|
Parameters:
API Tags:
void clear_module_variables(
)
|
|
Unset all module variables.
For details concerning module variables see set_module_variable.
API Tags:
string create_back_href(
[integer
$i = 1], [string
$indicator = null], [string
$mode = null]
)
|
|
Creates link that will lead back to previous page content.
Use is_back to check it was called.
Parameters:
|
integer |
$i: |
number of times isback() should return true after this link is used |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | string that should be placed inside html tag. See create_href for example. |
| Access: | public |
void create_back_href_js(
[
$i = 1], [
$indicator = null], [
$mode = null]
)
|
|
Parameters:
API Tags:
string create_callback_href(
mixed
$func, [mixed
$args = null], [string
$indicator = null], [string
$mode = null]
)
|
|
Creates link similar to link created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh. WARNING: id of callback is generated using arguments passed to this function, so if you want to create callback that run on every page reload, with different arguments, use create_callback_href_with_id
Parameters:
|
mixed |
$func: |
function |
|
mixed |
$args: |
arguments |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
string create_callback_href_js(
mixed
$func, [mixed
$args = null], [string
$indicator = null], [
$mode = null]
)
|
|
Creates link similar to link created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh. WARNING: id of callback is generated using arguments passed to this function, so if you want to create callback that run on every page reload, with different arguments, use create_callback_href_with_id
Parameters:
|
mixed |
$func: |
function |
|
mixed |
$args: |
arguments |
|
string |
$indicator: |
status bar indicator text |
|
|
$mode: |
|
API Tags:
| Return: | href string |
| Access: | public |
string create_callback_href_with_id(
string
$name, mixed
$func, [mixed
$args = null], [string
$indicator = null], [string
$mode = null]
)
|
|
Creates link similar to links created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh.
Parameters:
|
string |
$name: |
callback id (name) |
|
mixed |
$func: |
function |
|
mixed |
$args: |
arguments |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
string create_callback_href_with_id_js(
string
$name, mixed
$func, [
$args = null], [
$indicator = null], [
$mode = null]
)
|
|
Creates link similar to links created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh.
Parameters:
|
string |
$name: |
callback id (name) |
|
mixed |
$func: |
function |
|
|
$args: |
|
|
|
$indicator: |
|
|
|
$mode: |
|
API Tags:
string create_confirm_callback_href(
string
$confirm, mixed
$func, [mixed
$args = null], [string
$indicator = null], [string
$mode = null]
)
|
|
Creates link similar to link created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh. This function will trigger js confirm dialog before launching processing. If cancelled, no processing will be done. WARNING: id of callback is generated using arguments passed to this function, so if you want to create callback that run on every page reload, with different arguments, use create_callback_href_with_id
Parameters:
|
string |
$confirm: |
question displayed in confirmation box |
|
mixed |
$func: |
function |
|
mixed |
$args: |
arguments |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
string create_confirm_callback_href_with_id(
string
$name, string
$confirm, mixed
$func, [mixed
$args = null], [string
$indicator = null], [string
$mode = null]
)
|
|
Creates link similar to links created with create_href.
The link, when used, will lead to calling of function which name is given as first parameter. Callback returns true if you use this link again after page refresh. This function will trigger js confirm dialog before launching processing. If cancelled, no processing will be done.
Parameters:
|
string |
$name: |
question displayed in confirmation box |
|
string |
$confirm: |
callback id (name) |
|
mixed |
$func: |
function |
|
mixed |
$args: |
arguments |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
string create_confirm_unique_href(
string
$confirm, [
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Similar to create_href, but variables passed to this function will only be accessible in module that called this function.
Those variables can be accessed with get_unique_href_variable. This function will trigger js confirm dialog before launching processing. If cancelled, no processing will be done.
Parameters:
|
string |
$confirm: |
question displayed in confirmation box |
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
string create_unique_href(
[
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Similar to create_href, but variables passed to this function will only be accessible in module that called this function.
Those variables can be accessed with get_unique_href_variable.
Parameters:
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
string create_unique_href_js(
[
$variables = array ()], [string
$indicator = null], [string
$mode = null]
)
|
|
Create onClick action string destined for js code.
Similar to create_href, but variables passed to this function will only be accessible in module that called this function. Those variables can be accessed with get_unique_href_variable.
Parameters:
|
array |
$variables: |
variables to pass along with href |
|
string |
$indicator: |
status bar indicator text |
|
string |
$mode: |
block, allow, queue click on simutanous click |
API Tags:
| Return: | href string |
| Access: | public |
string create_unique_key(
string
$name
)
|
|
Returns unique key name, generated from unique name of this module (function get_path) and string parameter.
This function is called inside create_unique_href function and should not be used directly.
Parameters:
API Tags:
Returns whether this module instance was already displayed.
API Tags:
| Return: | if this module instance was aready displayed, false otherwise |
| Access: | public |
mixed display_module(
module
&$m, [mixed
$args = null], [string
$function_name = null]
)
|
|
Call method of the module passed as first parameter, which name is passed as second parameter.
You can pass additional arguments as next parameters.
Parameters:
|
module |
&$m: |
child module |
|
mixed |
$args: |
arguments |
|
string |
$function_name: |
function to call (get output from), if user has enought privileges. |
API Tags:
| Return: | if access denied returns false, else true |
| Access: | public |
void freeze_module(
string
$module_type, [
$name = null]
)
|
|
Makes child module to not loose its module variables
Parameters:
|
string |
$module_type: |
module |
|
|
$name: |
|
API Tags:
module &get_child(
string
$id
)
|
|
Gets child module with specified node id.
Parameters:
API Tags:
| Return: | object |
| Access: | public |
Gets array of children modules.
API Tags:
| Return: | node id is a key, module object is value |
| Access: | public |
mixed get_html_of_module(
module
&$m, [string
$args = null], [mixed
$function_name = null]
)
|
|
Call method of the module passed as first parameter, which name is passed as second parameter.
You can pass additional arguments as next parameters. Attention: do not pass the result of this function by one module to another module.
Parameters:
|
module |
&$m: |
child module |
|
string |
$args: |
function to call (get output from), if user has enought privileges. |
|
mixed |
$function_name: |
arguments |
API Tags:
| Return: | if access denied returns false, else string |
| Access: | public |
Returns id of module instance.
API Tags:
| Return: | instance id |
| Access: | public |
Returns list of jses to evaluate.
API Tags:
| Return: | list of js commands |
| Access: | public |
mixed &get_module_variable(
string
$name, [mixed
$default = null]
)
|
|
Returns value of a module variable. If the variable is not set, function will return value given as second parameter.
For details concerning module variables, see set_module_variable.
Parameters:
|
string |
$name: |
key |
|
mixed |
$default: |
default value |
API Tags:
| Return: | value |
| Access: | public |
mixed &get_module_variable_or_unique_href_variable(
string
$name, [
$default_value = null]
)
|
|
Returns href variable.
If unique href variable, given as first parameter, is not set, function will try to return value of module variable by that same name. If module variable, given as first parameter, is not set, function will return default value given as second parameter. For details concerning href variables, see create_href. For details concerning module variables, see set_module_variable.
Parameters:
|
string |
$name: |
|
|
|
$default_value: |
|
API Tags:
Get node identifier.
API Tags:
string get_parent_path(
)
|
|
Returns unique path of parent module.
Path contains modules hierarchy information (parent of parent etc.) for the current module. Each module in the path is described as name and instance id.
API Tags:
string get_parent_type(
)
|
|
Returns name(type) of parent module.
API Tags:
| Return: | module name |
| Access: | public |
Returns unique path of calling module.
Path contains modules hierarchy information (parent of parent etc.) for current module. Each module in the path is described as name and instance id. Example: Module named Base/Box, instance 1, without parents: get_path returns '/Base_Box|1'
API Tags:
| Return: | unique module name |
| Access: | public |
Returns current reload settings.
API Tags:
| Return: | true - force reload, false - no reload, null - default (reload changes only if module output changed) |
| Access: | public |
mixed get_unique_href_variable(
string
$key
)
|
|
Returns variable passed with create_unique_href.
Parameters:
API Tags:
| Return: | value |
| Access: | public |
mixed init_module(
string
$module_type, [mixed
$args = null], [string
$name = null], [
$clear_vars = false]
)
|
|
Creates module instance which name is given as first parameter.
Created module instance will be a child to the module which called this function.
Parameters:
|
string |
$module_type: |
module name |
|
mixed |
$args: |
arguments for module constructor |
|
string |
$name: |
unique name for the instance, will be assigned automatically by default |
|
|
$clear_vars: |
|
API Tags:
| Return: | if access denied returns null, else child module object |
| Access: | public |
bool isset_module_variable(
string
$name
)
|
|
Checks if variable exists.
For details concerning module variables, see set_module_variable.
Parameters:
API Tags:
| Return: | true if variable exists, false otherwise |
| Access: | public |
bool isset_unique_href_variable(
string
$key
)
|
|
Checks if variable given as first parameter was passed with create_unique_href function.
Parameters:
API Tags:
| Return: | true if variable was declared, false otherwise |
| Access: | public |
Checks if set_back_location was used.
API Tags:
| Return: | true if back link was used, false otherwise |
| Access: | public |
Returns whether this module instance has fast processing turned on.
API Tags:
| Return: | if this module instance has fast processing turned on, false otherwise |
| Access: | public |
true is_inline_display(
)
|
|
Returns whether this module instance is displayed inline.
API Tags:
| Return: | if this module instance is displayed inline, false otherwise |
| Access: | public |
Appends js code to list of jses to evaluate.
Parameters:
API Tags:
Marks this module instance as it was displayed.
API Tags:
mixed pack_module(
string
$module_type, [string
$display_args = null], [mixed
$function_name = null], [
$construct_args = null], [
$name = null]
)
|
|
Creates instance of module given as first parameter as a child of the module that has called this function.
Also, this function will call newly created module's method, which name is passed as second parameter. You can pass additional arguments as next parameters.
Parameters:
|
string |
$module_type: |
child module name |
|
string |
$display_args: |
function to call |
|
mixed |
$function_name: |
variables |
|
|
$construct_args: |
|
|
|
$name: |
|
API Tags:
| Return: | if access denied returns null, otherwise returns child module object |
| Access: | public |
void set_back_location(
[
$i = 1]
)
|
|
Sets reload location to previous page display.
Use is_back to control when this method was called.
Parameters:
API Tags:
Enable fast processing for this module instance.
API Tags:
void set_inline_display(
)
|
|
Changes display behavior for this module instance to inline.
API Tags:
void set_module_variable(
string
$name, mixed
$value
)
|
|
Sets variable that will be available only for module instance that called this function.
Note that after page refresh, this variable will preserve its value in contrary to module field variables. Module variables are hold separately for every client.
Parameters:
|
string |
$name: |
key |
|
mixed |
$value: |
value |
API Tags:
void set_reload(
bool
$b
)
|
|
Mark module to force its reload or prevent being reloaded.
If this method is not called, module is reloaded by default, which means that only if output changed reload proceeds.
Parameters:
|
bool |
$b: |
true to force reload of whole module, false to suspend reloading |
API Tags:
bool share_module_variable(
string
$name, object module
&$m, [
$name2 = null]
)
|
|
Share variable passed as first parameter with module passed as second parameter.
Any change of this variable will be visible in both modules.
Parameters:
|
string |
$name: |
varaible name |
|
object module |
&$m: |
object |
|
|
$name2: |
|
API Tags:
| Return: | false if module is invalid, true otherwise |
| Access: | public |
bool share_unique_href_variable(
string
$name, object module
&$m, [
$name2 = null]
)
|
|
Share href variable passed as first parameter with module passed as second parameter.
Any change of this variable will be visible in both modules.
Parameters:
|
string |
$name: |
href variable name |
|
object module |
&$m: |
object |
|
|
$name2: |
|
API Tags:
| Return: | false if module is invalid, true otherwise |
| Access: | public |
void unset_module_variable(
string
$name
)
|
|
Unset module variable.
For details concerning module variables see set_module_variable.
Parameters:
API Tags:
void unset_unique_href_variable(
string
$key
)
|
|
Unsets *unique_href variable.
Parameters:
API Tags:
void &__call(
$func_name, [
$args = array()]
)
|
|
Parameters:
API Tags:
Redefined in descendants as:
|
|