Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 525)
+++ trunk/CHANGELOG	(revision 526)
@@ -11,6 +11,10 @@
 ! = Update/Change
 
 ------------------------------------- 2.7.0 -------------------------------------
+11-Jan-2008 Christian Sommer
+!	Updated function: register_frontend_modfiles in /framework/frontend.functions.php
+	(added constants MOD_FRONTEND_CSS_REGISTERED, MOD_FRONTEND_JAVASCRIPT_REGISTERED)
+
 11-Jan-2008 Matthias Gallas
 !	Update codepress to Version 0.9.6
 !	Update phplib to Version 7.4a
Index: trunk/wb/framework/frontend.functions.php
===================================================================
--- trunk/wb/framework/frontend.functions.php	(revision 525)
+++ trunk/wb/framework/frontend.functions.php	(revision 526)
@@ -312,7 +312,7 @@
 		// define default baselink and filename for optional module javascript and stylesheet files
 		$head_links = "";
 		if($file_id == "css") {
-      	$base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
+      $base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
 			$base_link.= ' rel="stylesheet" type="text/css" media="screen" />';
 			$base_file = "frontend.css";
 		} else {
@@ -320,23 +320,31 @@
 			$base_file = "frontend.js";
 		}
 
-  		// gather information for all models embedded on actual page
+  	// gather information for all models embedded on actual page
 		$page_id = $wb->page_id;
-    	$query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
+    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
 			WHERE page_id=$page_id AND module<>'wysiwyg'");
 
-    	while($row = $query_modules->fetchRow()) {
+    while($row = $query_modules->fetchRow()) {
 			// check if page module directory contains a frontend.js or frontend.css file
-      	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
+    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
 				// create link with frontend.js or frontend.css source for the current module
 				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
-        		// ensure that frontend.js or frontend.css is only added once per module type
-        		if(strpos($head_links, $tmp_link) === false) {
+
+        // define constant indicating that the register_frontent_files was invoked
+				if($file_id == 'css') {
+					define('MOD_FRONTEND_CSS_REGISTERED', true);
+				} else {
+					define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
+				}
+
+        // ensure that frontend.js or frontend.css is only added once per module type
+        if(strpos($head_links, $tmp_link) === false) {
 					$head_links .= $tmp_link ."\n";
 				}
 			}
-    	}
-  		// write out links with all external module javascript/CSS files, remove last line feed
+    }
+  	// write out links with all external module javascript/CSS files, remove last line feed
 		echo $head_links;
 	}
 }
