345 |
345 |
$base_file = "frontend.js";
|
346 |
346 |
}
|
347 |
347 |
|
348 |
|
// gather information for all models embedded on actual page
|
|
348 |
// gather information for all models embedded on actual page
|
349 |
349 |
$page_id = $wb->page_id;
|
350 |
|
$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections
|
|
350 |
$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections
|
351 |
351 |
WHERE page_id=$page_id AND module<>'wysiwyg'");
|
352 |
352 |
|
353 |
|
while($row = $query_modules->fetchRow()) {
|
354 |
|
// check if page module directory contains a frontend.js or frontend.css file
|
355 |
|
if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
|
|
353 |
while($row = $query_modules->fetchRow()) {
|
|
354 |
// check if page module directory contains a frontend.js or frontend.css file
|
|
355 |
if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
|
356 |
356 |
// create link with frontend.js or frontend.css source for the current module
|
357 |
357 |
$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
|
358 |
358 |
|
359 |
|
// define constant indicating that the register_frontent_files was invoked
|
|
359 |
// define constant indicating that the register_frontent_files was invoked
|
360 |
360 |
if($file_id == 'css') {
|
361 |
|
define('MOD_FRONTEND_CSS_REGISTERED', true);
|
|
361 |
if(!defined('MOD_FRONTEND_CSS_REGISTERED')) define('MOD_FRONTEND_CSS_REGISTERED', true);
|
362 |
362 |
} else {
|
363 |
|
define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
|
|
363 |
if(!defined('MOD_FRONTEND_JAVASCRIPT_REGISTERED')) define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
|
364 |
364 |
}
|
365 |
365 |
|
366 |
|
// ensure that frontend.js or frontend.css is only added once per module type
|
367 |
|
if(strpos($head_links, $tmp_link) === false) {
|
|
366 |
// ensure that frontend.js or frontend.css is only added once per module type
|
|
367 |
if(strpos($head_links, $tmp_link) === false) {
|
368 |
368 |
$head_links .= $tmp_link ."\n";
|
369 |
369 |
}
|
370 |
370 |
}
|
371 |
|
}
|
372 |
|
// include the Javascript email protection function
|
373 |
|
if($file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js')) {
|
|
371 |
}
|
|
372 |
// include the Javascript email protection function
|
|
373 |
if($file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js')) {
|
374 |
374 |
$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/output_filter/js/mdcr.js"></script>' ."\n";
|
375 |
375 |
}
|
376 |
376 |
|
fixed E_NOTICE warning with already defined module frontend constants