Project

General

Profile

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

    
13
$aMsg = array();
14
require_once(WB_PATH.'/framework/functions.php');
15
// COMPILED TEMPLATES
16
$_CONFIG['quickskin_compiled'] = WB_PATH.'/temp/quickSkin/_skins_tmp/';
17
if(!is_dir($_CONFIG['quickskin_compiled'])) {
18
	$msg = createFolderProtectFile($_CONFIG['quickskin_compiled']);
19
	if(sizeof($msg)) {
20
		// $admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link );
21
		$aMsg[] = $msg;
22
	}
23
}
24

    
25
// CACHED FILES
26
$_CONFIG['quickskin_cache'] = WB_PATH.'/temp/quickSkin/_skins_cache/';
27
if(!is_dir($_CONFIG['quickskin_cache'])) {
28
	$msg = createFolderProtectFile($_CONFIG['quickskin_cache']);
29
	if(sizeof($msg)) {
30
		//$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link );
31
		$aMsg[] = $msg;
32
	}
33
}
34
$_CONFIG['cache_lifetime'] = 600;
35

    
36
// EXTENTSIONS DIR
37
$_CONFIG['extensions_dir'] = str_replace('\\','/', dirname(__FILE__).'/_lib/qx'); 
38

    
39
require_once (WB_PATH.'/include/quickSkin_alpha/_lib/quickSkin_28/class.quickskin.php');
40

    
41

    
42
/**
43
	Comment out : will not work on all clients
44
	Must be also made dependent from the client browser
45

    
46
	SET UP COMPRESSION
47

    
48
if ( ini_get( 'zlib.output_compression' )  && ini_get( 'zlib.output_compression_level' ) != 5 ) {
49
  ini_set( 'zlib.output_compression_level', '5' );
50
  ob_start();
51
}
52
*/
53

    
54
/**
55
 * use_common_placeholders DEPRICATED
56
 * 
57
 * This function is for QuickSkins internal use.
58
 * It will replace common placeholders to ease the work 
59
 * and the creation of modules and its templates
60
 * This function is called in the class.quickskin.php
61
 *
62
 */
63

    
64
function use_common_placeholders($text) {  //  DEPRICATED
65

    
66
	/**
67
		This function makes possible to use the following PLACEHOLDERS within your modules.
68
		Works good in PAGE Type and ADMIN TOOL Type modules.
69
		As of date 12-18-2011, SNIPPET Type Modules weren't tested
70
		[MODULE_NAME]
71
		[MODULE_URL]
72

    
73
		[WB_URL]
74
		[ADMIN_URL]
75
		[THEME_URL]
76
		[MEDIA_DIRECTORY]
77
			
78
		[TEMPLATE_DIR]
79
		[TEMPLATE_NAME]
80
		[TEMPLATE]
81

    
82
	*/
83
	switch (TRUE){
84
		case isset($GLOBALS['tool']): $MOD_NAME = $GLOBALS['tool']; break;  // AdminTool
85
		case isset($GLOBALS['section']['module']): $MOD_NAME = $GLOBALS['section']['module']; break;  // PageType Module
86
		case isset($GLOBALS['module_dir']): $MOD_NAME = $GLOBALS['module_dir']; break;  // SnippetType Module
87
		default: $MOD_NAME = FALSE;
88
	
89
	}
90
	
91
	if(isset($MOD_NAME)) {
92
		$text = str_replace('[MODULE_NAME]', $MOD_NAME, $text);
93
		$text = str_replace('[MODULE_URL]', WB_URL.'/modules/'.$MOD_NAME, $text);
94
	}	
95
	
96
	// WB CONSTANTS (frontend only)
97
	if(defined('TEMPLATE_DIR'))	 $text = str_replace('[TEMPLATE_DIR]', TEMPLATE_DIR, $text);
98
	if(defined('TEMPLATE_NAME')) $text = str_replace('[TEMPLATE_NAME]', TEMPLATE_NAME, $text);
99
	if(defined('TEMPLATE'))	     $text = str_replace('[TEMPLATE]', TEMPLATE, $text);	
100
	
101
	// WB CONSTANTS (always accessible) 
102
	$text = str_replace('[WB_URL]', WB_URL, $text);	
103
	$text = str_replace('[ADMIN_URL]', ADMIN_URL, $text);
104
	$text = str_replace('[MEDIA_DIRECTORY]', MEDIA_DIRECTORY, $text);
105
	$text = str_replace('[THEME_URL]', THEME_URL, $text);
106
		
107
	return $text;
108
}
(4-4/4)