Changeset 1700
- Timestamp:
- 08/14/08 15:19:24 (5 months ago)
- Files:
-
- coldbox/trunk/CodeDepot/projects/sidebar/includes/coldboxsidebar/ColdBoxSideBar.cfm (modified) (2 diffs)
- coldbox/trunk/CodeDepot/projects/sidebar/includes/coldboxsidebar/ColdBoxSideBar.xml.cfm (modified) (2 diffs)
- coldbox/trunk/CodeDepot/projects/sidebar/interceptors/coldboxSideBar.cfc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
coldbox/trunk/CodeDepot/projects/sidebar/includes/coldboxsidebar/ColdBoxSideBar.cfm
r1692 r1700 12 12 -----------------------------------------------------------------------> 13 13 14 <cfhtmlhead text='<script language="javascript" src="includes/coldboxsidebar/_ColdBoxSideBar.js" type="text/javascript"></script>' /> 15 <cfhtmlhead text='<link rel="stylesheet" href="#getproperty('cssPath')#" type="text/css" media="screen">' /> 16 14 <cfhtmlhead text='<script language="javascript" src="#TRIM(getproperty('jsPath'))#" type="text/javascript"></script>' /> 15 <cfhtmlhead text='<link rel="stylesheet" href="#TRIM(getproperty('cssPath'))#" type="text/css" media="screen">' /> 17 16 <cfoutput> 17 <!-- 18 ColdBox SideBar: created on 7/31/2008 by Ernst van der Linden (evdlinden@gmail.com | http://evdlinden.behindthe.net) 19 --> 18 20 <div id="ColdBoxSideBarContainer" style="visibility:hidden;position:absolute;left:0px;top:#getproperty('yOffset')#px;z-index:9999;width:#getproperty('width')#px"> 19 21 <div id="ColdBoxSideBar" style="position:absolute;left:-#( getproperty('invisibleWidth'))#px;top:0;z-Index:9999;" onmouseover="coldBoxSideBar.moveOut()" onmouseout="coldBoxSideBar.moveBack()"> … … 22 24 <tr> 23 25 <td class="ColdBoxSideBarTop" width="#getproperty('invisibleWidth')#" nowrap><h1>Settings</h1></td> 24 <td background="" rowspan="#(12 + ArrayLen(local.links))#" width="#getproperty('visibleWidth')#" nowrap class="ColdBoxSideBarImgBar" valign="#getproperty('imageVAlign')#" align="left"><img src="# getproperty('imagePath')#" width="22" height="160" border="0" /></td>26 <td background="" rowspan="#(12 + ArrayLen(local.links))#" width="#getproperty('visibleWidth')#" nowrap class="ColdBoxSideBarImgBar" valign="#getproperty('imageVAlign')#" align="left"><img src="#TRIM(getproperty('imagePath'))#" width="22" height="160" border="0" /></td> 25 27 </tr> 26 28 <tr> coldbox/trunk/CodeDepot/projects/sidebar/includes/coldboxsidebar/ColdBoxSideBar.xml.cfm
r1691 r1700 7 7 Modification History: 8 8 08/12/2008 evdlinden : isScroll property implemented. SideBar changed to ColdBoxSideBar: css, image 9 08/14/2008 evdlinden : imgPath,cssPAth and jsPath now in interceptor. 9 10 --> 10 11 <Sidebar> … … 42 43 <Property name="visibleWidth">12</Property> 43 44 44 <!--Full path from the application's root. -->45 <Property name="imagePath">includes/coldboxsideBar/ColdBoxSideBar.png</Property>46 47 45 <!-- Vertical alignment of the image: top,middle or bottom --> 48 46 <Property name="imageVAlign">middle</Property> 49 47 50 <!-- Full path from the application's root-->51 <Property name=" cssPath">includes/coldboxsidebar/_ColdBoxSideBar.css</Property>52 48 <!-- includes directory: normally /coldbox/includes/coldboxsidebar/ --> 49 <Property name="includesDirectory">/sidebar/includes/coldboxsidebar/</Property> 50 53 51 </Properties> 54 52 </Sidebar> coldbox/trunk/CodeDepot/projects/sidebar/interceptors/coldboxSideBar.cfc
r1691 r1700 21 21 // Read SideBar XML 22 22 readSideBarXML(); 23 // Set css default path 24 setPropertyDefault('cssPath','#CGI.SCRIPT_NAME#?sbContent=css'); 25 // Set image default path 26 setPropertyDefault('imagePath','#CGI.SCRIPT_NAME#?sbContent=img'); 27 // Set js path 28 setProperty( 'jsPath', '#CGI.SCRIPT_NAME#?sbContent=js' ); 29 30 // URL params which are used by the sideBar 31 setProperty( 'urlParamNameList', "fwreinit,debugmode,dumpVar,sbIsClearCache,sbClearScope,sbIsClearLog,sbIsEnabled"); 23 32 24 33 /* Start processing properties */ … … 48 57 setProperty( 'imagePath', getPropertyDefault('imagePath') ); 49 58 } 59 if( not propertyExists('imageVAlign') or not ListFindNoCase('top,middle,bottom', getproperty('imageVAlign') ) ){ 60 setProperty( 'imageVAlign', getPropertyDefault('imageVAlign') ); 61 } 50 62 if( not propertyExists('cssPath') or not REFindNoCase("[A-Z]",getproperty('cssPath')) ){ 51 63 setProperty( 'cssPath', getPropertyDefault('cssPath') ); 52 }53 if( not propertyExists('imageVAlign') or not ListFindNoCase('top,middle,bottom', getproperty('imageVAlign') ) ){54 setProperty( 'imageVAlign', getPropertyDefault('imageVAlign') );55 64 } 56 65 // Calculate and set invisible width 57 66 setProperty( 'invisibleWidth', ( getproperty('width') - getproperty('visibleWidth') ) ); 58 67 59 // URL params which are used by the sideBar60 setProperty( 'urlParamNameList', "fwreinit,debugmode,dumpVar,sbIsClearCache,sbClearScope,sbIsClearLog,sbIsEnabled");61 62 68 </cfscript> 63 69 </cffunction> … … 65 71 <!------------------------------------------- INTERCEPTION POINTS -------------------------------------------> 66 72 67 <cffunction name="afterAspectsLoad" access="public" returntype="void" output=" false">73 <cffunction name="afterAspectsLoad" access="public" returntype="void" output="true"> 68 74 <cfargument name="event" required="true" type="coldbox.system.beans.requestContext"> 69 75 70 76 <cfset var rc = event.getCollection()> 71 77 <cfset var contentType = ''> 78 <cfset var fileContent = ''> 79 <cfset var filePath = ''> 80 72 81 <!--- Set isEnabled property after environmentControl interception ---> 73 82 <cfif not settingExists('ColdBoxSideBar') or not isBoolean( getSetting('ColdBoxSideBar') )> … … 83 92 84 93 <cfset var rc = event.getCollection()> 94 95 <!--- Get Content(js,css,img) of SideBar? ---> 96 <cfif settingExists('ColdBoxSideBar') AND isBoolean( getSetting('ColdBoxSideBar') ) AND getSetting('ColdBoxSideBar') AND ListFindNoCase("css,js,img",event.getValue('sbContent',''))> 97 <!--- Get binary content ---> 98 <cfswitch expression="#rc.sbContent#"> 99 <cfcase value="css"> 100 <cfset contentType = 'text/css'> 101 <cfset filePath = ExpandPath( getPropertyDefault('includesDirectory') & '_ColdBoxSideBar.css')> 102 </cfcase> 103 <cfcase value="js"> 104 <cfset contentType = 'text/js'> 105 <cfset filePath = ExpandPath( getPropertyDefault('includesDirectory') & '_ColdBoxSideBar.js')> 106 </cfcase> 107 <cfcase value="img"> 108 <cfset contentType = 'image/png'> 109 <cfset filePath = ExpandPath( getPropertyDefault('includesDirectory') & 'ColdBoxSideBar.png')> 110 </cfcase> 111 </cfswitch> 112 <!--- Output binary file content ---> 113 <cfcontent type="#contentType#" variable="#getFileContent(filePath,true)#"> 114 <cfabort> 115 </cfif> 85 116 86 117 <!--- Enable/disable the sidebar through url? Has been enabled in config? ---> … … 248 279 </cffunction> 249 280 281 <cffunction name="getFileContent" access="private" returntype="any"> 282 <cfargument name="filePath" type="string" required="true"> 283 <cfargument name="isBinary" type="boolean" default="false" required="false"> 284 285 <cfset var fileContent = ''> 286 <cfset var readType = 'read'> 287 288 <!--- Binary read? ---> 289 <cfif arguments.isBinary> 290 <cfset readType = 'readbinary'> 291 </cfif> 292 293 <!--- Absolute filePath? ---> 294 295 <!--- read the file binary data ---> 296 <cffile action="#readType#" file="#arguments.filePath#" variable="fileContent"> 297 298 <cfreturn fileContent> 299 </cffunction> 300 250 301 </cfcomponent>
