class System extends Controller

System "Fake" Module

Traits

Trait CoreLinkMethods
Trait ObjectManager XELOS Framework

Properties

protected array $object_cache Each object created by a success call of __call or __get will be saved into this property to avoid a multiple creation of same objects and minimize performance loss. If the multiple creation of objects is desirable e.g. in factory classes, the caching can be disabled by setting xf_trait::factory_mode to true. from ObjectManager
protected array[] $registry The instantiation of a requested object can be processed only if the class of the object is registered with the class name as key and its information as array in this property. The element should have at least the class name or the relative path to "class" folder. from ObjectManager
protected string $lib_class_dir This property contains the path to the folder served as root for all requested classes. This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly. from ObjectManager
protected string $lib_class_prefix An optional possibility to pretend a prefix for all registered classes. from ObjectManager
protected string $ns_class_prefix An optional possibility to pretend a namespace prefix for classes have no namespace yet. from ObjectManager
protected bool $factory_mode This property effects the object cache. By default it is set to false to enable the object cache for all requested objects. If this property is set true, the object cache will be disabled. from ObjectManager
protected array $injection_objects This is an assoc array and contains objects that will be injected into each requested object. Each containing object will be injected by the name of the key. E.g. ['mod' => $object] this would inject the property named mod with the value of $object. from ObjectManager
protected bool $auto_init This property controls if the init method of requested objects is called by this trait or not. from ObjectManager
bool $full_module_namespace_support from Controller
Config $config from Core
bool $instance_copy_id from Core
mixed $template from Core
string $context from Core
Core $parent_context from Core
int $group_context from Core
string $group_name from Core
protected int $security_level from Core
protected string $security_level_mode from Core
$xf_link from Core
array $GPvars from Core
static array|false $hook_cache Used to cache hook table per request from Core
static array|null $hook_policy_cache Used to cache hook policies per request from Core
MagicMethodHelper $action from Controller
MagicMethodHelper $model from Controller
MagicMethodHelper $page from Controller
MagicMethodHelper $ui from Controller
MagicMethodHelper $cf from Controller
Controller $mod from Controller
array $meta_info from Controller

Methods

string
_(string $token)

Gettext Wrapper using current module context for module specific translations

from Core
mixed
__call($class, $args)

Magic method.

__construct()

System constructor.

mixed
__get($class)

Magic method.

bool
__isset($property)

Magic method.

__set($name, $value)

Magic method.

__toString()

No description

from Core
add_actionlog(int $action_id, int|bool $user_id = false, string|bool $what = false, int|bool $target_user_id = false, array|bool $link_params = false, int|bool $post_id = false, int|bool $post_type = 0, int|bool $group_id = false)

No description

from Core
add_class_to_registry($registry)

No description

from Core
add_config_array(mixed $configArray, mixed $context = false)

No description

from Core
add_css_file(string $filename_in_css_dir, string $position = 'bottom', bool $media = false, bool $if_condition = false)

Add CSS file from the wwwres/css folder to the page

add_js_file(string $filename_in_js_dir, string $position = 'bottom')

Add JS file from the wwwres/js folder to the page

bool|string|xelos_global_template
ajax_response(array|bool $json_response = false, bool|int $error_code = false, bool|xelos_global_template $template = false, bool|string $render_mode = false)

Returns the passed JSON and returns the module template directly to the view class for rendering

from Core
attach_link(ModelCollection|Model $model_collection, string $property_name, array $link_params, bool $current_link = true)

Attach a Link to each model in the collection

check_download_file(mixed $path_to_file, mixed $download_params)

No description

from Core
clear_template()

No description

from Core
dblquery($sql, $mode = 'fetch_assoc', $file = __FILE__, $line = __LINE__, $cache_ttl = false, $cache_group = false, $query_type = false)

Calls dbquery() after given SQL has been converted by $XF->lib->i18n->convert_i18n_sql()

from Core
mixed
dbquery(string $sql, string $mode = 'fetch_assoc', string $file = __FILE__, int $line = __LINE__, int|bool $cache_ttl = false, int|bool $cache_group = false, string|bool $query_type = false)

No description

from Core
mixed
dbquery_with_params(string $sql, array $params, string $mode = 'fetch_assoc', string $file = __FILE__, int $line = __LINE__, int|bool $cache_ttl = false, int|bool $cache_group = false, string|bool $query_type = false)

No description

from Core
bool
delete_file(int $id)

Deletes the file stored in the storage DMS.

from Core
document($document_index)

No description

xelos_global_template|string
error_response(string $err_msg = 'access_denied', string $err_type = 'denied', string $render_mode = 'full')

No description

from Core
get_accessible_page($page_id, $args = array())

No description

from Core
get_action(string $helper)

No description

array|bool
get_actionlog_entries(int|bool $user_ids = false, array|bool $actionlog_levels = false, int $limit = 10, int|bool $target_user_ids = false, boolean $hide_own = false, int|bool $group_security_id = false, int|bool $post_id = false, string|bool $what = false)

get logged actions. You can restrict the result by the parameters instance and user etc.

from Core
array
get_available_languages()

Get the configured languages for this instance

from Core
mixed
get_config(string $var, mixed $context = false)

No description

from Core
int
get_context_id()

gets the numerical Context-ID (PrimaryKey in Instance_Registry)

from Core
array|false
get_current_link(array $params = array())

No description

get_current_url()

No description

string
get_default_i18n()

Get the default language set for this instance

from Core
Core|bool
get_dep(string $dep_id, int|bool $group_context = false)

No description

from Core
xelos_global_template
get_dep_page(bool|string $default = false, bool|string $cmd = false, bool $preserve_render_mode = false)

No description

from Core
array
get_deps($group_context = false)

No description

from Core
get_document_index(int $local_document_id, int $document_type = 0)

returns the global document index fron document_index

from Core
int|false
get_document_index_id(int $local_document_id, int $document_type = 0)

returns the global document id fron document_index

from Core
get_dyn_config($var, $order_set_name = false, $context = false)

No description

from Core
mixed
get_file_link(mixed $path_to_file, mixed $params = array())

Get File Link

from Core
mixed
get_file_url(string $path_to_file, boolean $inline_disposition = true, string|bool $name = false, boolean $zipOnTheFly = false, int|bool $width = false, int|bool $height = false, string|bool $resize_mode = false, bool $public_file_link = false)

Constructs and returns a download link for file

from Core
array
get_file_url_args(string $path_to_file, mixed $inline_disposition = true, mixed $name = false, mixed $zipOnTheFly = false)

No description

from Core
int
get_group()

No description

from Core
mixed
get_hook(string $original_hook_name, string $provider_instance = 'self', bool $force_new = false, bool $skip_access_check = false)

No description

from Core
array
get_hooks(string $local_hook_name, array|bool $limit_to_instances = false, bool $instantiate = true, bool $return_group_siblings = false, bool $hook_class = false)

No description

from Core
string
get_lib_class_dir()

Returns the path to class directory.

string
get_lib_class_prefix()

Returns the defined prefix for all classes.

array|bool
get_link()

No description

get_model(string $model, bool $new_instance = false)

No description

mixed
get_object(string $class, null|array $args = null, bool $call_init = true)

Call specific object - allows to use constructor-params (overload function) This function is primarily called from the magic __GET and __CALL Methods

from Core
array
get_object_cache()

Returns an array containing all objects were requested.

xelos_global_template
get_page(string $page_id, array $args = array())

Internally we provide a fake page for users to gain access to system models, but we are not returning any content here

Core|bool
get_parent_context()

Get Parent Context

from Core
string
get_parsed_message(string $template_name, string $section)

No description

mixed
get_plugin(string $name)

No description

from Core
array
get_plugins_by_prefix(string $prefix)

No description

from Core
get_preview_url($path_to_file, $name = false)

No description

from Core
static 
get_resize_hash(int $w, int $h)

Calculate Resize Hash !Is also called static

from Core
int
get_security_level()

No description

from Core
xm_system_dms
get_system_dms()

Returns the default dms to store application files.

from Core
xelos_global_template
get_template(bool $force_new = false)

No description

from Core
get_thumb_url($path_to_file, $name = false)

No description

from Core
string
get_url()

No description

get_vars(string $file, string $block = null)

Get Vars Model

get_vars_from_text(string $text)

Create a Vars model from text

get_view(string $view, bool|string $section = false, bool $template_auto_setup = true, bool $force_new = false)

No description

get_xf_link()

No description

from Core
init()

Declare this method in a XELOS module if you require standard code to be executed after __construct with all members and references available

from Core
mixed
lpquery(string $query, array $params = array(), string $file = __FILE__, int $line = __LINE__, int $cache_ttl = 0, null $cache_group = null)

No description

from Core
notification_info(mixed $user_id, mixed $token)

Get single notification by token to retrieve information before notify

from Core
notification_mark_read(mixed $user_id, string $token)

Mark a Notification as Read

from Core
notify(mixed $user_id, string $token, string $subject, string $plaintext = null, mixed $html = false, mixed $url = null, string $icon = null, string $type = 'activity')

Notification

from Core
notify_vars(mixed $user_id, string $token, VarsTemplate $vars, mixed $url = null, string $icon = null, string $type = 'activity')

Notification with Vars

from Core
string|void|xelos_global_template
page__deeplink(array $dependency_id)

DeepLink Page (will be called for unresolvable deeplinks, e.g. from hooks search or others

from Core
page__feed(UniversalFeedCreator $feed)

No description

from Core
page__file()

No description

from Core
mixed
pquery(string $query, array $params = array(), string $file = __FILE__, int $line = __LINE__, int $cache_ttl = 0, null $cache_group = null)

No description

from Core
string
prepare_lquery(string $sql)

No description

from Core
string
prepare_query(string $sql)

No description

from Core
string
print_context_menu($params, $context_links, $current_link = false, $no_js_fallback = true, $onMouseOver = false)

No description

from Core
string
print_context_menu_with_submenu(array $entries, array $params = array())

No description

from Core
print_current_link()

No description

string
print_file_link(string $path_to_file, array $params = array())

Print File Link (Alias Function)

from Core
string
print_link(array $params = array())

Wrapper for XF->lib->link substituting modules with instance names etc.

print_preview_link($path_to_file, $params = array())

No description

from Core
string
render()

No description

from Core
xelos_global_template
resolve_dep_link(string $dependency, string $page_id, mixed $cmd)

Resolve a Link for a local dependency (a - by returning a valid template or b - by sending a http-redirect)

from Core
array
resolve_doc_link(int $post_id, int $post_type = null)

No description

false|xm_system_dms_xfs_document
retrieve_document(int $document_index_id, bool $main_document_index_id = false)

Returns the xfs_document in the storage DMS to a ID.

from Core
bool
send_file(array $args, bool $binary = false, bool $is_full_path = false)

Get the data.

from Core
void
set_config(string $var, string $value, string|bool $context = false, string|bool $subcontext = false)

No description

from Core
void
set_config_for_session(string $var, string $value, string $context = false, string $subcontext = false)

No description

from Core
set_context_id(int $context_id)

sets the numerical Context-ID (PrimaryKey in Instance_Registry)

from Core
set_dep_link_context(xelos_core $parent, string $view, string $page, string $cmd)

Set Dep Link Context - generated URLs will be considered relative to the given parent instance

from Core
void
set_group(int $group_id, string|bool $short_name = false)

No description

from Core
set_injection_objects(array $objects)

Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.

set_lib_class_dir($lib_class_dir)

Sets the directory where classes are stored.

set_lib_class_prefix($lib_class_prefix)

Sets the class name prefix.

boolean
set_message_vars(mixed $values, bool $reset = false)

No description

set_parent_context(Core $obj, mixed $clone_link_helper = true)

No description

from Core
void
set_security_level(int $security_level)

No description

from Core
void
set_xf_link($xf_link)

No description

from Core
setup_check($args = array())

Check/Get Setup Page

from Core
xm_system_dms_document|false
store_file(string $path, string $storage_folder, string|bool $file_name = false, DocumentModel|bool $owner = false, DocumentModel|null $owner_document = null)

Stores the file in the system DMS

from Core
user_has_access($page = false, $instance_id = false, $group_security_id = false)

No description

from Core
array
user_has_access_in_groups(string $page)

Return the group_security ids the user has access to

from Core
bool
user_has_policy(string $policy, mixed $policy_value = '*', int|bool $target_user = false, int|bool $group_id = false, string $default_policy = 'deny')

No description

from Core
array
user_has_policy_in_groups(string $policy, string $policy_value = false)

Return the group_security ids the user has the policy in

from Core
array
user_has_policy_values(string $policy, string $treeTable = null)

User has policy values

from Core
xelos_object_manager_init(bool $lib_class_dir, string $lib_class_prefix = '', string $ns_prefix = '')

trait constructor This method have to be called from constructor of each class that uses this trait.

Details

in Core at line 167
string _(string $token)

Gettext Wrapper using current module context for module specific translations

Parameters

string $token

Return Value

string Translated Token

in ObjectManager at line 249
mixed __call($class, $args)

Magic method.

Returns the requested object. If the object is not cached, it will be instantiated with given arguments. This method calls xf_trait::get_object.

Parameters

$class
$args

Return Value

mixed

at line 19
__construct()

System constructor.

in ObjectManager at line 231
mixed __get($class)

Magic method.

First it checks if the requested property is defined and returns it if null. If not defined of null, it calls xf_trait::get_object and returns its return value.

Parameters

$class

Return Value

mixed

in ObjectManager at line 199
bool __isset($property)

Magic method.

This method checks whether the property is defined or injected by __set. If not injected or defined, it will check the registry for an entry of requested property.

Parameters

$property

Return Value

bool

in ObjectManager at line 219
__set($name, $value)

Magic method.

Sets the given value by $name

Parameters

$name
$value

in Core at line 2290
__toString()

in Core at line 2204
add_actionlog(int $action_id, int|bool $user_id = false, string|bool $what = false, int|bool $target_user_id = false, array|bool $link_params = false, int|bool $post_id = false, int|bool $post_type = 0, int|bool $group_id = false)

Parameters

int $action_id Action ID specifies which kind of action has beed conducted Possible types: ACTIONLOG_ADD, ACTIONLOG_REMOVE, ACTIONLOG_COMMENT,.... (see class for more)
int|bool $user_id User ID mostly $XF->user->get_user_id()
string|bool $what Specifying what has been done (e.g. WHAT has been added) this is default text if displaying user has no access to the linked page
int|bool $target_user_id target User ID (e.g. user has visited profiel from target_user)
array|bool $link_params Link param array for generating a link to the action on the 'what' string
int|bool $post_id Post ID - Normally our primary ID
int|bool $post_type Post Type - If you have different types of Posts
int|bool $group_id Group ID

in Core at line 630
final add_class_to_registry($registry)

Parameters

$registry

in Core at line 822
add_config_array(mixed $configArray, mixed $context = false)

Parameters

mixed $configArray
mixed $context

in Controller at line 140
add_css_file(string $filename_in_css_dir, string $position = 'bottom', bool $media = false, bool $if_condition = false)

Add CSS file from the wwwres/css folder to the page

Parameters

string $filename_in_css_dir
string $position
bool $media
bool $if_condition

in Controller at line 151
add_js_file(string $filename_in_js_dir, string $position = 'bottom')

Add JS file from the wwwres/js folder to the page

Parameters

string $filename_in_js_dir
string $position

in Core at line 431
bool|string|xelos_global_template ajax_response(array|bool $json_response = false, bool|int $error_code = false, bool|xelos_global_template $template = false, bool|string $render_mode = false)

Returns the passed JSON and returns the module template directly to the view class for rendering

Parameters

array|bool $json_response JSON Response
bool|int $error_code Error-Code
bool|xelos_global_template $template Template Object (if no template is provided the default template of the current module will be used)
bool|string $render_mode RenderModeAjax (by Default the mode is untouched, if set it will only be applied if the call is an ajax call)

Return Value

bool|string|xelos_global_template

Exceptions

ContentException

Attach a Link to each model in the collection

Parameters

ModelCollection|Model $model_collection
string $property_name Name of the Property to which the link should be saved (+_link and +_url !!)
array $link_params XF Link Array with placeholders {id} for the coresponding model properties
bool $current_link Use current_link function?

Return Value

ModelCollection

in Core at line 1723
check_download_file(mixed $path_to_file, mixed $download_params)

Parameters

mixed $path_to_file
mixed $download_params

in Core at line 1353
clear_template()

in Core at line 685
dblquery($sql, $mode = 'fetch_assoc', $file = __FILE__, $line = __LINE__, $cache_ttl = false, $cache_group = false, $query_type = false)

Calls dbquery() after given SQL has been converted by $XF->lib->i18n->convert_i18n_sql()

Parameters

$sql
$mode
$file
$line
$cache_ttl
$cache_group
$query_type

See also

dbquery()

in Core at line 647
mixed dbquery(string $sql, string $mode = 'fetch_assoc', string $file = __FILE__, int $line = __LINE__, int|bool $cache_ttl = false, int|bool $cache_group = false, string|bool $query_type = false)

Parameters

string $sql SQL Query
string $mode Mode (fetch_assoc, fetch_array)
string $file Filename (for logging and debugging)
int $line Line No
int|bool $cache_ttl Cache TTL in s (Results of this query are case)
int|bool $cache_group Cache Group (can be used to remove all caches from the same group, e.g. template, user_details etc.)
string|bool $query_type reference to string indicates if query was an update/delete or an insert

Return Value

mixed Array with Result OR Insert ID OR Affected Rows OR False for "no rows found"

in Core at line 672
mixed dbquery_with_params(string $sql, array $params, string $mode = 'fetch_assoc', string $file = __FILE__, int $line = __LINE__, int|bool $cache_ttl = false, int|bool $cache_group = false, string|bool $query_type = false)

Parameters

string $sql SQL Query (can contain named markers, e.g. :name)
array $params ['param_name'=>'param_value'] Assoc-Array with SQL Parameters. Will be escaped and inserted into the passed SQL
string $mode Mode (fetch_assoc, fetch_array)
string $file Filename (for logging and debugging)
int $line Line No
int|bool $cache_ttl Cache TTL in s (Results of this query are case)
int|bool $cache_group Cache Group (can be used to remove all caches from the same group, e.g. template, user_details etc.)
string|bool $query_type reference to string indicates if query was an update/delete or an insert

Return Value

mixed Array with Result OR Insert ID OR Affected Rows OR False for "no rows found"

Exceptions

DatabaseException

in Core at line 2508
bool delete_file(int $id)

Deletes the file stored in the storage DMS.

If the file does not exist in the DMS, it checks the mod_storage_path if the file exists there and deletes it there.

Parameters

int $id xfs document ID

Return Value

bool

in Controller at line 107
MagicDocumentHelper|bool document($document_index)

Parameters

$document_index

Return Value

MagicDocumentHelper|bool

in Core at line 514
xelos_global_template|string error_response(string $err_msg = 'access_denied', string $err_type = 'denied', string $render_mode = 'full')

Parameters

string $err_msg Error Message
string $err_type Error Type
string $render_mode Render mode

Return Value

xelos_global_template|string (Throws Exception)

Exceptions

ContentException

in Core at line 829
get_accessible_page($page_id, $args = array())

Parameters

$page_id
$args

in Controller at line 128
get_action(string $helper)

Parameters

string $helper

in Core at line 2249
array|bool get_actionlog_entries(int|bool $user_ids = false, array|bool $actionlog_levels = false, int $limit = 10, int|bool $target_user_ids = false, boolean $hide_own = false, int|bool $group_security_id = false, int|bool $post_id = false, string|bool $what = false)

get logged actions. You can restrict the result by the parameters instance and user etc.

Parameters

int|bool $user_ids or array of int user id(s) of the action should be shown
array|bool $actionlog_levels actionlog_levels array if all levels to be displayed e.g. array(ACTIONLOG_ADD,ACTIONLOG_REMOVE,ACTIONLOG_UPDATE,ACTIONLOG_COMMENT)
int $limit limit
int|bool $target_user_ids or array of int targetuser id(s) of the action should be shown
boolean $hide_own true if own entries are not shown
int|bool $group_security_id group_security
int|bool $post_id to show only entries of a specific post id
string|bool $what show only entries of a specific what

Return Value

array|bool

in Core at line 2324
array get_available_languages()

Get the configured languages for this instance

Return Value

array Empty array if i18n_mode is not available

in Core at line 584
mixed get_config(string $var, mixed $context = false)

Parameters

string $var Parameter (Typical: mod_wwwres_relative, web_path_root, mod_template_path, mod_storage_path)
mixed $context Instance ID

Return Value

mixed Value of Parameter

in Core at line 2299
int get_context_id()

gets the numerical Context-ID (PrimaryKey in Instance_Registry)

Return Value

int $context_id

Parameters

array $params LinkHelper Params in Array Format

Return Value

array|false ['label'=>'', 'target'=>'', 'class'=>'', 'title'=>'', 'href'=>'', 'full'=>''] Link Resource Array

See also

Link::get_current_link()

in CoreLinkMethods at line 181
get_current_url()

in Core at line 2316
string get_default_i18n()

Get the default language set for this instance

Return Value

string Language/Culture (DE_DE)

in Core at line 1247
Core|bool get_dep(string $dep_id, int|bool $group_context = false)

Parameters

string $dep_id internal dependency key
int|bool $group_context Group ID

Return Value

Core|bool

in Core at line 324
xelos_global_template get_dep_page(bool|string $default = false, bool|string $cmd = false, bool $preserve_render_mode = false)

Parameters

bool|string $default Default Page
bool|string $cmd Default CMD
bool $preserve_render_mode

Return Value

xelos_global_template

in Core at line 1281
array get_deps($group_context = false)

Parameters

$group_context

Return Value

array Returns an array with all available dependencies

in Core at line 2355
DocumentIndex get_document_index(int $local_document_id, int $document_type = 0)

returns the global document index fron document_index

requires the model is registered in document_registry for being index by document_index!

Parameters

int $local_document_id
int $document_type

Return Value

DocumentIndex

in Core at line 2337
int|false get_document_index_id(int $local_document_id, int $document_type = 0)

returns the global document id fron document_index

requires the model is registered in document_registry for being index by document_index!

Parameters

int $local_document_id
int $document_type

Return Value

int|false

in Core at line 2274
get_dyn_config($var, $order_set_name = false, $context = false)

Parameters

$var
$order_set_name
$context

Get File Link

Parameters

mixed $path_to_file
mixed $params

Return Value

mixed

in Core at line 1527
mixed get_file_url(string $path_to_file, boolean $inline_disposition = true, string|bool $name = false, boolean $zipOnTheFly = false, int|bool $width = false, int|bool $height = false, string|bool $resize_mode = false, bool $public_file_link = false)

Constructs and returns a download link for file

Parameters

string $path_to_file path to your file within your mod_storage_path
boolean $inline_disposition Show Inline? (Default:True)
string|bool $name Force a specific filename within the headers sent
boolean $zipOnTheFly Want the content zipped? (Default: False)
int|bool $width
int|bool $height
string|bool $resize_mode Resize Mode ['resize', 'crop', false] (Default: False)
bool $public_file_link Generate Public File Link? (not compatible with zipOnTheFly!) This will always resize all images during this call and make them available via public URL /_cache/..

Return Value

mixed

in Core at line 1698
array get_file_url_args(string $path_to_file, mixed $inline_disposition = true, mixed $name = false, mixed $zipOnTheFly = false)

Parameters

string $path_to_file
mixed $inline_disposition
mixed $name
mixed $zipOnTheFly

Return Value

array

in Core at line 390
int get_group()

Return Value

int Group ID

in Core at line 930
mixed get_hook(string $original_hook_name, string $provider_instance = 'self', bool $force_new = false, bool $skip_access_check = false)

Parameters

string $original_hook_name Hook/Callback Key As declared by the provider (e.g. recent_threads)
string $provider_instance Provider Instance Name
bool $force_new Force a new object
bool $skip_access_check

Return Value

mixed Callback Object (Array for Callback or Object for Usage)

Exceptions

Exception

in Core at line 1058
array get_hooks(string $local_hook_name, array|bool $limit_to_instances = false, bool $instantiate = true, bool $return_group_siblings = false, bool $hook_class = false)

Parameters

string $local_hook_name Hook/Callback Key as declared in your Instance Config
array|bool $limit_to_instances Limit to hooks from a certain instance?
bool $instantiate Instantiate Hook Objects?
bool $return_group_siblings Return grouped Siblings?
bool $hook_class

Return Value

array Callback Object (Array for Callback or Object for Usage)

Exceptions

Exception

in ObjectManager at line 167
string get_lib_class_dir()

Returns the path to class directory.

Return Value

string

See also

xf_trait::lib_class_dir
xf_trait::get_lib_class_dir

in ObjectManager at line 177
string get_lib_class_prefix()

Returns the defined prefix for all classes.

Return Value

string

See also

xf_trait::lib_class_prefix

Return Value

array|bool Contains array with url, full etc.

in Controller at line 95
get_model(string $model, bool $new_instance = false)

Parameters

string $model
bool $new_instance

in Core at line 605
final mixed get_object(string $class, null|array $args = null, bool $call_init = true)

Call specific object - allows to use constructor-params (overload function) This function is primarily called from the magic __GET and __CALL Methods

Parameters

string $class
null|array $args
bool $call_init

Return Value

mixed new or existing instance of name

in ObjectManager at line 187
array get_object_cache()

Returns an array containing all objects were requested.

Return Value

array

See also

xf_trait::object_cache

at line 31
xelos_global_template get_page(string $page_id, array $args = array())

Internally we provide a fake page for users to gain access to system models, but we are not returning any content here

Parameters

string $page_id Page ID
array $args Cmd Params

Return Value

xelos_global_template Template Object

in Core at line 1299
Core|bool get_parent_context()

Get Parent Context

Return Value

Core|bool Parent Instance

in Controller at line 351
string get_parsed_message(string $template_name, string $section)

Parameters

string $template_name name of the vars file
string $section section to return

Return Value

string parsed section

in Core at line 182
mixed get_plugin(string $name)

Parameters

string $name Plugin Name

Return Value

mixed Plugin

in Core at line 201
array get_plugins_by_prefix(string $prefix)

Parameters

string $prefix Plugin Prefix

Return Value

array with objects ('pluginName'=>Obj)

in Core at line 1596
get_preview_url($path_to_file, $name = false)

Parameters

$path_to_file
$name

in Core at line 1583
static get_resize_hash(int $w, int $h)

Calculate Resize Hash !Is also called static

Parameters

int $w
int $h

in Core at line 415
int get_security_level()

Return Value

int XF_SEC_LEVEL_NONE, XF_SEC_LEVEL_READ, XF_SEC_LEVEL_WRITE, XF_SEC_LEVEL_DELETE or XF_SEC_LEVEL_ADMIN

in Core at line 2445
xm_system_dms get_system_dms()

Returns the default dms to store application files.

It uses the DMS configured in Expert Configuration -> GUI -> Filebrowser DMS: system config key filebrowser_dms

Return Value

xm_system_dms or false

in Core at line 1308
xelos_global_template get_template(bool $force_new = false)

Parameters

bool $force_new Resets all Variables and returns clean/new template

Return Value

xelos_global_template Template Object

in Core at line 1587
get_thumb_url($path_to_file, $name = false)

Parameters

$path_to_file
$name

in CoreLinkMethods at line 108
string get_url()

Return Value

string URL

See also

XF\Lib\Link::get_url()

in Controller at line 252
VarsTemplate|bool get_vars(string $file, string $block = null)

Get Vars Model

Parameters

string $file id
string $block id

Return Value

VarsTemplate|bool

in Controller at line 283
VarsTemplate get_vars_from_text(string $text)

Create a Vars model from text

Parameters

string $text

Return Value

VarsTemplate

in Controller at line 164
get_view(string $view, bool|string $section = false, bool $template_auto_setup = true, bool $force_new = false)

Parameters

string $view Name of View [Template filename w/o extension]
bool|string $section Name of Section in Template or false
bool $template_auto_setup Automatically load template and add renderer?
bool $force_new New Template Object?

Return Value

Link

in Core at line 158
init()

Declare this method in a XELOS module if you require standard code to be executed after __construct with all members and references available

in Core at line 762
mixed lpquery(string $query, array $params = array(), string $file = __FILE__, int $line = __LINE__, int $cache_ttl = 0, null $cache_group = null)

Parameters

string $query SQL Query with ? Marker
array $params (1D - array for multiple params)
string $file DEBUG Filename (FILE)
int $line DEBUG Line (LINE)
int $cache_ttl
null $cache_group

Return Value

mixed

Exceptions

Exception

in Core at line 2429
Notification notification_info(mixed $user_id, mixed $token)

Get single notification by token to retrieve information before notify

Parameters

mixed $user_id
mixed $token

Return Value

Notification

in Core at line 2415
notification_mark_read(mixed $user_id, string $token)

Mark a Notification as Read

Parameters

mixed $user_id User-ID or Array of Users
string $token Token

Exceptions

Exception

in Core at line 2397
notify(mixed $user_id, string $token, string $subject, string $plaintext = null, mixed $html = false, mixed $url = null, string $icon = null, string $type = 'activity')

Notification

Parameters

mixed $user_id User-ID or Array of Users
string $token Token for updates for this Notification
string $subject Subject
string $plaintext Plaintext/Shortmessage without HTML
mixed $html HTML-Message
mixed $url Link as URL or as Array (get_current_url)
string $icon FontAwesome-Icon Class
string $type Type of Notification ('activity','todo','message')

in Core at line 2375
notify_vars(mixed $user_id, string $token, VarsTemplate $vars, mixed $url = null, string $icon = null, string $type = 'activity')

Notification with Vars

Parameters

mixed $user_id User-ID or Array of Users
string $token Token for updates for this Notification
VarsTemplate $vars Notification-Vars (subject, plaintext & body)
mixed $url Link as URL or as Array (get_current_url)
string $icon FontAwesome-Icon
string $type Type of notification

DeepLink Page (will be called for unresolvable deeplinks, e.g. from hooks search or others

Parameters

array $dependency_id Arguments

Return Value

string|void|xelos_global_template

in Core at line 1731
page__feed(UniversalFeedCreator $feed)

Parameters

UniversalFeedCreator $feed

in Core at line 1742
page__file()

in Core at line 736
mixed pquery(string $query, array $params = array(), string $file = __FILE__, int $line = __LINE__, int $cache_ttl = 0, null $cache_group = null)

Parameters

string $query SQL Query with ? Marker
array $params (1D - array for multiple params)
string $file DEBUG Filename (FILE)
int $line DEBUG Line (LINE)
int $cache_ttl
null $cache_group

Return Value

mixed

Exceptions

Exception

in Core at line 713
string prepare_lquery(string $sql)

Parameters

string $sql Query

Return Value

string Parsed Query

in Core at line 703
string prepare_query(string $sql)

Parameters

string $sql Query

Return Value

string Parsed Query

in Core at line 1484
string print_context_menu($params, $context_links, $current_link = false, $no_js_fallback = true, $onMouseOver = false)

Parameters

$params
$context_links
$current_link
$no_js_fallback
$onMouseOver

Return Value

string HTML return link resource array

in Core at line 1511
string print_context_menu_with_submenu(array $entries, array $params = array())

Parameters

array $entries of links with Menu labels array(mainmenu_label => array(link1, link2, link3)) for a normal context menu, like print_context_menu array(mainmenu_label => array(link1, link2, submenu_label => array(link3, link4), link5))
array $params of additional params for the first dropdown: class, icon_class

Return Value

string return link resource array

Print File Link (Alias Function)

Parameters

string $path_to_file (Absolute on Disk)
array $params OPTIONAL (defaults: inline_disposition=true, label=basename of file,icon=false,limit_string=false

Return Value

string HTML a tag

Wrapper for XF->lib->link substituting modules with instance names etc.

Example:

$this->mod->print_link(array('label'=>$label, 'page'=>$page, 'ajax_modal'=>array('form' => 'noajax')));
$this->mod->print_link(array('label'=>$label, 'page'=>$page, 'JS-FSLoader'=>array('message' => 'loading..','autohide'=>'5000')));

Parameters

array $params = [ 'label'=>$label, 'page'=>$page, 'cmd'=>$cmd, 'class'=>'btn', 'target'=>'new', 'title'=>$title, 'confirm_text'=>("Are you sure?"), 'JS-FSLoader'=>['message' => 'loading..', 'autohide'=>'5000'], 'ajax_modal'=>['form' => 'noajax', 'width'=> 800 ], 'ajax_update'=>$domId, 'ajax_replace'=>$domId, 'xdi' => DocumentIndex, 'xui_target' => UIAjaxComponent ]

Return Value

string Full HTML A Tag

Parameters

$path_to_file
$params

in Core at line 367
string render()

Return Value

string Output (eg. html)

Resolve a Link for a local dependency (a - by returning a valid template or b - by sending a http-redirect)

Parameters

string $dependency Name (Refers to YOUR entry in the config.yml)
string $page_id PageID
mixed $cmd CMD Params

Return Value

xelos_global_template or string URL

Parameters

int $post_id
int $post_type

Return Value

array xf_link LinkHelper

in Core at line 2463
false|xm_system_dms_xfs_document retrieve_document(int $document_index_id, bool $main_document_index_id = false)

Returns the xfs_document in the storage DMS to a ID.

Parameters

int $document_index_id document index ID
bool $main_document_index_id

Return Value

false|xm_system_dms_xfs_document The system_dms_document

in Core at line 1767
bool send_file(array $args, bool $binary = false, bool $is_full_path = false)

Get the data.

.. $args = array('download','myfile.txt')

Redeclare for binary downloads: function send_file($args, $binary = false) { switch($args[1]) { case 'mybinard.txt': parent::send_file($args,'mybinarycontent'); } }

Parameters

array $args Array of arguments passed via CMD parameter
bool $binary True if data as passed as binary stream instead of filename
bool $is_full_path Set to true if args[1] contains a fill hdd path (not within mod_storage of current module). Caution!

Return Value

bool

in Core at line 550
void set_config(string $var, string $value, string|bool $context = false, string|bool $subcontext = false)

Parameters

string $var var
string $value value
string|bool $context context
string|bool $subcontext subcontext

Return Value

void

in Core at line 568
void set_config_for_session(string $var, string $value, string $context = false, string $subcontext = false)

Parameters

string $var var
string $value value
string $context context
string $subcontext subcontext

Return Value

void

in Core at line 2308
set_context_id(int $context_id)

sets the numerical Context-ID (PrimaryKey in Instance_Registry)

Parameters

int $context_id

Set Dep Link Context - generated URLs will be considered relative to the given parent instance

Parameters

xelos_core $parent
string $view
string $page
string $cmd

in Core at line 381
void set_group(int $group_id, string|bool $short_name = false)

Parameters

int $group_id group id
string|bool $short_name short name

Return Value

void

in ObjectManager at line 125
set_injection_objects(array $objects)

Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.

Parameters

array $objects

in ObjectManager at line 141
set_lib_class_dir($lib_class_dir)

Sets the directory where classes are stored.

This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly.

Parameters

$lib_class_dir

in ObjectManager at line 156
set_lib_class_prefix($lib_class_prefix)

Sets the class name prefix.

An optional possibility to pretend a prefix for all registered classes. This prefix is only required in the class name of the requested object. The registered class name should not contains this prefix. E.g. a class called xf_foobar should be registered as foobar.

Parameters

$lib_class_prefix

in Controller at line 336
boolean set_message_vars(mixed $values, bool $reset = false)

Parameters

mixed $values array or model object
bool $reset Reset Vars before setting?

Return Value

boolean success

in Core at line 223
set_parent_context(Core $obj, mixed $clone_link_helper = true)

Parameters

Core $obj Module Instance
mixed $clone_link_helper ???

in Core at line 399
void set_security_level(int $security_level)

Parameters

int $security_level Please use XF_SEC_LEVEL_NONE, XF_SEC_LEVEL_READ, XF_SEC_LEVEL_WRITE, XF_SEC_LEVEL_DELETE or XF_SEC_LEVEL_ADMIN

Return Value

void

Parameters

$xf_link

Return Value

void

in Core at line 903
setup_check($args = array())

Check/Get Setup Page

Parameters

$args

in Core at line 2481
xm_system_dms_document|false store_file(string $path, string $storage_folder, string|bool $file_name = false, DocumentModel|bool $owner = false, DocumentModel|null $owner_document = null)

Stores the file in the system DMS

Parameters

string $path path to the new file
string $storage_folder virtual folder in the System DMS where the document is stored
string|bool $file_name filename in the System DMS
DocumentModel|bool $owner Owning Document Model: Creates an owner reference for the new document
DocumentModel|null $owner_document Document that owns all stored files by reference and subcategory of system dms

Return Value

xm_system_dms_document|false The new xfs_document in the system DMS

in Core at line 1443
user_has_access($page = false, $instance_id = false, $group_security_id = false)

Parameters

$page
$instance_id
$group_security_id

in Core at line 1467
array user_has_access_in_groups(string $page)

Return the group_security ids the user has access to

Parameters

string $page

Return Value

array

in Core at line 1389
bool user_has_policy(string $policy, mixed $policy_value = '*', int|bool $target_user = false, int|bool $group_id = false, string $default_policy = 'deny')

Parameters

string $policy Policy (e.g. read, write, delete)
mixed $policy_value Dynamic Value to check (e.g. category_id, thread_id, item_id) or * for static
int|bool $target_user of targetuser for privacy
int|bool $group_id local group_id if known
string $default_policy policy 'allow' or 'deny'

Return Value

bool success

in Core at line 1408
array user_has_policy_in_groups(string $policy, string $policy_value = false)

Return the group_security ids the user has the policy in

Parameters

string $policy
string $policy_value

Return Value

array

in Core at line 1421
array user_has_policy_values(string $policy, string $treeTable = null)

User has policy values

Parameters

string $policy
string $treeTable Tablename for Tree Policies

Return Value

array

in ObjectManager at line 103
xelos_object_manager_init(bool $lib_class_dir, string $lib_class_prefix = '', string $ns_prefix = '')

trait constructor This method have to be called from constructor of each class that uses this trait.

It sets the defaults and all necessary properties.

Parameters

bool $lib_class_dir
string $lib_class_prefix e.g. 'xf_'
string $ns_prefix e.g. "XELOS\Framework\Lib\"