function elem_inc($name, $error = true) { $t_pos = strrpos($name, '/'); $name = $name . "/" . substr($name, $t_pos ? $t_pos + 1 : 0); return _name('modules/', $name, PATH, $error); }
function getModulesInfo() { static $modules_info = array(); if (!empty($modules_info)) { return $modules_info; } // @todo переделать получение конфига модулей $modules = $GLOBALS['cfg']['modules']; foreach ($modules as $module_name => $config) { $auth_file = $module_name . '/module.info'; $auth_pathname = _name('modules/', $auth_file, SITE_CORE); if (!is_file($auth_pathname)) { continue; } include_once $auth_pathname; } return $module_info; }
function module($name) { global $str; return strpos($name, '/') === false ? _name('modules/' . $name . '/', $name) : _name('modules/', $name); }