Project

General

Profile

« Previous | Next » 

Revision 1368

Added by Dietmar over 13 years ago

delete class.secureform.php
add newest SecureForm
fixed Call to a member function read() on a non-object in function register_frontend_modfiles

View differences:

frontend.functions.php
474 474

  
475 475
    		// gather information for all models embedded on actual page
476 476
    		$page_id = $wb->page_id;
477
    		$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections
478
    				WHERE page_id=$page_id AND module<>'wysiwyg'");
477
			$sql = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
478
			$sql .= 'WHERE `page_id` = '.(int)$page_id.' AND `module` <> \'wysiwyg\'';
479
    		if( ($query_modules = $database->query($sql)) )
480
			{
481
	    		while($row = $query_modules->fetchRow())
482
	            {
483
	    			// check if page module directory contains a frontend_body.js file
484
	    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
485
	                {
486
	    			// create link with frontend_body.js source for the current module
487
	    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
479 488

  
480
    		while($row = $query_modules->fetchRow())
481
            {
482
    			// check if page module directory contains a frontend_body.js file
483
    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
484
                {
485
    			// create link with frontend_body.js source for the current module
486
    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
489
	    				// define constant indicating that the register_frontent_files_body was invoked
490
	    					if(!defined('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED')) { define('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED', true);}
487 491

  
488
    				// define constant indicating that the register_frontent_files_body was invoked
489
    					if(!defined('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED')) { define('MOD_FRONTEND_BODY_JAVASCRIPT_REGISTERED', true);}
490

  
491
    				// ensure that frontend_body.js is only added once per module type
492
    				if(strpos($body_links, $tmp_link) === false)
493
                    {
494
    					$body_links .= $tmp_link;
495
    				}
496
    			}
497
    		}
492
	    				// ensure that frontend_body.js is only added once per module type
493
	    				if(strpos($body_links, $tmp_link) === false)
494
	                    {
495
	    					$body_links .= $tmp_link;
496
	    				}
497
	    			}
498
	    		}
499
            }
498 500
        }
499 501

  
500 502
		print $body_links."\n"; ;
......
550 552
        {
551 553
    		// gather information for all models embedded on actual page
552 554
    		$page_id = $wb->page_id;
553
    		$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections
554
    				WHERE page_id=$page_id AND module<>'wysiwyg'");
555
			$sql = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
556
			$sql .= 'WHERE `page_id` = '.(int)$page_id.' AND `module` <> \'wysiwyg\'';
557
    		if( ($query_modules = $database->query($sql)) )
558
			{
559
	    		while($row = $query_modules->fetchRow())
560
	            {
561
	    			// check if page module directory contains a frontend.js or frontend.css file
562
	    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
563
	                {
564
	    			// create link with frontend.js or frontend.css source for the current module
565
	    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
555 566

  
556
    		while($row = $query_modules->fetchRow())
557
            {
558
    			// check if page module directory contains a frontend.js or frontend.css file
559
    			if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file"))
560
                {
561
    			// create link with frontend.js or frontend.css source for the current module
562
    				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
563

  
564
    				// define constant indicating that the register_frontent_files was invoked
565
    				if($file_id == 'css')
566
                    {
567
    					if(!defined('MOD_FRONTEND_CSS_REGISTERED')) define('MOD_FRONTEND_CSS_REGISTERED', true);
568
    				} else
569
                    {
570
    					if(!defined('MOD_FRONTEND_JAVASCRIPT_REGISTERED')) define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
571
    				}
572
    				// ensure that frontend.js or frontend.css is only added once per module type
573
    				if(strpos($head_links, $tmp_link) === false)
574
                    {
575
    					$head_links .= $tmp_link."\n";
576
    				}
577
    			};
578
    		}
579
        		// include the Javascript email protection function
580
        		if( $file_id != 'css' && file_exists(WB_PATH .'/modules/droplets/js/mdcr.js'))
581
                {
582
        			$head_links .= '<script src="'.WB_URL.'/modules/droplets/js/mdcr.js" type="text/javascript"></script>'."\n";
583
        		}
584
                elseif( $file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js'))
585
                {
586
        			$head_links .= '<script src="'.WB_URL.'/modules/output_filter/js/mdcr.js" type="text/javascript"></script>'."\n";
587
        		}
567
	    				// define constant indicating that the register_frontent_files was invoked
568
	    				if($file_id == 'css')
569
	                    {
570
	    					if(!defined('MOD_FRONTEND_CSS_REGISTERED')) define('MOD_FRONTEND_CSS_REGISTERED', true);
571
	    				} else
572
	                    {
573
	    					if(!defined('MOD_FRONTEND_JAVASCRIPT_REGISTERED')) define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
574
	    				}
575
	    				// ensure that frontend.js or frontend.css is only added once per module type
576
	    				if(strpos($head_links, $tmp_link) === false)
577
	                    {
578
	    					$head_links .= $tmp_link."\n";
579
	    				}
580
	    			};
581
	    		}
582
			}
583
       		// include the Javascript email protection function
584
       		if( $file_id != 'css' && file_exists(WB_PATH .'/modules/droplets/js/mdcr.js'))
585
               {
586
       			$head_links .= '<script src="'.WB_URL.'/modules/droplets/js/mdcr.js" type="text/javascript"></script>'."\n";
587
       		}
588
               elseif( $file_id != 'css' && file_exists(WB_PATH .'/modules/output_filter/js/mdcr.js'))
589
               {
590
       			$head_links .= '<script src="'.WB_URL.'/modules/output_filter/js/mdcr.js" type="text/javascript"></script>'."\n";
591
       		}
588 592
        }
589 593
        print $head_links;
590 594
    }

Also available in: Unified diff