library.php
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
if (!defined("N2_PLATFORM_LIBRARY")) define('N2_PLATFORM_LIBRARY', dirname(__FILE__));
define('N2WORDPRESS', 0);
define('N2JOOMLA', 1);
define('N2MAGENTO', 0);
define('N2NATIVE', 0);
if (!defined('N2PRO')) {
define('N2PRO', 1);
}
// Load required UTF-8 config from Joomla
jimport( 'joomla.utilities.string' );
class_exists('JString');
if (!defined('JPATH_NEXTEND_IMAGES')) {
define('JPATH_NEXTEND_IMAGES', '/' . trim(JComponentHelper::getParams('com_media')
->get('image_path', 'images'), "/"));
}
require_once N2_PLATFORM_LIBRARY . '/../library/library.php';
N2Base::registerApplication(N2_PLATFORM_LIBRARY . '/../library/applications/system/N2SystemApplicationInfo.php');
function N2JoomlaExit() {
if (N2Platform::$isAdmin) {
$lifetime = JFactory::getConfig()
->get('lifetime');
if (empty($lifetime)) {
$lifetime = 60;
};
$lifetime = min(max(intval($lifetime) - 1, 9), 60 * 24);
N2JS::addInline('setInterval(function(){$.ajax({url: "' . JURI::current() . '", cache: false});}, ' . ($lifetime * 60 * 1000) . ');');
}
}
N2Pluggable::addAction('exit', 'N2JoomlaExit');