PageRenderTime 30ms CodeModel.GetById 23ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/views/onContentEdit/onContentEdit.cfm

http://github.com/Lagaffe/MobileMura
ColdFusion | 72 lines | 45 code | 8 blank | 19 comment | 0 complexity | 44cf884912cf9c5806b1276b4cc2dd35 MD5 | raw file
 1<!---
 2
 3MobileMura/admin/views/onContentEdit/onContentEdit.cfm
 4
 5Copyright 2011 Guust Nieuwenhuis 
 6
 7Licensed under the Apache License, Version 2.0 (the "License"); 
 8you may not use this file except in compliance with the License. 
 9You may obtain a copy of the License at 
10
11http://www.apache.org/licenses/LICENSE-2.0 
12
13Unless required by applicable law or agreed to in writing, software 
14distributed under the License is distributed on an "AS IS" BASIS, 
15WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
16See the License for the specific language governing permissions and 
17limitations under the License. 
18
19--->
20
21<cfset $ = application.serviceFactory.getBean("muraScope") />
22
23<cfset contentBean = getBean("contentBean") />
24<cfset site = application.serviceFactory.getBean("muraScope") />
25<cfset site.init(session.siteID) />
26
27<cfset subTypeBean = application.classExtensionManager.getSubTypeByName(contentBean.getType(),"Default",session.siteID) />
28<cfset extendSetBean = subTypeBean.getExtendSetByName("MobileMura") />
29<cfset attributeBean = extendSetBean.getAttributeByName("mobiletemplate") />
30
31<cfset style = extendSetBean.getStyle() />
32
33<cfset MobileMuraData = createObject("component","mura.extend.extendObject").init(Type="Custom",SubType="MobileMuraData",SiteID=session.siteID)>
34<cfset MobileMuraData.setID( siteID ) />
35<cfset mobileTheme = MobileMuraData.getMobileTheme() />
36
37<cfif Len(mobileTheme)>
38	<cfset mobileTemplatesUrl = Replace(site.siteConfig().getTemplateIncludeDir(), site.siteConfig().getTheme(), mobileTheme) />
39	
40	<cfdirectory name="mobileTemplates" action="LIST" directory="#mobileTemplatesUrl#" filter="*.cfm" />
41<cfelse>
42	<cfset mobileTemplates = queryNew("", "") />
43</cfif>
44
45<cfoutput>
46<dl class="oneColumn" id="extendDL">
47	<span class="extendset" extendsetid="#extendSetBean.getExtendSetID()#" categoryid="#extendSetBean.getCategoryID()#" #style#>
48	<input name="extendSetID" type="hidden" value="#extendSetBean.getExtendSetID()#"/>
49	<dt class="first">#extendSetBean.getName()#</dt>
50	<cfsilent>
51	</cfsilent>
52	<dd><dl>
53		<dt>
54		<cfif len(attributeBean.getHint())>
55		<a href="##" class="tooltip">#attributeBean.getLabel()# <span>#attributeBean.gethint()#</span></a>
56		<cfelse>
57		#attributeBean.getLabel()#
58		</cfif>
59		</dt>
60		<dd>
61			<select id="#attributeBean.getName()#" required="#attributeBean.getRequired()#" label="#attributeBean.getLabel()#" name="#attributeBean.getName()#">
62				<option selected="selected" value="-1">Inherit From Parent</option>
63				<option value="-2">Desktop Template</option>
64				<cfloop query="mobileTemplates">
65					<option value="#mobileTemplates.name#" <cfif mobileTemplates.name EQ $.content("mobiletemplate") >selected="true"</cfif>>#mobileTemplates.name#</option>
66				</cfloop>
67			</select>
68		</dd>
69	</dl></dd>
70	</span>
71</dl>
72</cfoutput>