class UI

Class UI

Traits

Trait ObjectManager XELOS Framework

Constants

JQUERY_NOCONFLICT_SCRIPT

Used in get_js_files_base_files to start jQuery in noConflict mode meaning Prototype can use $.

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 $use_js
array $flash_messages
protected array $js_blocks
protected array $js_files
protected array $associated_content
protected array $css_files
protected array $css_files_meta
$admin_links
$admin_link_instances
$primary_admin_links
$template_links
$feed_links
static array $used_uids
Html $html

Methods

Carousel()

No description

mixed
__call($class, $args)

Magic method.

__construct()

UI constructor.

mixed
__get($class)

Magic method.

bool
__isset($property)

Magic method.

__set($name, $value)

Magic method.

void
add_admin_link($link_params)

No description

add_admin_link_for_instance($instance_id)

Shows passed instance's admin links as additional links in admin bar

void
add_css_file(string $file, string $position = 'bottom', string $media = null, string $if_condition = null)

No description

void
add_feed_link($params = array(), Core $mod = null)

No description

add_i18n_js()

No description

void
add_js_block(string $js)

No description

void
add_js_file(string $file, string $position = 'bottom')

No description

add_primary_admin_link($link_params)

No description

void
add_template_link(string $templatefile, $custom)

No description

admin_message(string $message, string $type = 'note', bool|int $expires_at = false, bool $uid = false)

Stores the passed message as admin message until the message expires or is marked read

amchart(mixed $link_id)

No description

catch_before_redirect()

Is being triggered before the page get's redirected

clear_css_files()

No description

clear_js_files()

No description

string
convert_www_to_hdd_path(string $web_path)

Converts a ressourc web path to the local hdd path

flash_message(string $message, string $type = 'note')

Stores the passed message as flash message until the next page call

string
getCSPNonce()

Get the CSP Nonce to secure JS/CSS Blocks https://content-security-policy.com/nonce/

string
getClassShortForNs(string $ns)

Returns the Classname from a given Namespace.

string
getCssClassForNs(string $ns, bool $legacy = false)

Builds a css class for the given Namespace like [vendor]-[module]-[name] e.g.: blueend-ui-carousel

getCssClassForObject($object, $legacy = false)

No description

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

string
getSecureInlineScriptTag($content)

Get Inline Script Tag with CSP Nonce and Subresource Integrity Attribute

get_admin_bar()

No description

get_admin_bar_config()

Returns all available Adminbar Options as JSON Object

array
get_admin_messages($clear_id = false)

Returns array of admin messages

array|bool
get_associated_content()

Get Associated Content (for SPDY Push)

array
get_css_files(bool $convert_less = false)

No description

string
get_css_files_meta()

No description

string
get_feed_links_meta()

No description

get_flash_message_html()

Returns a pre-rendered flash message output and clears messages from flash list

array
get_flash_messages(bool $clear = true)

Returns array of flash messages

string
get_js_blocks(bool $clear = true)

No description

get_js_blocks_raw($clear = true)

No description

array
get_js_files()

No description

string
get_js_files_base()

No description

array
get_js_files_base_files(bool $files_only = false)

Get JS Files

string
get_js_files_meta()

No description

string
get_last_js_block(bool $clear = true)

Return last JS Block and remove from array

array
get_less_variable_files()

Get LESS variable files

string
get_lib_class_dir()

Returns the path to class directory.

string
get_lib_class_prefix()

Returns the defined prefix for all classes.

array
get_object_cache()

Returns an array containing all objects were requested.

string
get_unique_dom_id(bool $true_random = false, string $uid_prefix = null)

No description

string
get_unique_string(string $string = 'unique', string $context = 'default', array $prefill = array())

No description

init()

No description

init_ui()

Initilized before VIEW execution with Event Trigger, Restore session values

new_ajax_container(mixed $id)

No description

new_breadcrumb(mixed $link_id)

No description

new_calendar()

No description

new_carousel()

No description

new_container(mixed $link_id)

No description

new_doclink(mixed $document_index_id, mixed $displaystyle)

No description

new_document_list()

No description

new_document_lock()

No description

new_faceted(mixed $link_id)

No description

new_form(mixed $options_or_name)

No description

new_form_editor(mixed $form_name, mixed $field_name)

No description

new_image(mixed $param_array))

No description

new_image_edit()

No description

new_import(mixed $name)

No description

new_inline_editor(mixed $link_id)

No description

new_item_list()

No description

Js
new_js()

No description

new_link(mixed $xf_link_array))

No description

new_paging(mixed $record_count, mixed $records_per_page, mixed $uid, mixed $record_start)

No description

new_progress_bar(mixed $link_id)

No description

new_qrcode(mixed $qr_content)

No description

new_table(mixed $table_id, mixed $table_attributes))

No description

new_table_editor(mixed $sql_table, mixed $fields, mixed $params, mixed $override, mixed $table_id)

No description

new_tabs(mixed $uid)

No description

new_timeline()

No description

new_tree(mixed $uniqueid = false)

No description

new_user_image()

No description

new_userlink(mixed $user_id)

No description

new_v_card(mixed $userIds)

No description

new_wizard(mixed $wizardID, mixed $defaultStep)

No description

reset()

Resets all internal counters (e.g. DOM ID references)

string|void
set_associated_content(string $resource)

Set Associated Content (for SPDY Push)

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.

unshift_js_block($js)

No description

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

No description

Return Value

Carousel

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

UI 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

No description

Parameters

$link_params

Return Value

void

Shows passed instance's admin links as additional links in admin bar

Parameters

$instance_id

at line 270
void add_css_file(string $file, string $position = 'bottom', string $media = null, string $if_condition = null)

No description

Parameters

string $file

Filename (absolute webpath e.g. /wwwres/my.css)

string $position

Position where to insert (bottom, top)

string $media

Media (Screen, Print, Handheld)

string $if_condition

IF Condition (e.g. 'IE 7' -> Only load this file for IE7)

Return Value

void

No description

Parameters

$params
Core $mod

Link to module controller object

Return Value

void

at line 419
add_i18n_js()

No description

at line 432
void add_js_block(string $js)

No description

Parameters

string $js

JS Code Block

Return Value

void

at line 327
void add_js_file(string $file, string $position = 'bottom')

No description

Parameters

string $file

JS filename (absolute webpath e.g. /wwwres/my.js)

string $position

Position where to insert (bottom, top)

Return Value

void

No description

Parameters

$link_params

No description

Parameters

string $templatefile

Path to template

$custom

Return Value

void

at line 197
admin_message(string $message, string $type = 'note', bool|int $expires_at = false, bool $uid = false)

Stores the passed message as admin message until the message expires or is marked read

Parameters

string $message

Message to display

string $type

Message type, Default Types: notice, error, success, access

bool|int $expires_at

UnixTimestamp to indicate expiry date

bool $uid

at line 83
Amchart amchart(mixed $link_id)

No description

Parameters

mixed $link_id

Return Value

Amchart

at line 160
catch_before_redirect()

Is being triggered before the page get's redirected

at line 537
clear_css_files()

No description

at line 540
clear_js_files()

No description

at line 956
string convert_www_to_hdd_path(string $web_path)

Converts a ressourc web path to the local hdd path

Parameters

string $web_path

Web Path (e.g. /wwwres/style.css)

Return Value

string

HDD Path (e.g. /server/xelos/wwwres/style.css)

at line 170
flash_message(string $message, string $type = 'note')

Stores the passed message as flash message until the next page call

Parameters

string $message

Message to display

string $type

Message type, Default Types: notice, error, success, access

at line 1892
string getCSPNonce()

Get the CSP Nonce to secure JS/CSS Blocks https://content-security-policy.com/nonce/

Return Value

string

at line 1785
string getClassShortForNs(string $ns)

Returns the Classname from a given Namespace.

XELOS\Framework\Module\UI -> ui \Something\Else -> else \Something\Completely\Different\ -> different xui_carousel -> xui_carousel

Parameters

string $ns

The Namespace

Return Value

string

The lowercase class name

Exceptions

Exception

at line 1809
string getCssClassForNs(string $ns, bool $legacy = false)

Builds a css class for the given Namespace like [vendor]-[module]-[name] e.g.: blueend-ui-carousel

Parameters

string $ns

The Namespace

bool $legacy

Build old class names

Return Value

string

The CSS class

Exceptions

Exception

at line 1797
getCssClassForObject($object, $legacy = false)

No description

Parameters

$object
$legacy

in ObjectManager at line 266
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 1881
string getSecureInlineScriptTag($content)

Get Inline Script Tag with CSP Nonce and Subresource Integrity Attribute

Parameters

$content

Return Value

string

at line 1129
get_admin_bar()

No description

at line 1447
get_admin_bar_config()

Returns all available Adminbar Options as JSON Object

at line 214
array get_admin_messages($clear_id = false)

Returns array of admin messages

Parameters

$clear_id

Return Value

array

at line 549
array|bool get_associated_content()

Get Associated Content (for SPDY Push)

Return Value

array|bool

at line 461
array get_css_files(bool $convert_less = false)

No description

Parameters

bool $convert_less

Should less files converted to css?

Return Value

array

at line 487
string get_css_files_meta()

No description

Return Value

string

HTML Tags ()

No description

Return Value

string

HTML Tags ()

at line 239
get_flash_message_html()

Returns a pre-rendered flash message output and clears messages from flash list

at line 183
array get_flash_messages(bool $clear = true)

Returns array of flash messages

Parameters

bool $clear

Return Value

array

at line 1581
string get_js_blocks(bool $clear = true)

No description

Parameters

bool $clear

Return Value

string

at line 1550
get_js_blocks_raw($clear = true)

No description

Parameters

$clear

at line 449
array get_js_files()

No description

Return Value

array

at line 752
string get_js_files_base()

No description

Return Value

string

HTML Tags (