本文整理汇总了PHP中ipsRegistry::current_application方法的典型用法代码示例。如果您正苦于以下问题:PHP ipsRegistry::current_application方法的具体用法?PHP ipsRegistry::current_application怎么用?PHP ipsRegistry::current_application使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipsRegistry
的用法示例。
在下文中一共展示了ipsRegistry::current_application方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _finalizeAppData
/**
* Set up application data, etc.
*
* @return @e void
* @author MattMecham
*/
protected static function _finalizeAppData()
{
//-----------------------------------------
// Run the app class post output func
//-----------------------------------------
$app_class = self::getAppClass(IPS_APP_COMPONENT);
if ($app_class and method_exists($app_class, 'afterOutputInit')) {
$app_class->afterOutputInit(self::instance());
}
//-----------------------------------------
// Version numbers
//-----------------------------------------
if (strpos(self::$acpversion, '.') !== false) {
list($n, $b, $r) = explode(".", self::$acpversion);
} else {
$n = $b = $r = '';
}
self::$vn_full = self::$acpversion;
self::$acpversion = $n;
self::$vn_build_date = $b;
self::$vn_build_reason = $r;
# Figure out default modules, etc
$_module = IPSText::alphanumericalClean(ipsRegistry::$request['module']);
$_first = '';
//-----------------------------------------
// Set up some defaults
//-----------------------------------------
ipsRegistry::$current_application = IPS_APP_COMPONENT;
if (IPS_AREA == 'admin') {
//-----------------------------------------
// Application: Do we have permission?
//-----------------------------------------
if (ipsRegistry::$request['module'] != 'login') {
ipsRegistry::getClass('class_permissions')->return = 0;
ipsRegistry::getClass('class_permissions')->checkForAppAccess(IPS_APP_COMPONENT);
ipsRegistry::getClass('class_permissions')->return = 1;
}
//-----------------------------------------
// Got a module
//-----------------------------------------
if (ipsRegistry::$request['module'] == 'ajax') {
$_module = 'ajax';
} else {
$fakeApps = ipsRegistry::getClass('output')->fetchFakeApps();
foreach (ipsRegistry::$modules as $app => $items) {
if (is_array($items)) {
foreach ($items as $data) {
if ($data['sys_module_admin'] and $data['sys_module_application'] == ipsRegistry::$current_application) {
if (!$_first) {
# Got permission for this one?
ipsRegistry::getClass('class_permissions')->return = 1;
if (ipsRegistry::getClass('class_permissions')->checkForModuleAccess($data['sys_module_application'], $data['sys_module_key']) === TRUE) {
if (is_dir(IPSLib::getAppDir($data['sys_module_application']) . "/modules_admin/{$data['sys_module_key']}") === TRUE) {
$isFakeApp = false;
foreach ($fakeApps as $tab => $apps) {
foreach ($apps as $thisApp) {
if ($thisApp['app'] == $app and $thisApp['module'] == $data['sys_module_key']) {
$isFakeApp = true;
}
}
}
if (!$isFakeApp) {
$_first = $data['sys_module_key'];
}
}
}
ipsRegistry::getClass('class_permissions')->return = 0;
}
if (ipsRegistry::$request['module'] == $data['sys_module_key']) {
$_module = $data['sys_module_key'];
break;
}
}
}
}
}
}
} else {
//-----------------------------------------
// Got a module?
//-----------------------------------------
if ($_module == 'ajax') {
$_module = 'ajax';
} else {
foreach (ipsRegistry::$modules as $app => $items) {
if (is_array($items)) {
foreach ($items as $data) {
if (!$data['sys_module_admin'] and $data['sys_module_application'] == ipsRegistry::$current_application) {
if (!$_first) {
$_first = $data['sys_module_key'];
}
if ($_module == $data['sys_module_key']) {
$_module = $data['sys_module_key'];
break;
//.........这里部分代码省略.........