Index: Framework.Class.Context.php
===================================================================
--- Framework.Class.Context.php	(revision 171)
+++ Framework.Class.Context.php	(working copy)
@@ -151,7 +151,18 @@
 		$this->CommentFormats[] = 'Text';
 
 		// Create an object factory
-		$this->ObjectFactory = new ObjectFactory();
+		$this->ObjectFactory = new ObjectFactory($Configuration);
+		foreach ($Configuration as $Key => $Value) {
+			$Prefix = 'OBJECT_FACTORY_REFERENCE_';
+			$Key = trim($Key);
+			if (strpos($Key, $Prefix) === 0) {
+				$Key = str_replace($Prefix, '', $Key);
+				$Key = str_replace('_', ' ', $Key);
+				$Key = ucwords(strtolower($Key));
+				$Key = str_replace(' ', '', $Key);
+				$this->ObjectFactory->SetReference($Key, $Value);
+			}
+		}
 
 		// Current Mode
 		$this->Mode = ForceIncomingCookieString('Mode', '');
Index: Framework.Class.ObjectFactory.php
===================================================================
--- Framework.Class.ObjectFactory.php	(revision 170)
+++ Framework.Class.ObjectFactory.php	(working copy)
@@ -30,6 +30,7 @@
  */
 class ObjectFactory {
 	var $ClassIndex;        // An array containing name/value pairs mapping labels to class names
+	var $Path;
 
 	// Private (used internally - should use NewObject or NewContextObject externally)
 	function CreateObject(&$Context, $ClassLabel, $IsContextObject, $Param1 = '', $Param2 = '', $Param3 = '', $Param4 = '', $Param5 = '', $Param6 = '', $Param7 = '', $Param8 = '', $Param9 = '', $Param10 = '') {
@@ -40,14 +41,17 @@
 			$ClassName = $this->ClassIndex[$ClassLabel];
 		}
 		if (!class_exists($ClassName)) {
+			$Found = false;
 			$PrefixArray = $Context->Configuration['LIBRARY_NAMESPACE_ARRAY'];
-			$PrefixArrayCount = count($PrefixArray);
-			$i = 0;
-			for ($i = 0; $i < $PrefixArrayCount; $i++) {
-				$File = $Context->Configuration['LIBRARY_PATH'].$PrefixArray[$i].'/'.$PrefixArray[$i].'.Class.'.$ClassName.'.php';
-				if (file_exists($File)) {
-					include($File);
-					break;
+			$Path = $this->Path;
+			for ($i=0, $PaCount=count($Path); $i < $PaCount && !$Found; $i++) {
+				for ($j = 0, $PrCount=count($PrefixArray); $j < $PrCount && !$Found; $j++) {
+					$File = $Path[$i] . '/' . $PrefixArray[$j]
+						. '/'. $PrefixArray[$j] . '.Class.' . $ClassName . '.php';
+					$Found = file_exists($File);
+					if ($Found) {
+						include($File);
+					}
 				}
 			}
 
@@ -69,14 +73,17 @@
 			$ClassName = $this->ClassIndex[$ClassLabel];
 		}
 		if (!class_exists($ClassName)) {
+			$Found = false;
 			$PrefixArray = $Context->Configuration['LIBRARY_NAMESPACE_ARRAY'];
-			$PrefixArrayCount = count($PrefixArray);
-			$i = 0;
-			for ($i = 0; $i < $PrefixArrayCount; $i++) {
-				$File = $Context->Configuration['LIBRARY_PATH'].$PrefixArray[$i].'/'.$PrefixArray[$i].'.Control.'.$ClassName.'.php';
-				if (file_exists($File)) {
-					include($File);
-					break;
+			$Path = $this->Path;
+			for ($i=0, $PaCount=count($Path); $i < $PaCount && !$Found; $i++) {
+				for ($j = 0, $PrCount=count($PrefixArray); $j < $PrCount && !$Found; $j++) {
+					$File = $Path[$i] . '/' . $PrefixArray[$j]
+						. '/'. $PrefixArray[$j] . '.Control.' . $ClassName . '.php';
+					$Found = file_exists($File);
+					if ($Found) {
+						include($File);
+					}
 				}
 			}
 			// If it failed to find the class, throw a fatal error
@@ -97,9 +104,13 @@
 		return $this->CreateObject($Context, $ClassLabel, 0, $Param1, $Param2, $Param3, $Param4, $Param5, $Param6, $Param7, $Param8, $Param9, $Param10);
 	}
 
-	function ObjectFactory () {
+	function ObjectFactory ($Configuration = array()) {
 		$this->ClassIndex = array();
 		$this->ControlStrings = array();
+		if (!$Configuration) {
+			global $Configuration;
+		}
+		$this->SetPath($Configuration);
 	}
 
 	// For debugging, allow the current references to be written
@@ -108,6 +119,21 @@
 			echo('<div>'.$Label.': '.$Name.'</div>');
 		}
 	}
+	
+	function SetPath($Configuration) {
+		$Path = ForceString($Configuration['LIBRARY_INCLUDE_PATH'], '%LIBRARY%');
+		$Path = explode(';', $Path);
+		for($i=0, $count=count($Path); $i < $count; $i++) {
+			$Path[$i] = str_replace(
+				array('%LIBRARY%', '%APPLICATION%', '%EXTENSIONS%'),
+				array(
+					$Configuration['LIBRARY_PATH'],
+					$Configuration['APPLICATION_PATH'],
+					$Configuration['EXTENSIONS_PATH']),
+				$Path[$i]);
+		}
+		$this->Path = $Path;
+	}
 
 	function SetReference($ClassLabel, $ClassName = '') {
 		if ($ClassName == '') $ClassName = $ClassLabel;
