1
|
<?php
|
2
|
/* -------------------------------------------------------- */
|
3
|
if(defined('WB_PATH') == false)
|
4
|
{
|
5
|
// Stop this file being access directly
|
6
|
die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
|
7
|
}
|
8
|
/* -------------------------------------------------------- */
|
9
|
|
10
|
// use Debug Mode?
|
11
|
$debugmode = false;
|
12
|
// make directory changes more flexible
|
13
|
$module_name = 'quickSkin';
|
14
|
$module_directory = basename(dirname(__FILE__));
|
15
|
|
16
|
$aMsg = array();
|
17
|
require_once(WB_PATH.'/framework/functions.php');
|
18
|
// COMPILED TEMPLATES
|
19
|
$_CONFIG['quickskin_compiled'] = WB_PATH.'/temp/'.$module_name.'/_skins_tmp/';
|
20
|
if(!is_dir($_CONFIG['quickskin_compiled'])) {
|
21
|
$msg = createFolderProtectFile($_CONFIG['quickskin_compiled']);
|
22
|
if(sizeof($msg)) {
|
23
|
// $admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link );
|
24
|
$aMsg[] = $msg;
|
25
|
}
|
26
|
}
|
27
|
|
28
|
// CACHED FILES
|
29
|
$_CONFIG['quickskin_cache'] = WB_PATH.'/temp/'.$module_name.'/_skins_cache/';
|
30
|
if(!is_dir($_CONFIG['quickskin_cache'])) {
|
31
|
$msg = createFolderProtectFile($_CONFIG['quickskin_cache']);
|
32
|
if(sizeof($msg)) {
|
33
|
//$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link );
|
34
|
$aMsg[] = $msg;
|
35
|
}
|
36
|
}
|
37
|
$_CONFIG['cache_lifetime'] = 600;
|
38
|
|
39
|
// EXTENTSIONS DIR
|
40
|
$_CONFIG['extensions_dir'] = str_replace('\\','/', dirname(__FILE__).'/_lib/qx');
|
41
|
|
42
|
require_once (WB_PATH.'/include/'.$module_directory.'/_lib/quickSkin_28/class.quickskin.php');
|
43
|
|
44
|
|
45
|
/**
|
46
|
Comment out : will not work on all clients
|
47
|
Must be also made dependent from the client browser
|
48
|
|
49
|
SET UP COMPRESSION
|
50
|
|
51
|
if ( ini_get( 'zlib.output_compression' ) && ini_get( 'zlib.output_compression_level' ) != 5 ) {
|
52
|
ini_set( 'zlib.output_compression_level', '5' );
|
53
|
ob_start();
|
54
|
}
|
55
|
*/
|
56
|
|
57
|
/**
|
58
|
* use_common_placeholders DEPRICATED
|
59
|
*
|
60
|
* This function is for QuickSkins internal use.
|
61
|
* It will replace common placeholders to ease the work
|
62
|
* and the creation of modules and its templates
|
63
|
* This function is called in the class.quickskin.php
|
64
|
*
|
65
|
*/
|
66
|
|
67
|
function use_common_placeholders($text) { // DEPRICATED
|
68
|
|
69
|
/**
|
70
|
This function makes possible to use the following PLACEHOLDERS within your modules.
|
71
|
Works good in PAGE Type and ADMIN TOOL Type modules.
|
72
|
As of date 12-18-2011, SNIPPET Type Modules weren't tested
|
73
|
[MODULE_NAME]
|
74
|
[MODULE_URL]
|
75
|
|
76
|
[WB_URL]
|
77
|
[ADMIN_URL]
|
78
|
[THEME_URL]
|
79
|
[MEDIA_DIRECTORY]
|
80
|
|
81
|
[TEMPLATE_DIR]
|
82
|
[TEMPLATE_NAME]
|
83
|
[TEMPLATE]
|
84
|
|
85
|
*/
|
86
|
switch (TRUE){
|
87
|
case isset($GLOBALS['tool']): $MOD_NAME = $GLOBALS['tool']; break; // AdminTool
|
88
|
case isset($GLOBALS['section']['module']): $MOD_NAME = $GLOBALS['section']['module']; break; // PageType Module
|
89
|
case isset($GLOBALS['module_dir']): $MOD_NAME = $GLOBALS['module_dir']; break; // SnippetType Module
|
90
|
default: $MOD_NAME = FALSE;
|
91
|
|
92
|
}
|
93
|
|
94
|
if(isset($MOD_NAME)) {
|
95
|
$text = str_replace('[MODULE_NAME]', $MOD_NAME, $text);
|
96
|
$text = str_replace('[MODULE_URL]', WB_URL.'/modules/'.$MOD_NAME, $text);
|
97
|
}
|
98
|
|
99
|
// WB CONSTANTS (frontend only)
|
100
|
if(defined('TEMPLATE_DIR')) $text = str_replace('[TEMPLATE_DIR]', TEMPLATE_DIR, $text);
|
101
|
if(defined('TEMPLATE_NAME')) $text = str_replace('[TEMPLATE_NAME]', TEMPLATE_NAME, $text);
|
102
|
if(defined('TEMPLATE')) $text = str_replace('[TEMPLATE]', TEMPLATE, $text);
|
103
|
|
104
|
// WB CONSTANTS (always accessible)
|
105
|
$text = str_replace('[WB_URL]', WB_URL, $text);
|
106
|
$text = str_replace('[ADMIN_URL]', ADMIN_URL, $text);
|
107
|
$text = str_replace('[MEDIA_DIRECTORY]', MEDIA_DIRECTORY, $text);
|
108
|
$text = str_replace('[THEME_URL]', THEME_URL, $text);
|
109
|
|
110
|
return $text;
|
111
|
}
|