Skip to content

Commit

Permalink
Adjusted some files and structures so the exponent.js.php doesn't hav…
Browse files Browse the repository at this point in the history
…e to load exponent.php in order to map constants to JS
  • Loading branch information
illiphilli committed Apr 28, 2011
1 parent 74454df commit 013d423
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 93 deletions.
6 changes: 5 additions & 1 deletion exponent.js.php
Expand Up @@ -19,7 +19,11 @@
##################################################

//Initialize exponent Framework
include_once("exponent.php");
include_once('exponent_common.php');
include_once(BASE.'exponent_constants.php');
// Initialize the language subsystem
require_once(BASE.'subsystems/lang.php');
exponent_lang_initialize();
?>
// exponent Javascript Support Systems

Expand Down
78 changes: 4 additions & 74 deletions exponent.php
Expand Up @@ -2,7 +2,7 @@

##################################################
#
# Copyright (c) 2004-2011 OIC Group, Inc.
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
Expand All @@ -17,20 +17,7 @@
#
##################################################

function __realpath($path) {
$path = str_replace('\\','/',realpath($path));
if ($path{1} == ':') {
// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.
$path = substr($path,2);
}
return $path;
}

// Bootstrap, which will clean the _POST, _GET and _REQUEST arrays, and include
// necessary setup files (exponent_setup.php, exponent_variables.php) as well as initialize
// the compatibility layer.
// This was moved into its own file from this file so that 'lighter' scripts could bootstrap.
include_once(dirname(__realpath(__FILE__)).'/exponent_bootstrap.php');
require_once('exponent_common.php');

// Initialize the AutoLoader Subsystem
require_once(BASE.'subsystems/autoloader.php');
Expand All @@ -40,65 +27,8 @@ function __realpath($path) {
// Initializes the session.
exponent_sessions_initialize();

/*
if (isset($_REQUEST['section'])) {
exponent_sessions_set('last_section', intval($_REQUEST['section']));
} else {
if (!isset($_REQUEST['action']) && !isset($_REQUEST['module'])) exponent_sessions_set('last_section', SITE_DEFAULT_SECTION);
}
*/

if (!defined('DISPLAY_THEME')) {
/* exdoc
* The directory and class name of the current active theme. This may be different
* than the configure theme (DISPLAY_THEME_REAL) due to previewing.
*/
define('DISPLAY_THEME',DISPLAY_THEME_REAL);
}
if (!defined('THEME_ABSOLUTE')) {
/* exdoc
* The absolute path to the current active theme's files. This is similar to the BASE constant
*/
define('THEME_ABSOLUTE',BASE.'themes/'.DISPLAY_THEME.'/'); // This is the recommended way
}
if (!defined('THEME_RELATIVE')) {
/* exdoc
* The relative web path to the current active theme. This is similar to the PATH_RELATIVE consant.
*/
define('THEME_RELATIVE',PATH_RELATIVE.'themes/'.DISPLAY_THEME.'/');
}
if (!defined('JS_FULL')) {
/* exdoc
* The absolute path to Exponent's core javascript.
*/
define('JS_FULL',URL_FULL.'framework/core/assets/js/');
}

// Initialize the theme subsystem
if (!defined('SYS_THEME')) require_once(BASE.'subsystems/theme.php');

// iconset base
if (!defined('ICON_RELATIVE')) {

define('ICON_RELATIVE', PATH_RELATIVE . 'framework/core/assets/images/');

}
if (!defined('MIMEICON_RELATIVE')) {
//DEPRECATED: old directory, inconsitent naming
// if (is_readable(THEME_ABSOLUTE . 'mimetypes/')) {
/* exdoc
* The relative web path to the current MIME icon set. If a mimetypes/ directory
* exists directly underneath the theme's directory, then that is used. Otherwise, the
* system falls back to the iconset/mimetypes/ directory in the root of the Exponent directory.
*/
// define('MIMEICON_RELATIVE', THEME_RELATIVE . 'mimetypes/');
// } else if(is_readable(THEME_ABSOLUTE . "images/icons/mimetypes" )){
// define('MIMEICON_RELATIVE', THEME_RELATIVE . "images/icons/mimetypes/");
// } else {
// define('MIMEICON_RELATIVE', PATH_RELATIVE . 'themes/common/images/icons/mimetypes/');
// }
define('MIMEICON_RELATIVE', PATH_RELATIVE . 'themes/common/skin/mimetypes/');
}
// initialize useful/needed constants throughout the system
require_once(BASE.'exponent_constants.php');

// Initialize the language subsystem
require_once(BASE.'subsystems/lang.php');
Expand Down
17 changes: 17 additions & 0 deletions exponent_common.php
@@ -0,0 +1,17 @@
<?
function __realpath($path) {
$path = str_replace('\\','/',realpath($path));
if ($path{1} == ':') {
// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.
$path = substr($path,2);
}
return $path;
}

// Bootstrap, which will clean the _POST, _GET and _REQUEST arrays, and include
// necessary setup files (exponent_setup.php, exponent_variables.php) as well as initialize
// the compatibility layer.
// This was moved into its own file from this file so that 'lighter' scripts could bootstrap.

include_once(dirname(__realpath(__FILE__)).'/exponent_bootstrap.php');
?>
88 changes: 88 additions & 0 deletions exponent_constants.php
@@ -0,0 +1,88 @@
<?
if (!defined('DISPLAY_THEME')) {
/* exdoc
* The directory and class name of the current active theme. This may be different
* than the configure theme (DISPLAY_THEME_REAL) due to previewing.
*/
define('DISPLAY_THEME',DISPLAY_THEME_REAL);
}
if (!defined('THEME_ABSOLUTE')) {
/* exdoc
* The absolute path to the current active theme's files. This is similar to the BASE constant
*/
define('THEME_ABSOLUTE',BASE.'themes/'.DISPLAY_THEME.'/'); // This is the recommended way
}
if (!defined('THEME_RELATIVE')) {
/* exdoc
* The relative web path to the current active theme. This is similar to the PATH_RELATIVE consant.
*/
define('THEME_RELATIVE',PATH_RELATIVE.'themes/'.DISPLAY_THEME.'/');
}
if (!defined('JS_FULL')) {
/* exdoc
* The absolute path to Exponent's core javascript.
*/
define('JS_FULL',URL_FULL.'framework/core/js/');
}

// Initialize the theme subsystem
if (!defined('SYS_THEME')) require_once(BASE.'subsystems/theme.php');

// iconset base
if (!defined('ICON_RELATIVE')) {

define('ICON_RELATIVE', PATH_RELATIVE . 'themes/common/skin/');

//DEPRECATED: old directory, inconsitent naming
/*if (is_readable(THEME_ABSOLUTE . 'icons/')) {
/* exdoc
* The relative web path to the current icon set. If an icons/ directory exists directly
* underneath the theme's directory, that is used. Otherwise, the system falls back to
* the iconset directory in the root of the Exponent directory.
define('ICON_RELATIVE', THEME_RELATIVE . 'icons/');
} else
Commented out compat layer for < 0.96.6 version. All icons should be in common/skin ~phillip Ball
if(is_readable(THEME_ABSOLUTE . "images/icons/")){
define('ICON_RELATIVE',THEME_RELATIVE . 'images/icons/');
} else {
define('ICON_RELATIVE', PATH_RELATIVE . 'themes/common/images/icons/');
}
*/
}
if (!defined('MIMEICON_RELATIVE')) {
//DEPRECATED: old directory, inconsitent naming
// if (is_readable(THEME_ABSOLUTE . 'mimetypes/')) {
/* exdoc
* The relative web path to the current MIME icon set. If a mimetypes/ directory
* exists directly underneath the theme's directory, then that is used. Otherwise, the
* system falls back to the iconset/mimetypes/ directory in the root of the Exponent directory.
*/
// define('MIMEICON_RELATIVE', THEME_RELATIVE . 'mimetypes/');
// } else if(is_readable(THEME_ABSOLUTE . "images/icons/mimetypes" )){
// define('MIMEICON_RELATIVE', THEME_RELATIVE . "images/icons/mimetypes/");
// } else {
// define('MIMEICON_RELATIVE', PATH_RELATIVE . 'themes/common/images/icons/mimetypes/');
// }
define('MIMEICON_RELATIVE', PATH_RELATIVE . 'themes/common/skin/mimetypes/');
}

if (!defined('YUI3_PATH')) {
/*
* YUI 3 Version Constant Constant
*
* Changing the version here lets Exponent adjust where
*/
define('YUI3_VERSION', '3.3.0');
define('YUI3_PATH', PATH_RELATIVE.'external/lissa/'.YUI3_VERSION.'/build/');
define('YUI3_URL', URL_FULL.'external/lissa/'.YUI3_VERSION.'/build/');
}

if (!defined('YUI2_PATH')) {
define('YUI2_VERSION', '2.8.0r4');
define('YUI2_PATH', PATH_RELATIVE.'external/lissa/'.YUI2_VERSION.'/build/');
define('YUI2_URL', URL_FULL.'external/lissa/'.YUI2_VERSION.'/build/');
}

?>
19 changes: 1 addition & 18 deletions exponent_variables.php
Expand Up @@ -2,7 +2,7 @@

##################################################
#
# Copyright (c) 2004-2011 OIC Group, Inc.
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
Expand Down Expand Up @@ -121,23 +121,6 @@
define('SCRIPT_FILENAME', 'index.php');
}

if (!defined('YUI3_PATH')) {
/*
* YUI 3 Version Constant Constant
*
* Changing the version here lets Exponent adjust where
*/
define('YUI3_VERSION', '3.3.0');
define('YUI3_PATH', PATH_RELATIVE.'external/lissa/'.YUI3_VERSION.'/build/');
define('YUI3_URL', URL_FULL.'external/lissa/'.YUI3_VERSION.'/build/');
}

if (!defined('YUI2_PATH')) {
define('YUI2_VERSION', '2.8.0r4');
define('YUI2_PATH', PATH_RELATIVE.'external/lissa/'.YUI2_VERSION.'/build/');
define('YUI2_URL', URL_FULL.'external/lissa/'.YUI2_VERSION.'/build/');
}

include_once(BASE . '/subsystems/config/load.php');

?>

0 comments on commit 013d423

Please sign in to comment.