Project

General

Profile

« Previous | Next » 

Revision 1250

Added by Dietmar over 14 years ago

fixed snippets including frontend.css and frontend.js without register_frontend_modfiles

View differences:

frontend.functions.php
512 512
    		while($row = $query_modules->fetchRow())
513 513
            {
514 514
    			// check if page module directory contains a frontend_body.js file
515
    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
515
    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
516
                {
516 517
    			// create link with frontend_body.js source for the current module
517 518
    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
518 519

  
519 520
    				// define constant indicating that the register_frontent_files_body was invoked
520
    					if(!defined('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED')) define('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED', true);
521
    					if(!defined('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED')) { define('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED', true);}
521 522

  
522 523
    				// ensure that frontend_body.js is only added once per module type
523
    				if(strpos($body_links, $tmp_link) === false) {
524
    				if(strpos($body_links, $tmp_link) === false)
525
                    {
524 526
    					$body_links .= $tmp_link;
525 527
    				}
526 528
    			}
......
576 578
            break;
577 579
		}
578 580

  
579
		if(!empty($include_head_link_css)) {
580
			if(strpos($head_links, $include_head_link_css) === false) {
581
				$head_links .= $include_head_link_css;
582
			}
583
			$include_head_link_css = '';
584
		} else {
585
			if(!empty($include_head_links)) {
586
				if(strpos($head_links, $include_head_links) === false) {
587
					$head_links .= $include_head_links;
588
				}
589
				$include_head_links = '';
590
			}
591
		}
592

  
593 581
        if( $file_id != 'jquery')
594 582
        {
595

  
596 583
    		// gather information for all models embedded on actual page
597 584
    		$page_id = $wb->page_id;
598 585
    		$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections

Also available in: Unified diff