Changeset 766
- Timestamp:
- 06/23/07 03:53:26 (6 years ago)
- Location:
- coldbox/trunk/src/system
- Files:
-
- 3 modified
-
eventhandler.cfc (modified) (2 diffs)
-
frameworkSupertype.cfc (modified) (2 diffs)
-
plugins/renderer.cfc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coldbox/trunk/src/system/eventhandler.cfc
r650 r766 28 28 setController(arguments.controller); 29 29 //Inject user dependencies. 30 includeUDF( );30 includeUDF(getController().getSetting("UDFLibraryFile")); 31 31 return this; 32 32 </cfscript> … … 39 39 <!------------------------------------------- PRIVATE -------------------------------------------> 40 40 41 <!--- ************************************************************* --->42 43 <cffunction name="includeUDF" access="private" hint="Injects the UDF Library if found and exists. Called only by the framework." output="false" returntype="void">44 <!--- check if UDFLibraryFile is defined --->45 <cfif controller.getSetting("UDFLibraryFile") neq "">46 <!--- Check if file exists on app's includes --->47 <cfif fileExists("#controller.getSetting("ApplicationPath",1)#/#controller.getSetting("UDFLibraryFile")#")>48 <cfinclude template="/#controller.getSetting("AppMapping")#/#controller.getSetting("UDFLibraryFile")#">49 <cfelseif fileExists(ExpandPath("#controller.getSetting("UDFLibraryFile")#"))>50 <cfinclude template="#controller.getSetting("UDFLibraryFile")#">51 <cfelse>52 <cfthrow type="Framework.eventhandler.UDFLibraryNotFoundException" message="Error loading UDFLibraryFile. The file declared in the config.xml: #getSetting("UDFLibraryFile")# was not found in your application's include directory or in the following location: #ExpandPath(getSetting("UDFLibraryFile"))#. Please make sure you verify the file's location.">53 </cfif>54 </cfif>55 </cffunction>56 57 <!--- ************************************************************* --->58 59 41 </cfcomponent> -
coldbox/trunk/src/system/frameworkSupertype.cfc
r650 r766 96 96 </cffunction> 97 97 98 98 <!--- ************************************************************* ---> 99 100 99 101 <!------------------------------------------- FRAMEWORK FACADES -------------------------------------------> 100 102 … … 192 194 193 195 <!------------------------------------------- UTILITY METHODS -------------------------------------------> 194 196 197 <cffunction name="includeUDF" access="private" hint="Injects a UDF Library into the handler." output="false" returntype="void"> 198 <!--- ************************************************************* ---> 199 <cfargument name="udflibrary" required="true" type="string" hint="The UDF library to inject."> 200 <!--- ************************************************************* ---> 201 <cfset var UDFFullPath = ExpandPath(arguments.udflibrary)> 202 <cfset var UDFRelativePath = ExpandPath("/" & getController().getSetting("AppMapping") & "/" & arguments.udflibrary)> 203 204 <!--- check if UDFLibraryFile is defined ---> 205 <cfif arguments.udflibrary neq ""> 206 <!--- Check if file exists on declared relative ---> 207 <cfif fileExists(UDFRelativePath)> 208 <cfinclude template="/#getController().getSetting("appMapping")#/#arguments.udflibrary#"> 209 <cfelseif fileExists(UDFFullPath)> 210 <cfinclude template="#arguments.udflibrary#"> 211 <cfelse> 212 <cfthrow type="Framework.eventhandler.UDFLibraryNotFoundException" 213 message="Error loading UDFLibraryFile. The UDF library was not found in your application's include directory or in the location you specified: <strong>#UDFCheckPath#</strong>. Please make sure you verify the file's location."> 214 </cfif> 215 </cfif> 216 </cffunction> 217 195 218 <cffunction name="throw" access="private" hint="Facade for cfthrow" output="false"> 196 219 <!--- ************************************************************* ---> -
coldbox/trunk/src/system/plugins/renderer.cfc
r743 r766 47 47 48 48 <!--- Inject UDF For Views/Layouts ---> 49 <cfset includeUDF( )>49 <cfset includeUDF(getController().getSetting("UDFLibraryFile"))> 50 50 51 51 <cfreturn this> … … 132 132 <!------------------------------------------- PRIVATE -------------------------------------------> 133 133 134 <cffunction name="includeUDF" access="private" hint="UDF Mixin Injection. Called only by the framework." output="false" returntype="void">135 <!--- check if UDFLibraryFile is defined --->136 <cfif controller.getSetting("UDFLibraryFile") neq "">137 <!--- Check if file exists on app's includes --->138 <cfif fileExists("#controller.getSetting("ApplicationPath",1)#/#controller.getSetting("UDFLibraryFile")#")>139 <cfinclude template="/#getappMapping()#/#controller.getSetting("UDFLibraryFile")#">140 <cfelseif fileExists(ExpandPath("#controller.getSetting("UDFLibraryFile")#"))>141 <cfinclude template="#controller.getSetting("UDFLibraryFile")#">142 <cfelse>143 <cfthrow type="Framework.plugins.renderer.UDFLibraryNotFoundException" message="Error loading UDFLibraryFile. The file declared in the config.xml: #controller.getSetting("UDFLibraryFile")# was not found in your application's include directory or in the following location: #ExpandPath(controller.getSetting("UDFLibraryFile"))#. Please make sure you verify the file's location.">144 </cfif>145 </cfif>146 </cffunction>147 148 134 <!--- ************************************************************* ---> 149 135
