-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexpose.php
85 lines (69 loc) · 1.97 KB
/
expose.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* Bootstrap for Expose Framework
*
* @package Expose
* @version ##VERSION##
* @author ThemeXpert http://www.themexpert.com
* @copyright Copyright (C) 2010 - 2011 ThemeXpert
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
**/
// Protect from unauthorized access
defined('_JEXEC') or die('Restricted Access');
// Check for PHP4
if(defined('PHP_VERSION')) {
$version = PHP_VERSION;
} elseif(function_exists('phpversion')) {
$version = phpversion();
} else {
$version = '5.0.0';
}
// if older version detect, raise an error
if(!version_compare($version, '5.0.0', '>='))
{
return JError::raise(E_ERROR, 500, 'PHP 4 is not supported by Expose Framework');
}
if(!defined('EXPOSE_VERSION'))
{
// Define framework version.
define('EXPOSE_VERSION', '4.2.4');
//define directory separator
defined('DS') or define('DS', '/');
if ( version_compare(JVERSION, '2.5', 'ge') && version_compare(JVERSION, '3.0', 'lt') )
{
define('EXPOSE_JVERSION', '25');
}else{
define('EXPOSE_JVERSION', '30');
}
//declare global ver
global $expose;
expose_import('core.core');
$expose = ExposeCore::getInstance();
}
/**
* File Loader
*
* This function will load file form given paths. Joomla default path style
*
* @access public
* @param string the directory path
* @return void
*/
function expose_import($paths){
$paths = str_replace('.', '/', $paths);
$file = realpath(dirname(__FILE__)) . '/' . $paths . '.php';
if(file_exists($file)) include_once ($file);
}
function getTemplate($id)
{
//get template name from template id
//$id = JRequest::getInt('id');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('template');
$query->from('#__template_styles');
$query->where("id=$id");
$db->setQuery($query);
$result = $db->loadObject();
return $result->template;
}