Project

General

Profile

« Previous | Next » 

Revision 576

Added by doc almost 17 years ago

Added the new admin tool email output filter which allows to transform emails before displaying them on the frontend

View differences:

frontend.functions.php
346 346
			$base_file = "frontend.js";
347 347
		}
348 348

  
349
  	// gather information for all models embedded on actual page
349
  		// gather information for all models embedded on actual page
350 350
		$page_id = $wb->page_id;
351
    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
351
    	$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
352 352
			WHERE page_id=$page_id AND module<>'wysiwyg'");
353 353

  
354
    while($row = $query_modules->fetchRow()) {
354
    	while($row = $query_modules->fetchRow()) {
355 355
			// check if page module directory contains a frontend.js or frontend.css file
356
    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
356
    		if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
357 357
				// create link with frontend.js or frontend.css source for the current module
358 358
				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
359 359

  
360
        // define constant indicating that the register_frontent_files was invoked
360
        		// define constant indicating that the register_frontent_files was invoked
361 361
				if($file_id == 'css') {
362 362
					define('MOD_FRONTEND_CSS_REGISTERED', true);
363 363
				} else {
364 364
					define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
365 365
				}
366 366

  
367
        // ensure that frontend.js or frontend.css is only added once per module type
368
        if(strpos($head_links, $tmp_link) === false) {
367
        		// ensure that frontend.js or frontend.css is only added once per module type
368
        		if(strpos($head_links, $tmp_link) === false) {
369 369
					$head_links .= $tmp_link ."\n";
370 370
				}
371 371
			}
372
    }
373
  	// write out links with all external module javascript/CSS files, remove last line feed
372
    	}
373
  		// include the Javascript email protection function
374
  		if($file_id != 'css' && file_exists(WB_PATH .'/modules/mail_filter/js/mdcr.js')) {
375
			$head_links .= '<script type="text/javascript" src="'.WB_URL.'/modules/mail_filter/js/mdcr.js"></script>' ."\n";
376
		}
377
  		
378
		// write out links with all external module javascript/CSS files, remove last line feed
374 379
		echo $head_links;
375 380
	}
376 381
}

Also available in: Unified diff