class Core

Class Core

Traits

Trait CoreLinkMethods

Static Cache Trait Adds a static (per request) cache to the object which can hold data for the time of the request (in the frontend) or a certain duration during long running processes. It works together with the global caching system and enforces a static cache clearing in case of global cache clearings as well.

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
Config $config
bool $instance_copy_id
mixed $template
string $context
Core $parent_context
array $meta_info
int deprecated $group_context
string $group_name
string $storage_path
$xf_link
array $GPvars
MagicMethodHelper $action

Access to actions defined in the class sub-folder action

MagicMethodHelper $model

Access to models defined in the class sub-folder model

MagicMethodHelper $page

Access to pages defined in the class sub-folder page

MagicMethodHelper $ui

Access to ui components defined in the class sub-folder ui

Methods

string
_(string $token, string[] $placeholder = [])

Gettext Wrapper using current module context for module specific translations

mixed
__call($class, $args)

Magic method.

__construct(string $instance = null)

No description

mixed
__get($class)

Magic method.

bool
__isset($property)

Magic method.

__set($name, $value)

Magic method.

__toString()

No description

addActionLog(DocumentIndex $documentIndex, int $action_key, int $user_id = null, string $subject = null, int $target_user_id = null, array $link_params = [])

No description

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) deprecated

No description

add_class_to_registry($registry)

No description

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

No description

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

check_download_file(mixed $path_to_file, mixed $download_params)

No description

clear_template()

No description

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()

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

array|int|false
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

bool
delete_file(int $id)

Deletes the file stored in the storage DMS.

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

No description

Core|null
getDependencyInGuessGroupContext(string $dependency, string $page_id, array $cmd)

Get dependency with unknown group context

int
getGroupContext()

No description

int
getGroupSecurityId(int $group_context = 0)

Get the group_security_id for this instance (optional: based on a local group_context)

array
getHooksAsObject($hookName)

No description

string
getI18nTokenDomain()

Return i18n Token Domain

object|null
getObjectIfAvailable(string $class)

This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations

static SystemDMSController|null
getSystemDMS()

Get System DMS, using static cache

get_actionlog()

Return the actionlog instance

array
get_available_languages($includeTitle = false)

Get the configured languages for this instance

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

No description

int
get_context_id()

gets the numerical Context-ID (PrimaryKey in Instance_Registry)

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

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

No description

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

No description

array
get_deps($group_context = false)

No description

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

returns the global document index fron document_index

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

returns the global document id fron document_index

bool|mixed
get_dyn_config($var, bool $order_set_name = false, bool $context = false) deprecated

No description

string|bool
get_file_link(string $path_to_file, array $params = array())

Get File Link

mixed
get_file_url(string $path_to_file, bool $inline_disposition = true, string|bool $name = false, bool $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

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

No description

int
get_group() deprecated

No description

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

No description

array
get_hooks(string $local_hook_name, array|bool $limit_to_instances = false, bool $instantiate = true, mixed $parentContext = false, string $hook_class = null)

No description

bool
get_i18n_translation_required()

Returns true if the i18n translation has been set to required for this instance

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

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

array
get_object_cache()

Returns an array containing all objects were requested.

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

No description

Core|null
get_parent_context()

Get Parent Context

mixed
get_plugin(string $name)

No description

array
get_plugins_by_prefix(string $prefix)

No description

get_preview_url($path_to_file, $name = false)

No description

static 
get_resize_hash(int $w, int $h)

Calculate Resize Hash !Is also called static

bool
get_security_level() deprecated

No description

SystemDMSController|null
get_system_dms()

Returns the default dms to store application files.

get_template(bool $force_new = false)

No description

get_thumb_url($path_to_file, $name = false)

No description

string
get_url()

No description

get_xf_link()

No description

bool
hasDependency(string $dep_id)

Does module have an existing dependency

bool
has_hook_access(string $hook_instance_id, string $hook_name)

Checks if the user has access to the hook

init()

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

bool
isXlabsFeaturePreview()

No description

void
jsonResponse($data, $httpResponseCode = 200)

Returns the passed data object as JSON body response

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

No description

string
ngettext(string $singularToken, string $pluralToken, int $count, array $placeholder = [])

No description

notification_info($user_id, $token_id) deprecated

No description

notification_mark_read($userId, $token) deprecated

No description

notify(int|array $user_id, string $token, string $subject, string $plaintext = null, mixed $html = false, mixed $url = null, string $icon = null, string $type = XF\Lib\Notification\NotificationType::ACTIVITY) deprecated

Notification

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

page__feed(UniversalFeedCreator $feed)

No description

page__file()

No description

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

No description

string|string[]|null
prepareQueryWithParams(string $sql, array $params)

No description

string
prepare_lquery($sql)

No description

string
prepare_query(string $sql)

No description

string
print_context_menu($params, array $context_links, bool $current_link = false, bool $no_js_fallback = true, $onMouseOver = false)

No description

string
print_context_menu_with_submenu(array $entries, array $params = array()) deprecated

No description

print_current_link()

No description

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

Print File Link (Alias Function)

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

string
render()

Render Module Output, this will get the template of the default page and render the template

string|false
resolve_dep_link(string $dependency, string $page_id, array $cmd)

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

array
resolve_doc_link(int $post_id, int $post_type = null) deprecated

Return the URL info of the page representing your document

XfsDocument|null
retrieve_document(int $document_index_id, DocumentIndex|DocumentModel|int $main_document_index_id = null)

Returns the xfs_document in the storage DMS to a ID.

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

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

setDepLinkContext(string $localPage, string $localCmd)

Enforce Link Context based on Current Parent Instance for the local Page and CMD

setGroupContext(int $group_id, string $short_name = null)

No description

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

No description

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

No description

set_context_id(int $context_id)

sets the numerical Context-ID (PrimaryKey in Instance_Registry)

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

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

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

No description

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.

set_parent_context(Core $obj, $clone_link_helper = true)

No description

void
set_xf_link($xf_link)

No description

xelos_global_template|bool
setup_check($args = array())

Check/Get Setup Page

static void
static void
staticCacheClearCachePool($cache_pool = 'default')

Clears the specified cache pool from the static cache

static array|string|int|bool|null
staticCacheGet($key, string $cache_pool = 'default')

Retrieves a value from the static cache

static array
staticCacheGetKeys(string $cache_pool = 'default')

Returns an array of all cache keys which have been set

static array
staticCacheGetPool($cache_pool)

Returns an key/value array with all cached values from the passed pool

static bool
staticCacheIsEnabled()

No description

static bool
staticCacheIsSet($key, string $cache_pool = 'default')

Checks if the passed is key has a value set

static 
staticCacheRemove($key, string $cache_pool = 'default')

Removes the passed key

static void
staticCacheSet(string|int $key, mixed $value, string $cache_pool = 'default')

Store a value in the static cache

Document|null
store_file(string $path, string|null $xfsPath, string|null $file_name = null, DocumentModel|null $ownerDocumentModel = null)

Stores the file in the system DMS

bool
userHasApiAccess()

Does the user have API access to this instance?

bool
user_has_access(?string $page = null, string|bool $instance_id = false, int $group_security_id = 0)

Check if user has PAGE access to the instance

array
user_has_access_in_groups(string $page)

Return the group_security ids the user has access to

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

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

Return the group_security ids the user has the policy in

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

User has policy values

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

at line 165
string _(string $token, string[] $placeholder = [])

Gettext Wrapper using current module context for module specific translations

Parameters

string $token
string[] $placeholder

Array of named placeholders e.g. ['title'=>'My Title'] -> replaces {title} in token with 'My Title'

Return Value

string

Translated Token

in ObjectManager at line 250
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 102
__construct(string $instance = null)

No description

Parameters

string $instance

Instance ID

in ObjectManager at line 232
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 200
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 220
__set($name, $value)

Magic method.

Sets the given value by $name

Parameters

$name
$value

at line 2451
__toString()

No description

at line 2401
addActionLog(DocumentIndex $documentIndex, int $action_key, int $user_id = null, string $subject = null, int $target_user_id = null, array $link_params = [])

No description

Parameters

DocumentIndex $documentIndex
int $action_key
int $user_id

ID of the user causing the action, null will automatically be set if a user is currently logged in

string $subject

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, will be set to document_index->title if not specified

int $target_user_id

User targeted with the action

array $link_params

= ['view' => $this->mod->context, 'page'=>'view', 'cmd'=>''] If no link is given, the doclink to the document index will be used automatically

Exceptions

Exception

at line 2369
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) deprecated

deprecated Please use addActionLog()

No description

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

Exceptions

Exception

at line 659
final add_class_to_registry($registry)

No description

Parameters

$registry

at line 862
add_config_array(mixed $configArray, mixed $context = false)

No description

put your comment there...

Parameters

mixed $configArray
mixed $context

at line 466
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 (transferred via HTTP X-JSON Header)

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

at line 1877
check_download_file(mixed $path_to_file, mixed $download_params)

No description

put your comment there...

Parameters

mixed $path_to_file
mixed $download_params

at line 1505
clear_template()

No description

at line 725
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()

at line 676
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

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"

at line 701
array|int|false 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

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

array|int|false

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

Exceptions

DatabaseException

at line 2634
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

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

No description

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

at line 1404
Core|null getDependencyInGuessGroupContext(string $dependency, string $page_id, array $cmd)

Get dependency with unknown group context

Parameters

string $dependency
string $page_id
array $cmd

Return Value

Core|null

at line 429
int getGroupContext()

No description

Return Value

int

Group ID

at line 1332
int getGroupSecurityId(int $group_context = 0)

Get the group_security_id for this instance (optional: based on a local group_context)

Parameters

int $group_context

Return Value

int

at line 1275
array getHooksAsObject($hookName)

No description

Parameters

$hookName

Return Value

array

at line 195
string getI18nTokenDomain()

Return i18n Token Domain

Return Value

string

in ObjectManager at line 267
object|null getObjectIfAvailable(string $class)

This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations

Parameters

string $class

Return Value

object|null

at line 2568
static SystemDMSController|null getSystemDMS()

Get System DMS, using static cache

Return Value

SystemDMSController|null

at line 2416
protected SystemActionlogController get_actionlog()

Return the actionlog instance

Return Value

SystemActionlogController

Exceptions

Exception

at line 2494
array get_available_languages($includeTitle = false)

Get the configured languages for this instance

Parameters

$includeTitle

Return Value

array

Empty array if i18n_mode is not available

at line 613
mixed get_config(string $var, mixed $context = false)

No description

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

at line 2460
int get_context_id()

gets the numerical Context-ID (PrimaryKey in Instance_Registry)

Return Value

int $context_id

No description

Parameters

array $params

LinkHelper Params in Array Format

Return Value

array|false

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

See also

\XELOS\Framework\Core\Traits\Link::get_current_link()

in CoreLinkMethods at line 190
get_current_url()

No description

at line 2477
string get_default_i18n()

Get the default language set for this instance

Return Value

string

Language/Culture (e.g. DE_DE)

at line 1370
Core|bool get_dep(string $dep_id, int|bool $group_context = 0)

No description

Parameters

string $dep_id

internal dependency key

int|bool $group_context

Group ID

Return Value

Core|bool

at line 351
Template get_dep_page(bool|string $default = false, bool|string $cmd = false, bool $preserve_render_mode = false)

No description

Parameters

bool|string $default

Default Page

bool|string $cmd

Default CMD

bool $preserve_render_mode

Return Value

Template

at line 1428
array get_deps($group_context = false)

No description

Parameters

$group_context

Return Value

array

Returns an array with all available dependencies

at line 2539
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

at line 2521
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

at line 2434
bool|mixed get_dyn_config($var, bool $order_set_name = false, bool $context = false) deprecated

deprecated

No description

Parameters

$var
bool $order_set_name
bool $context

Return Value

bool|mixed

Get File Link

Parameters

string $path_to_file

Path to File

array $params

Return Value

string|bool

at line 1681
mixed get_file_url(string $path_to_file, bool $inline_disposition = true, string|bool $name = false, bool $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

bool $inline_disposition

Show Inline? (Default:True)

string|bool $name

Force a specific filename within the headers sent

bool $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

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

No description

put your comment there...

Parameters

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

Return Value

array

at line 408
int get_group() deprecated

deprecated use getGroupContext()

No description

Return Value

int

Group ID

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

No description

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)

at line 1114
array get_hooks(string $local_hook_name, array|bool $limit_to_instances = false, bool $instantiate = true, mixed $parentContext = false, string $hook_class = null)

No description

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?

mixed $parentContext

Return hooks which are depending on this parent context, true will use the current parent_context if available, '*' will remove parent context limitation

string $hook_class

Explicitely set the expected hook classification, e.g. cms.contentPortlet

Return Value

array

[[ 'instance_id' => (string) $instanceID 'parent_context' => (string) $parentContext 'caller_id' => (string) $callerID 'name' => (string) $name 'module_name' => (string) $module_name 'title' => (string) $title 'title_i18n' => (string) $title 'description' => (string) $description 'description_i18n' => (string) $description 'options' => (array) $options ]]

at line 2508
bool get_i18n_translation_required()

Returns true if the i18n translation has been set to required for this instance

Return Value

bool

in ObjectManager at line 168
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 178
string get_lib_class_prefix()

Returns the defined prefix for all classes.

Return Value

string

See also

xf_trait::lib_class_prefix

No description

Return Value

array|bool

Contains array with url, full etc.

at line 634
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 188
array get_object_cache()

Returns an array containing all objects were requested.

Return Value

array

See also

xf_trait::object_cache

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

No description

Parameters

string $page_id

Page ID

array $args

Cmd Params

Return Value

xelos_global_template

Template Object

at line 1445
Core|null get_parent_context()

Get Parent Context

Return Value

Core|null

Parent Instance

at line 204
mixed get_plugin(string $name)

No description

Parameters

string $name

Plugin Name

Return Value

mixed Plugin

at line 223
array get_plugins_by_prefix(string $prefix)

No description

Parameters

string $prefix

Plugin Prefix

Return Value

array

with objects ('pluginName'=>Obj)

at line 1750
get_preview_url($path_to_file, $name = false)

No description

Parameters

$path_to_file
$name

at line 1737
static get_resize_hash(int $w, int $h)

Calculate Resize Hash !Is also called static

Parameters

int $w
int $h

at line 438
bool get_security_level() deprecated

deprecated Remove calls to this function, will always return false

No description

Return Value

bool

at line 2559
SystemDMSController|null 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

SystemDMSController|null

at line 1457
Template get_template(bool $force_new = false)

No description

Parameters

bool $force_new

Resets all Variables and returns clean/new template

Return Value

Template

Template Object

Exceptions

Exception

at line 1741
get_thumb_url($path_to_file, $name = false)

No description

Parameters

$path_to_file
$name

in CoreLinkMethods at line 117
string get_url()

No description

Return Value

string URL

See also

Link::get_url

No description

Return Value

Link

at line 1355
bool hasDependency(string $dep_id)

Does module have an existing dependency

Parameters

string $dep_id

Return Value

bool

at line 1295
bool has_hook_access(string $hook_instance_id, string $hook_name)

Checks if the user has access to the hook

Parameters

string $hook_instance_id

Instance ID

string $hook_name

Hook name

Return Value

bool

at line 149
init()

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

at line 2655
bool isXlabsFeaturePreview()

No description

Return Value

bool

at line 448
void jsonResponse($data, $httpResponseCode = 200)

Returns the passed data object as JSON body response

Parameters

$data
$httpResponseCode

Return Value

void

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

No description

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

Examples

UPDATE ###tbl|contact### set displayname = ?, status = ? WHERE id = ?;

$params = array($displayname,$status,$id)

at line 186
string ngettext(string $singularToken, string $pluralToken, int $count, array $placeholder = [])

No description

Parameters

string $singularToken
string $pluralToken
int $count
array $placeholder

Return Value

string

at line 2698
Notification notification_info($user_id, $token_id) deprecated

deprecated

No description

Parameters

$user_id
$token_id

Return Value

Notification

at line 2705
notification_mark_read($userId, $token) deprecated

deprecated

No description

Parameters

$userId
$token

at line 2680
notify(int|array $user_id, string $token, string $subject, string $plaintext = null, mixed $html = false, mixed $url = null, string $icon = null, string $type = XF\Lib\Notification\NotificationType::ACTIVITY) deprecated

deprecated Please use the NotificationBuilder

Notification

Parameters

int|array $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')

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

at line 1885
page__feed(UniversalFeedCreator $feed)

No description

Parameters

UniversalFeedCreator $feed

at line 1896
page__file()

No description

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

No description

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

DatabaseException

Examples

UPDATE ###tbl|contact### set displayname = ?, status = ? WHERE id = ?;

$params = array($displayname,$status,$id)

at line 716
string|string[]|null prepareQueryWithParams(string $sql, array $params)

No description

Parameters

string $sql
array $params

Return Value

string|string[]|null

at line 753
string prepare_lquery($sql)

No description

Parameters

$sql

Return Value

string

Parsed Query

at line 743
string prepare_query(string $sql)

No description

Parameters

string $sql Query

Return Value

string

Parsed Query

at line 1636
string print_context_menu($params, array $context_links, bool $current_link = false, bool $no_js_fallback = true, $onMouseOver = false)

No description

Parameters

$params
array $context_links

multi-dimensional context_links (use '-' for separator)

bool $current_link

Set to true if all links are current_links

bool $no_js_fallback

If set to FALSE these links will not be shown if JS is NOT present

$onMouseOver

Return Value

string

HTML return link resource array

at line 1664
string print_context_menu_with_submenu(array $entries, array $params = array()) deprecated

deprecated

No description

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

No description

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, 'confirmtext'=>("Are you sure?"), 'JS-FSLoader'=>['message' => 'loading..', 'autohide'=>'5000'], 'ajax_modal'=>['form' => ['reload'=>true,'reloadTable'=>'table_dom_id','reloadXUI'=>'xui_dom_id'], 'width'=> 800, 'height' => '80%', 'fullscreen' => true], 'ajax_update'=>$domId, 'ajax_replace'=>$domId, 'xdi' => DocumentIndex, 'xui_target' => UIAjaxComponent ]

Return Value

string

Full HTML A Tag

No description

Parameters

$path_to_file
$params

at line 384
string render()

Render Module Output, this will get the template of the default page and render the template

Return Value

string

Output (eg. html)

at line 2345
string|null resolveDocumentIndexPermaURL(DocumentIndex $documentIndex)

Parameters

DocumentIndex $documentIndex

Return Value

string|null

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
array $cmd

CMD Params

Return Value

string|false

string URL or false if not resolvable

deprecated Please use resolveDocumentIndexPermaURL() instead

Return the URL info of the page representing your document

Parameters

int $post_id
int $post_type

Return Value

array

xf_link LinkHelper

at line 2588
XfsDocument|null retrieve_document(int $document_index_id, DocumentIndex|DocumentModel|int $main_document_index_id = null)

Returns the xfs_document in the storage DMS to a ID.

Parameters

int $document_index_id

document index ID

DocumentIndex|DocumentModel|int $main_document_index_id

The owner document which the document is attached to

Return Value

XfsDocument|null

The system_dms_document

at line 1921
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

at line 315
setDepLinkContext(string $localPage, string $localCmd)

Enforce Link Context based on Current Parent Instance for the local Page and CMD

Parameters

string $localPage
string $localCmd

at line 420
Core setGroupContext(int $group_id, string $short_name = null)

No description

Parameters

int $group_id

group id

string $short_name

short name

Return Value

Core

at line 579
void set_config(string $var, mixed $value, string|bool $context = false, string|bool $subcontext = false)

No description

Parameters

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

Return Value

void

at line 597
void set_config_for_session(string $var, string $value, string $context = false, string $subcontext = false)

No description

Parameters

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

Return Value

void

at line 2469
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

Core $parent
string $view
string $page
string $cmd

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

No description

Parameters

int $group_id

group id

string|bool $short_name

short name

Return Value

void

in ObjectManager at line 126
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 142
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 157
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

at line 245
set_parent_context(Core $obj, $clone_link_helper = true)

No description

Parameters

Core $obj

Module Instance

$clone_link_helper

No description

Parameters

$xf_link

Return Value

void

at line 950
xelos_global_template|bool setup_check($args = array())

Check/Get Setup Page

Parameters

$args

Return Value

xelos_global_template|bool

in StaticCacheTrait at line 121
static void staticCacheClearAllCachePools()

No description

Return Value

void

in StaticCacheTrait at line 114
static void staticCacheClearCachePool($cache_pool = 'default')

Clears the specified cache pool from the static cache

Parameters

$cache_pool

Return Value

void

in StaticCacheTrait at line 61
static array|string|int|bool|null staticCacheGet($key, string $cache_pool = 'default')

Retrieves a value from the static cache

Parameters

$key
string $cache_pool

Return Value

array|string|int|bool|null

Returns the cached result or null if no value has been stored

in StaticCacheTrait at line 98
static array staticCacheGetKeys(string $cache_pool = 'default')

Returns an array of all cache keys which have been set

Parameters

string $cache_pool

Return Value

array

in StaticCacheTrait at line 107
static array staticCacheGetPool($cache_pool)

Returns an key/value array with all cached values from the passed pool

Parameters

$cache_pool

Return Value

array

in StaticCacheTrait at line 34
static bool staticCacheIsEnabled()

No description

Return Value

bool

in StaticCacheTrait at line 85
static bool staticCacheIsSet($key, string $cache_pool = 'default')

Checks if the passed is key has a value set

Parameters

$key
string $cache_pool

Return Value

bool

in StaticCacheTrait at line 73
static staticCacheRemove($key, string $cache_pool = 'default')

Removes the passed key

Parameters

$key
string $cache_pool

in StaticCacheTrait at line 46
static void staticCacheSet(string|int $key, mixed $value, string $cache_pool = 'default')

Store a value in the static cache

Parameters

string|int $key
mixed $value
string $cache_pool

ID for the cache pool which should be used

Return Value

void

at line 2606
Document|null store_file(string $path, string|null $xfsPath, string|null $file_name = null, DocumentModel|null $ownerDocumentModel = null)

Stores the file in the system DMS

Parameters

string $path

path to the new file

string|null $xfsPath

virtual folder in the System DMS where the document is stored

string|null $file_name

filename in the System DMS

DocumentModel|null $ownerDocumentModel

Document that owns all stored files by reference and subcategory of system dms

Return Value

Document|null

The new xfs_document in the system DMS

at line 1607
bool userHasApiAccess()

Does the user have API access to this instance?

Return Value

bool

at line 1587
bool user_has_access(?string $page = null, string|bool $instance_id = false, int $group_security_id = 0)

Check if user has PAGE access to the instance

Parameters

?string $page page
string|bool $instance_id instance
int $group_security_id

Group Security ID

Return Value

bool success

at line 1618
array user_has_access_in_groups(string $page)

Return the group_security ids the user has access to

Parameters

string $page

Return Value

array

Group Security IDs

at line 1541
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

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

at line 1554
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

at line 1567
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 104
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\"