Changeset 2434


Ignore:
Timestamp:
06/27/10 00:24:54 (20 months ago)
Author:
mattlevine
Message:
  1. Adding the ability to have theme local contentRenderer.cfc files. Like the eventHandler.cfc it is loaded during the onApplicationLoad event.
Location:
branches/5.2/www/requirements/mura
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2/www/requirements/mura/Handler/standardSetContentRendererHandler.cfc

    r2097 r2434  
    2626         
    2727        <cfset event.setValue('contentRenderer',createObject("component","#event.getSite().getAssetMap()#.includes.contentRenderer").init(event))/> 
    28  
     28        <cfset event.setValue("themeRenderer",event.getSite().getThemeRenderer())> 
    2929</cffunction> 
    3030 
  • branches/5.2/www/requirements/mura/MuraScope.cfc

    r2418 r2434  
    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 
     
    4484</cffunction> 
    4585 
     86<cffunction name="getThemeRenderer" output="false" returntype="any"> 
     87        <cfreturn event("themeRenderer")> 
     88</cffunction> 
     89 
    4690<cffunction name="getContentBean" output="false" returntype="any"> 
    4791        <cfreturn event("contentBean")> 
     
    83127        </cfif> 
    84128        <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> 
    123129</cffunction> 
    124130 
  • branches/5.2/www/requirements/mura/event.cfc

    r2291 r2434  
    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'))> 
     
    188192                <cfset setValue("localHandler",createObject("component","#application.configBean.getWebRootMap()#.#getValue('siteid')#.includes.eventHandler").init())> 
    189193        </cfif> 
     194 
     195        <cfset setValue("themeRenderer",application.settingsManager.getSite(getValue("siteID")).getThemeRenderer())> 
     196         
    190197        <cfreturn this> 
    191198</cffunction> 
  • branches/5.2/www/requirements/mura/servletEvent.cfc

    r2291 r2434  
    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') />     
  • branches/5.2/www/requirements/mura/settings/settingsBean.cfc

    r2335 r2434  
    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.