Project

General

Profile

« Previous | Next » 

Revision 1443

Added by Dietmar about 13 years ago

remove auto including YUI Framework in backend for modules, enable with >print_footer(true)
>print_error and ->print_success too accept a message as array
auto validate in frontend if style block inside body tag
captcha now XHTML valide

View differences:

frontend.functions.php
593 593
    }
594 594
}
595 595

  
596
	function moveCssToHead($content) {
597
		// move css definitions into head section
598
		$pattern1 = '/(?:.*?<body.*?)(<link[^>]*?\"text\/css\".*?\/>)(?:.*)/si';
599
		$pattern2 = '/(?:.*?<body.*?)(<style[^>]*?\"text\/css\"[^>]*?>.*?<\/style>)(?:.*)/si';
600
		$insert1 = array();
601
		$insert2 = array();
602
		if(preg_match_all($pattern1, $content, $matches)) {
603
			$insert1 = $matches[1];
604
			$content = str_replace($insert1, '', $content);
605
		}
606
		if(preg_match_all($pattern2, $content, $matches)) {
607
			$insert2 = $matches[1];
608
			$content = str_replace($insert2, '', $content);
609
		}
610
		$insert = array_merge($insert1, $insert2);
611
		$insert = "\n".implode("\n", $insert)."\n</head>\n<body";
612
		$content = preg_replace('/<\/head>.*?<body/si', $insert, $content);
613
		return $content;
614
	}
615

  
596 616
// Begin WB < 2.4.x template compatibility code
597 617
	// Make extra_sql accessable through private_sql
598 618
	$private_sql = $extra_sql;
......
610 630
// End WB < 2.4.x template compatibility code
611 631
// Include template file
612 632

  
613

  
614
?>

Also available in: Unified diff