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