Initialization of the administrative part is similar to the initialization of the public part of the site. But it has its own characteristics due to the difference of the module structure and data access.
If the file index.php determined that requested the administrative part, then the file adm/index.php is connected. The file has the following functions:
The main system object – an instance of Init_admin described in the the file adm/includes/init.php.
When initiating a main object of the system takes place:
An instance Init_admin transmitted to all other facilities and is accessible from any location in the variable
Thus, the global data can be obtained anywhere in the system:
Now more about the data:
$this->diafan->installed_modules – data array with installed modules;
// module "Search" is installed and can be set to handle it
$this->diafan->rewrite_variable_names– list of all variables available for use in the URL;
$this->diafan->current_module– module of the current executable.
Class Init_admin inherits an abstract class Core](/dokument/full-manual/developers/api/core/) (includes/core.php). All functions of this class can be called up in the form of:
// cut the text up to 50 characters, while maintaining complete words at the end
$short_text = $this->diafan->short_text($text, 50);
Basically, the object classes are initiated:
Cache, file includes/cache.php, called
$this->diafan->_cache) – all the work with the cache;
Route, file includes/route.php, called
$this->diafan->_route) – access to the variables inherent in the link and the generation, storage, reception semantic URL;
Template, file includes/template.php, called
$this->diafan->_tpl) – connection module templates, processing of text from visual editor;
Parser_theme, file includes/parser_theme.php, called
$this->diafan->_parser_theme) – connects the template tags, prescribed in the form of tags in the site templates directly in the text of the visual editor.
In addition, through the main object can refer to any module-connection. If the module is file modules/module_name/module_name.inc.php where the class described Module_name_inc, then at the first reference to a variable
$this->diafan->_модуль, an instance is created.
Allocate a separate plug-ins related to the system kernel:
Per page admin - used to retrieve data about the current page in the administrative part.
admin pages – used to retrieve data about the current page in the administrative part.
$this->diafan->_admin->rewrite– semantic URL of current page;
$this->diafan->_admin->module– module attached to current page.
users – used to get information about the current user.
$this->diafan->_users->id– current user ID;
$this->diafan->_users->name– current user login;
$this->diafan->_users->fio– current user full name.
languages – used to get information about site languages, the main language of the administrative and public parts of the site and getting the translation interface.
$this->diafan->_languages->all– array of data about all the languages used on the site;
$this->diafan->_languages->site– ID of language used as the basic on the site;
$this->diafan->_languages->admin– language number, which is used as the basic admin part.