class Link

Properties

$_view
$_page
$_cmd
$_navid
$_params
$context
$context_id
$context_counter
$dep_params

Methods

__construct(string $view = "undefined", string $page = "undefined", string $cmd = "undefined", bool $navid = false)

Link constructor.

cb_clean_arguments(string $value, string $key, array $exclude)

No description

int
check_header(mixed $curl_session, string $header_data)

Check Header

decode_special_chars(string $link_param, $decode_hash = true)

Decode Special Chars like [/,#=]

mixed
encode_link_param(string $link_param, bool $encode_hash = false)

Encode Special Chars like [/,#=]

string
getContextMenu(MenuList $menuList, MenuOptions|null $menuOptions = null)

Generate Context Menu (WebComponent)

string
getCurrentRequestURI(array $queryParams = [])

Return the current Request URI, without access checks Allows to pass custom query Params Filter XELOS a_ params from URL

string
getDomain()

Returns the current domain name with TLD.

string
getModifiedRequestURI(string $uri, array $queryParams = [])

Modify a Request URI, without access checks Allows to pass custom query Params Filter XELOS a_ params from URL

int
get_context_counter()

No description

string
get_context_hidden_field()

No description

string
get_context_id()

No description

array
get_current_link(array $args = array(), array $options = array(), string $location = 'GET')

Return Link as Ressource-Array using the parameters of the current page call

string
get_current_url(array $args = array())

No description

get_defaults()

No description

array
get_filtered_GPvars(array $GPvars, string $link_identifier)

No description

string
get_host()

Returns the host with protocol and port if is not the default port.

get_internal_url_info($url)

No description

array
get_link(array $args = array())

Return Link as Ressource-Array

string
get_url(array $args = array())

GET URL

array|false
get_url_info(string $url)

Parse URL and retrieve information

init($reset_params = true)

Init Default Vars

bool
isExternalURI(string $uri)

Is the given URL considered an external URI? Or internal (absolute with same host or relative URI)

bool
is_request_authentic()

No description

bool
is_request_secure()

No description

string
makeInternalURIRelative(string $uri)

If the passed URL is an internal URL this helper returns a relative URL. Otherwise the full url is returned

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

Display Context Links

string
print_current_link(array $args = array(), $options = array(), $location = 'GET')

Print current full HTML Link

string
print_current_url(array $args = array(), $options = array(), $location = 'GET')

Print current URL Link

string
print_link(array $args = array())

Print full HTML Link

string
print_url(array $args = array())

Print URL Link

array
replace_link_vars(array $link_array, array $variables)

No description

replace_link_vars_cb($match)

Callback used by replace_link_vars

setCurlProxyOptions(CurlHandle|resource $curlResource)

Sets the proxy parameters for a cURL resource if they are set in the config custom.

void
setOverwriteGPVars(array $GPVars)

GPVars that should be overwiritten, when building links from GPVars

void
set_defaults(string $view = null, string $page = null, string|array $cmd = null)

Declare Default Settings

void
set_instance_context(string $id, bool $context = false)

No description

Details

at line 76
__construct(string $view = "undefined", string $page = "undefined", string $cmd = "undefined", bool $navid = false)

Link constructor.

Parameters

string $view
string $page
string $cmd
bool $navid

at line 409
cb_clean_arguments(string $value, string $key, array $exclude)

No description

Parameters

string $value Value
string $key Key
array $exclude

at line 1472
int check_header(mixed $curl_session, string $header_data)

Check Header

Parameters

mixed $curl_session
string $header_data

Return Value

int

Bytes written

at line 1190
decode_special_chars(string $link_param, $decode_hash = true)

Decode Special Chars like [/,#=]

Parameters

string $link_param
$decode_hash

Encode Special Chars like [/,#=]

Parameters

string $link_param

UnEncoded RAW string

bool $encode_hash

If true a hash sign will be treated as parameter and be encoded, otherwise a hash will not be encoded and being regarded as HTML Anchor

Return Value

mixed

at line 790
string getContextMenu(MenuList $menuList, MenuOptions|null $menuOptions = null)

Generate Context Menu (WebComponent)

Parameters

MenuList $menuList
MenuOptions|null $menuOptions

Return Value

string

HTML WebComponent Tag

at line 1527
string getCurrentRequestURI(array $queryParams = [])

Return the current Request URI, without access checks Allows to pass custom query Params Filter XELOS a_ params from URL

Main Purpose for this function is to act for redirects when user is not logged in yet (e.g. for API or Auth Calls)

Parameters

array $queryParams

Return Value

string

at line 1103
string getDomain()

Returns the current domain name with TLD.

For example "xelos.net"

Return Value

string

at line 1543
string getModifiedRequestURI(string $uri, array $queryParams = [])

Modify a Request URI, without access checks Allows to pass custom query Params Filter XELOS a_ params from URL

Main Purpose for this function is to act for redirects when user is not logged in yet (e.g. for API or Auth Calls)

Parameters

string $uri
array $queryParams

Return Value

string

at line 1162
int get_context_counter()

No description

Return Value

int

at line 1144
string get_context_hidden_field()

No description

Return Value

string

HTML Form Field

at line 1153
string get_context_id()

No description

Return Value

string

Return Link as Ressource-Array using the parameters of the current page call

Parameters

array $args

Arguments in Assoc-Array, will overwrite the current arguments of the page call

array $options

Options like 'exclude'=>array('link_param','cmd')

string $location

Location determines Linkbuilding (GET [default] or GP)

Return Value

array

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

at line 259
string get_current_url(array $args = array())

No description

Parameters

array $args

Return Value

string

at line 173
get_defaults()

No description

at line 1115
array get_filtered_GPvars(array $GPvars, string $link_identifier)

No description

Parameters

array $GPvars

GPvars Array

string $link_identifier

Link Identifier

Return Value

array

Filtered GPvars

at line 1078
string get_host()

Returns the host with protocol and port if is not the default port.

Return Value

string

at line 1207
get_internal_url_info($url)

No description

Parameters

$url

Return Link as Ressource-Array

Parameters

array $args

Params in Array Format (Typical params: label,page,cmd,class,target,title,confirm_text,tooltip,JS-FSLoader,ajax_modal,ajax_update,ajax_replace)

Return Value

array

Link Resources (Assoc Array with: label, target, class, title, href, full

Examples

$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')));

at line 248
string get_url(array $args = array())

GET URL

Parameters

array $args

Return Value

string

HTML URL

See also

\XELOS\Framework\XF\Lib\self::get_link()

at line 1274
array|false get_url_info(string $url)

Parse URL and retrieve information

Parameters

string $url

Return Value

array|false

(title, description, type, image, http_status_code)

at line 112
init($reset_params = true)

Init Default Vars

Parameters

$reset_params

at line 1568
bool isExternalURI(string $uri)

Is the given URL considered an external URI? Or internal (absolute with same host or relative URI)

Parameters

string $uri

Return Value

bool

at line 974
bool is_request_authentic()

No description

Return Value

bool success

at line 966
bool is_request_secure()

No description

Return Value

bool success

at line 1582
string makeInternalURIRelative(string $uri)

If the passed URL is an internal URL this helper returns a relative URL. Otherwise the full url is returned

Parameters

string $uri

Return Value

string

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

deprecated Use getContextMenu()

Display Context Links

Parameters

array $params link_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

bool $onMouseOver

Show Menu on Mouseover (alternate is click)

Return Value

string

HTML return link resource array

Print current full HTML Link

Parameters

array $args
$options
$location

Return Value

string HTML

at line 282
string print_current_url(array $args = array(), $options = array(), $location = 'GET')

Print current URL Link

Parameters

array $args
$options
$location

Return Value

string

html URL

Print full HTML Link

Parameters

array $args

= [ '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' => 'noajax', 'width'=> 800 ], 'ajax_update'=>$domId, 'ajax_replace'=>$domId, 'xdi' => DocumentIndex, 'xui_target' => UIAjaxComponent ]

Return Value

string

HTML Link

at line 235
string print_url(array $args = array())

Print URL Link

Parameters

array $args

Return Value

string

HTML Link

No description

Parameters

array $link_array

xfLink Array

array $variables

Associative Array (e.g. array('id'=>1)) OR Model

Return Value

array

Returns xfLink Array

Callback used by replace_link_vars

Parameters

$match

at line 1487
setCurlProxyOptions(CurlHandle|resource $curlResource)

Sets the proxy parameters for a cURL resource if they are set in the config custom.

Parameters

CurlHandle|resource $curlResource

Resource created by curl_init

at line 1601
void setOverwriteGPVars(array $GPVars)

GPVars that should be overwiritten, when building links from GPVars

Parameters

array $GPVars

Return Value

void

at line 160
void set_defaults(string $view = null, string $page = null, string|array $cmd = null)

Declare Default Settings

Parameters

string $view
string $page
string|array $cmd

Return Value

void

at line 186
void set_instance_context(string $id, bool $context = false)

No description

Parameters

string $id
bool $context

Link ID (e.g. module.instance.plugin)

Return Value

void