Changeset 2440


Ignore:
Timestamp:
06/28/10 17:10:50 (20 months ago)
Author:
mattlevine
Message:
  1. Adding the ability to have theme local contentRenderer.cfc files.
  2. Adding the mura scope as an init argument to contentRenderer.cfc
  3. Adding hasParent() to beans that have path attribute.
Location:
trunk/www
Files:
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/www/requirements/mura/Handler/standardSetContentHandler.cfc

    r2098 r2440  
    2626         
    2727        <cfset var renderer=event.getValue("contentRenderer")> 
     28        <cfset var themeRenderer=event.getValue("themeRenderer")> 
    2829         
    2930        <cfif event.valueExists('previewID')> 
     
    4445         
    4546        <cfset renderer.crumbdata=event.getValue("crumbdata")> 
     47         
     48        <cfif isObject(themeRenderer)> 
     49                <cfset themeRenderer.crumbdata=event.getValue("crumbdata")> 
     50        </cfif> 
    4651</cffunction> 
    4752 
  • trunk/www/requirements/mura/Handler/standardSetContentRendererHandler.cfc

    r2098 r2440  
    2424<cffunction name="handle" output="false" returnType="any"> 
    2525        <cfargument name="event" required="true"> 
    26          
    27         <cfset event.setValue('contentRenderer',createObject("component","#event.getSite().getAssetMap()#.includes.contentRenderer").init(event))/> 
    28  
     26        <cfset var $=event.getValue("muraScope")> 
     27        <cfset event.setValue('contentRenderer',createObject("component","#event.getSite().getAssetMap()#.includes.contentRenderer").init(event=event,$=$,mura=$))/> 
     28        <cfif fileExists(expandPath(event.getSite().getThemeIncludePath()) & "/contentRenderer.cfc")> 
     29                <cfset event.setValue("themeRenderer",createObject("component","#event.getSite().getThemeAssetMap()#.contentRenderer").init(event=event,$=$,mura=$))> 
     30        </cfif> 
    2931</cffunction> 
    3032 
  • trunk/www/requirements/mura/MuraScope.cfc

    r2419 r2440  
    2121        </cfif> 
    2222        <cfreturn this> 
     23</cffunction> 
     24 
     25<cffunction name="OnMissingMethod" access="public" returntype="any" output="false" hint="Handles missing method exceptions."> 
     26<cfargument name="MissingMethodName" type="string" required="true" hint="The name of the missing method." /> 
     27<cfargument name="MissingMethodArguments" type="struct" required="true"/> 
     28        <cfset var local=structNew()> 
     29        <cfset var object=""> 
     30         
     31        <cfif len(MissingMethodName)> 
     32                 
     33                <cfif isObject(getEvent()) and structKeyExists(variables.instance.event,MissingMethodName)> 
     34                        <cfset object=variables.instance.event> 
     35                <cfelseif isObject(getThemeRenderer()) and structKeyExists(getThemeRenderer(),MissingMethodName)> 
     36                        <cfset object=getThemeRenderer()> 
     37                <cfelseif isObject(getContentRenderer()) and structKeyExists(getContentRenderer(),MissingMethodName)> 
     38                        <cfset object=getContentRenderer()> 
     39                <cfelseif isObject(getContentBean()) and structKeyExists(getContentBean(),MissingMethodName)> 
     40                        <cfset object=getContentBean()> 
     41                <cfelse> 
     42                        <cfthrow message="The method '#arguments.MissingMethodName#' is not defined"> 
     43                </cfif> 
     44         
     45                <cfsavecontent variable="local.thevalue2"> 
     46                <cfif not structIsEmpty(MissingMethodArguments)> 
     47                        <cfinvoke component="#object#" method="#MissingMethodName#" argumentcollection="#MissingMethodArguments#" returnvariable="local.theValue1"> 
     48                <cfelse> 
     49                        <cfinvoke component="#object#" method="#MissingMethodName#" returnvariable="local.theValue1"> 
     50                </cfif> 
     51                </cfsavecontent> 
     52                 
     53                <cfif isDefined("local.theValue1")> 
     54                        <cfreturn local.theValue1> 
     55                <cfelseif isDefined("local.theValue2")> 
     56                        <cfreturn local.theValue2> 
     57                <cfelse> 
     58                        <cfreturn ""> 
     59                </cfif> 
     60        <cfelse> 
     61                <cfreturn ""> 
     62        </cfif> 
    2363</cffunction> 
    2464 
     
    2868                        <cfset event("contentRenderer",request.contentRenderer)> 
    2969                <cfelseif len(event('siteid'))> 
    30                         <cfset event("contentRenderer",createObject("component","#siteConfig().getAssetMap()#.contentRenderer").init(event))> 
     70                        <cfset event("contentRenderer",createObject("component","#siteConfig().getAssetMap()#.contentRenderer").init(event=event,$=event("muraScope"),mura=event("muraScope") ) )> 
    3171                <cfelseif structKeyExists(application,"contentRenderer")> 
    3272                        <cfset event("contentRenderer",application.contentRenderer)> 
     
    4080        <cfif isObject(arguments.contentRenderer)> 
    4181                <cfset event("contentRenderer",arguments.contentRenderer)> 
     82        </cfif> 
     83        <cfreturn this> 
     84</cffunction> 
     85 
     86<cffunction name="getThemeRenderer" output="false" returntype="any"> 
     87        <cfif isObject(event("themeRenderer"))> 
     88                <cfreturn event("themeRenderer")> 
     89        <cfelseif len(event('siteid')) and fileExists(expandPath(siteConfig().getThemeIncludePath()) & "/contentRenderer.cfc" )> 
     90                <cfset event("themeRenderer",createObject("component","#siteConfig().getThemeAssetMap()#.contentRenderer").init(event=event,$=event("muraScope"),mura=event("muraScope") ) )> 
     91        <cfelse> 
     92                <cfreturn event("themeRenderer")> 
     93        </cfif> 
     94</cffunction> 
     95 
     96<cffunction name="setThemeRenderer" output="false" returntype="any"> 
     97        <cfargument name="themeRenderer"> 
     98        <cfif isObject(arguments.themeRenderer)> 
     99                <cfset event("themeRenderer",arguments.themeRenderer)> 
    42100        </cfif> 
    43101        <cfreturn this> 
     
    83141        </cfif> 
    84142        <cfreturn this> 
    85 </cffunction> 
    86  
    87 <cffunction name="OnMissingMethod" access="public" returntype="any" output="false" hint="Handles missing method exceptions."> 
    88 <cfargument name="MissingMethodName" type="string" required="true" hint="The name of the missing method." /> 
    89 <cfargument name="MissingMethodArguments" type="struct" required="true"/> 
    90         <cfset var local=structNew()> 
    91         <cfset var object=""> 
    92          
    93         <cfif len(MissingMethodName)> 
    94                  
    95                 <cfif isObject(getEvent()) and structKeyExists(variables.instance.event,MissingMethodName)> 
    96                         <cfset object=variables.instance.event> 
    97                 <cfelseif isObject(getContentRenderer()) and structKeyExists(getContentRenderer(),MissingMethodName)> 
    98                         <cfset object=getContentRenderer()> 
    99                 <cfelseif isObject(getContentBean()) and structKeyExists(getContentBean(),MissingMethodName)> 
    100                         <cfset object=getContentBean()> 
    101                 <cfelse> 
    102                         <cfthrow message="The method '#arguments.MissingMethodName#' is not defined"> 
    103                 </cfif> 
    104          
    105                 <cfsavecontent variable="local.thevalue2"> 
    106                 <cfif not structIsEmpty(MissingMethodArguments)> 
    107                         <cfinvoke component="#object#" method="#MissingMethodName#" argumentcollection="#MissingMethodArguments#" returnvariable="local.theValue1"> 
    108                 <cfelse> 
    109                         <cfinvoke component="#object#" method="#MissingMethodName#" returnvariable="local.theValue1"> 
    110                 </cfif> 
    111                 </cfsavecontent> 
    112                  
    113                 <cfif isDefined("local.theValue1")> 
    114                         <cfreturn local.theValue1> 
    115                 <cfelseif isDefined("local.theValue2")> 
    116                         <cfreturn local.theValue2> 
    117                 <cfelse> 
    118                         <cfreturn ""> 
    119                 </cfif> 
    120         <cfelse> 
    121                 <cfreturn ""> 
    122         </cfif> 
    123143</cffunction> 
    124144 
  • trunk/www/requirements/mura/category/categoryBean.cfc

    r2326 r2440  
    77Mura CMS is distributed in the hope that it will be useful, 
    88but WITHOUT ANY WARRANTY; without even the implied warranty of 
    9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ᅵSee the 
    1010GNU General Public License for more details. 
    1111 
    1212You should have received a copy of the GNU General Public License 
    13 along with Mura CMS.  If not, see <http://www.gnu.org/licenses/>. 
     13along with Mura CMS. ᅵIf not, see <http://www.gnu.org/licenses/>. 
    1414 
    1515Linking Mura CMS statically or dynamically with other modules constitutes 
    1616the preparation of a derivative work based on Mura CMS. Thus, the terms and      
    17 conditions of the GNU General Public License version 2 (“GPL”) cover the entire combined work. 
     17conditions of the GNU General Public License version 2 (ᅵGPLᅵ) cover the entire combined work. 
    1818 
    1919However, as a special exception, the copyright holders of Mura CMS grant you permission 
    2020to combine Mura CMS with programs or libraries that are released under the GNU Lesser General Public License version 2.1. 
    2121 
    22 In addition, as a special exception,  the copyright holders of Mura CMS grant you permission 
    23 to combine Mura CMS  with independent software modules that communicate with Mura CMS solely 
     22In addition, as a special exception, ᅵthe copyright holders of Mura CMS grant you permission 
     23to combine Mura CMS ᅵwith independent software modules that communicate with Mura CMS solely 
    2424through modules packaged as Mura CMS plugins and deployed through the Mura CMS plugin installation API, 
    25 provided that these modules (a) may only modify the  /trunk/www/plugins/ directory through the Mura CMS 
     25provided that these modules (a) may only modify the ᅵ/trunk/www/plugins/ directory through the Mura CMS 
    2626plugin installation API, (b) must not alter any default objects in the Mura CMS database 
    2727and (c) must not alter any files in the following directories except in cases where the code contains 
     
    3838For clarity, if you create a modified version of Mura CMS, you are not obligated to grant this special exception 
    3939for your modified version; it is your choice whether to do so, or to make such modified version available under 
    40 the GNU General Public License version 2  without this exception.  You may, if you choose, apply this exception 
     40the GNU General Public License version 2 ᅵwithout this exception. ᅵYou may, if you choose, apply this exception 
    4141to your own modified versions of Mura CMS. 
    4242---> 
     
    456456        <cfreturn returnStr> 
    457457</cffunction>  
     458 
     459        <cffunction name="hasParent" output="false"> 
     460        <cfreturn listLen(getPath()) gt 1> 
     461        </cffunction> 
    458462</cfcomponent> 
    459463 
  • trunk/www/requirements/mura/content/contentBean.cfc

    r2403 r2440  
    15491549</cffunction>  
    15501550 
     1551<cffunction name="hasParent" output="false"> 
     1552        <cfreturn listLen(getPath()) gt 1> 
     1553</cffunction> 
     1554 
    15511555</cfcomponent> 
  • trunk/www/requirements/mura/content/contentCommentBean.cfc

    r2108 r2440  
    612612        <cfreturn this> 
    613613</cffunction> 
     614 
     615<cffunction name="hasParent" output="false"> 
     616        <cfreturn listLen(getPath()) gt 1> 
     617</cffunction> 
    614618</cfcomponent> 
  • trunk/www/requirements/mura/event.cfc

    r2292 r2440  
    77Mura CMS is distributed in the hope that it will be useful, 
    88but WITHOUT ANY WARRANTY; without even the implied warranty of 
    9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ᅵSee the 
    1010GNU General Public License for more details. 
    1111 
    1212You should have received a copy of the GNU General Public License 
    13 along with Mura CMS.  If not, see <http://www.gnu.org/licenses/>. 
     13along with Mura CMS. ᅵIf not, see <http://www.gnu.org/licenses/>. 
    1414 
    1515Linking Mura CMS statically or dynamically with other modules constitutes 
    1616the preparation of a derivative work based on Mura CMS. Thus, the terms and      
    17 conditions of the GNU General Public License version 2 (“GPL”) cover the entire combined work. 
     17conditions of the GNU General Public License version 2 (ᅵGPLᅵ) cover the entire combined work. 
    1818 
    1919However, as a special exception, the copyright holders of Mura CMS grant you permission 
    2020to combine Mura CMS with programs or libraries that are released under the GNU Lesser General Public License version 2.1. 
    2121 
    22 In addition, as a special exception,  the copyright holders of Mura CMS grant you permission 
    23 to combine Mura CMS  with independent software modules that communicate with Mura CMS solely 
     22In addition, as a special exception, ᅵthe copyright holders of Mura CMS grant you permission 
     23to combine Mura CMS ᅵwith independent software modules that communicate with Mura CMS solely 
    2424through modules packaged as Mura CMS plugins and deployed through the Mura CMS plugin installation API, 
    25 provided that these modules (a) may only modify the  /trunk/www/plugins/ directory through the Mura CMS 
     25provided that these modules (a) may only modify the ᅵ/trunk/www/plugins/ directory through the Mura CMS 
    2626plugin installation API, (b) must not alter any default objects in the Mura CMS database 
    2727and (c) must not alter any files in the following directories except in cases where the code contains 
     
    3838For clarity, if you create a modified version of Mura CMS, you are not obligated to grant this special exception 
    3939for your modified version; it is your choice whether to do so, or to make such modified version available under 
    40 the GNU General Public License version 2  without this exception.  You may, if you choose, apply this exception 
     40the GNU General Public License version 2 ᅵwithout this exception. ᅵYou may, if you choose, apply this exception 
    4141to your own modified versions of Mura CMS. 
    4242---> 
     
    141141</cffunction> 
    142142 
     143<cffunction name="getThemeRenderer" returntype="any" access="public" output="false"> 
     144        <cfreturn getValue('themeRenderer') />   
     145</cffunction>  
     146 
    143147<cffunction name="getSite" returntype="any" access="public" output="false"> 
    144148        <cfif len(getValue('siteid'))> 
     
    183187        </cfif> 
    184188        <cfif not valueExists("contentRenderer")> 
    185                 <cfset setValue("contentRenderer",createObject("component","#application.settingsManager.getSite(getValue('siteid')).getAssetMap()#.includes.contentRenderer").init(this))> 
     189                <cfset setValue("contentRenderer",createObject("component","#application.settingsManager.getSite(getValue('siteid')).getAssetMap()#.includes.contentRenderer").init(event=this,$=getValue('MuraScope'),mura=getValue('MuraScope')))> 
     190        </cfif> 
     191        <cfif not valueExists("themeRenderer") and fileExists(expandPath(getSite().getThemeIncludePath()) & "/contentRenderer.cfc")> 
     192                <cfset setValue("themeRenderer",createObject("component","#getSite().getThemeAssetMap()#.contentRenderer").init(event=this,$=getValue('MuraScope'),mura=getValue('MuraScope')))> 
    186193        </cfif>  
    187194        <cfif not valueExists("localHandler") and fileExists(expandPath("/#application.configBean.getWebRootMap()#") & "/#getValue('siteid')#/includes/eventHandler.cfc")> 
    188195                <cfset setValue("localHandler",createObject("component","#application.configBean.getWebRootMap()#.#getValue('siteid')#.includes.eventHandler").init())> 
    189196        </cfif> 
     197         
    190198        <cfreturn this> 
    191199</cffunction> 
  • trunk/www/requirements/mura/servletEvent.cfc

    r2292 r2440  
    77Mura CMS is distributed in the hope that it will be useful, 
    88but WITHOUT ANY WARRANTY; without even the implied warranty of 
    9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ᅵSee the 
    1010GNU General Public License for more details. 
    1111 
    1212You should have received a copy of the GNU General Public License 
    13 along with Mura CMS.  If not, see <http://www.gnu.org/licenses/>. 
     13along with Mura CMS. ᅵIf not, see <http://www.gnu.org/licenses/>. 
    1414 
    1515Linking Mura CMS statically or dynamically with other modules constitutes 
    1616the preparation of a derivative work based on Mura CMS. Thus, the terms and      
    17 conditions of the GNU General Public License version 2 (“GPL”) cover the entire combined work. 
     17conditions of the GNU General Public License version 2 (ᅵGPLᅵ) cover the entire combined work. 
    1818 
    1919However, as a special exception, the copyright holders of Mura CMS grant you permission 
    2020to combine Mura CMS with programs or libraries that are released under the GNU Lesser General Public License version 2.1. 
    2121 
    22 In addition, as a special exception,  the copyright holders of Mura CMS grant you permission 
    23 to combine Mura CMS  with independent software modules that communicate with Mura CMS solely 
     22In addition, as a special exception, ᅵthe copyright holders of Mura CMS grant you permission 
     23to combine Mura CMS ᅵwith independent software modules that communicate with Mura CMS solely 
    2424through modules packaged as Mura CMS plugins and deployed through the Mura CMS plugin installation API, 
    25 provided that these modules (a) may only modify the  /trunk/www/plugins/ directory through the Mura CMS 
     25provided that these modules (a) may only modify the ᅵ/trunk/www/plugins/ directory through the Mura CMS 
    2626plugin installation API, (b) must not alter any default objects in the Mura CMS database 
    2727and (c) must not alter any files in the following directories except in cases where the code contains 
     
    3838For clarity, if you create a modified version of Mura CMS, you are not obligated to grant this special exception 
    3939for your modified version; it is your choice whether to do so, or to make such modified version available under 
    40 the GNU General Public License version 2  without this exception.  You may, if you choose, apply this exception 
     40the GNU General Public License version 2 ᅵwithout this exception. ᅵYou may, if you choose, apply this exception 
    4141to your own modified versions of Mura CMS. 
    4242---> 
     
    178178</cffunction> 
    179179 
     180<cffunction name="getThemeRenderer" returntype="any" access="public" output="false"> 
     181        <cfreturn getValue('themeRenderer') />   
     182</cffunction> 
     183 
    180184<cffunction name="getContentBean" returntype="any" access="public" output="false"> 
    181185        <cfreturn getValue('contentBean') />     
  • trunk/www/requirements/mura/settings/settingsBean.cfc

    r2336 r2440  
    115115<cfset variables.instance.theme=""/>  
    116116<cfset variables.instance.contentRenderer=""/> 
     117<cfset variables.instance.themeRenderer=""> 
    117118 
    118119<cffunction name="init" returntype="any" output="false" access="public"> 
     
    11761177</cffunction> 
    11771178 
     1179<cffunction name="getThemeRenderer" output="false"> 
     1180<cfif not isObject(variables.instance.themeRenderer)> 
     1181        <cfif fileExists(expandPath(getThemeIncludePath()) & "/contentRenderer.cfc")> 
     1182                <cfset variables.instance.themeRenderer=createObject("component","#getThemeAssetMap()#.contentRenderer")> 
     1183        <cfelse> 
     1184                <cfset variables.instance.themeRenderer=createObject("component","mura.cfobject").init()> 
     1185        </cfif> 
     1186</cfif> 
     1187<cfreturn variables.instance.themeRenderer> 
     1188</cffunction> 
     1189 
    11781190</cfcomponent> 
Note: See TracChangeset for help on using the changeset viewer.