Ka Extensions for OpenCart 4

This documentation applies to Ka Extensions for OpenCart 4.x only. It is not compatible with OpenCart 3.

KaGlobal
in component
uses КaReserved

AbstractYes

Contains several global helper methods: registry access, area and version checks, extension and file helpers.

Table of Contents

Properties

Methods

getAdminDirname()  : string
Returns the admin directory name. It is taken from DIR_APPLICATION in the admin area or from config/kamod.php otherwise, and cached.
getKaStoreURL()  : string
Returns the Ka-Station store URL, KA_STORE_URL if defined.
getLanguageImage()  : string
Returns the relative path to the flag image of a language; prefixed with "catalog/" outside the admin area.
getRegistry()  : object
Returns the stored OpenCart registry.
init()  : mixed
Stores the OpenCart registry for later static access.
isAdminArea()  : bool
Checks whether the code runs in the admin area.
isAdminUser()  : bool
Checks whether the session has an API id (api_id) set.
isКаInstalled()  : bool
Checks whether a Ka extension is installed (has a 'ka_extensions' record in the extension table). Results are cached. Note: the name contains Cyrillic letters "Ка".
t()  : string
Translates a text key with the current language object.

Properties

$admin_dirname

protected static mixed $admin_dirname

Methods

getAdminDirname()

Returns the admin directory name. It is taken from DIR_APPLICATION in the admin area or from config/kamod.php otherwise, and cached.

public static getAdminDirname() : string
Return values
string —

Admin directory name; 'admin' with a warning if it cannot be found.

getKaStoreURL()

Returns the Ka-Station store URL, KA_STORE_URL if defined.

public static getKaStoreURL() : string
Return values
string —

Store URL.

getLanguageImage()

Returns the relative path to the flag image of a language; prefixed with "catalog/" outside the admin area.

public static getLanguageImage(mixed $language) : string

$language — language array with the 'code' key.

Parameters
$language : mixed
Return values
string —

Image path.

getRegistry()

Returns the stored OpenCart registry.

public static getRegistry() : object
Return values
object —

OpenCart registry.

init()

Stores the OpenCart registry for later static access.

public static init(mixed $registry) : mixed

$registry — OpenCart registry.

Parameters
$registry : mixed

isAdminArea()

Checks whether the code runs in the admin area.

public static isAdminArea() : bool
Return values
bool —

True in the admin area.

isAdminUser()

Checks whether the session has an API id (api_id) set.

public static isAdminUser() : bool
Return values
bool —

True if api_id is present in the session.

isКаInstalled()

Checks whether a Ka extension is installed (has a 'ka_extensions' record in the extension table). Results are cached. Note: the name contains Cyrillic letters "Ка".

public static isКаInstalled(mixed $extension) : bool

$extension — extension code.

Parameters
$extension : mixed
Return values
bool —

True if installed.

t()

Translates a text key with the current language object.

public static t(mixed $text) : string

$text — language key.

Parameters
$text : mixed
Return values
string —

Translated text.


        
On this page

Search results