| [5] | 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 3 | <!--- |
|---|
| 4 | Name : Pods Display |
|---|
| 5 | Author : Scott Pinkston |
|---|
| 6 | Created : October 14, 2006 |
|---|
| 7 | Last Updated : |
|---|
| 8 | History : |
|---|
| 9 | ---> |
|---|
| 10 | |
|---|
| 11 | <cfset dir = expandPath("../includes/pods")> |
|---|
| 12 | |
|---|
| 13 | <cfif structKeyExists(url,"deletePod") and fileExists(dir & "/#url.deletePod#")> |
|---|
| 14 | <cffile action="delete" file="#dir#/#url.deletePod#"> |
|---|
| 15 | </cfif> |
|---|
| 16 | |
|---|
| 17 | <!--- Get all of the cfm files in the pod folder ----> |
|---|
| 18 | <cfdirectory directory="#dir#" name="pods" filter="*.cfm"> |
|---|
| 19 | |
|---|
| 20 | <!--- Get the active pods and their sort order ---> |
|---|
| 21 | <cfset podMetaData = application.pod.getInfo(dir)> |
|---|
| 22 | |
|---|
| 23 | <!--- Add field to the query returned from cfdirectory ---> |
|---|
| 24 | <cfset queryAddColumn(pods, "sortOrder", arrayNew(1))> |
|---|
| 25 | |
|---|
| 26 | <cfloop query="pods"> |
|---|
| 27 | <cfif structKeyExists(podMetaData.pods,name)> |
|---|
| 28 | <cfset querySetCell(pods, "sortOrder", podMetaData.pods[name], currentRow)> |
|---|
| 29 | <cfelse> |
|---|
| 30 | <cfset querySetCell(pods, "sortOrder", "", currentRow)> |
|---|
| 31 | </cfif> |
|---|
| 32 | </cfloop> |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | <cfmodule template="../tags/adminlayout.cfm" title="Pods"> |
|---|
| 36 | |
|---|
| 37 | <cfoutput> |
|---|
| 38 | <p>Total Available Pods: #pods.recordcount# Total Active: #StructCount(podMetaData.pods)# </p> |
|---|
| 39 | Select the Pods you want to display, and enter a numeric value for the sort order.<br /> |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | <form action="pod.cfm" method="post" name="PodUpdate"> |
|---|
| 43 | <table class="adminListTable"> |
|---|
| 44 | <tr class="adminListHeader"> |
|---|
| 45 | <td width="50">Show</td> |
|---|
| 46 | <td>Name</td> |
|---|
| 47 | <td>Actions</td> |
|---|
| 48 | <td width="100">Sort Order</td> |
|---|
| 49 | </tr> |
|---|
| 50 | </cfoutput> |
|---|
| 51 | |
|---|
| 52 | <cfoutput query="pods"> |
|---|
| 53 | <tr class="adminList<cfif currentRow mod 2>1</cfif>"> |
|---|
| 54 | <td><input type="checkbox" name="ShowPods" value="#name#" <cfif len(sortOrder)>checked</cfif>></td> |
|---|
| 55 | <td>#name#</td> |
|---|
| 56 | <td> |
|---|
| 57 | [<a href="showpods.cfm?pod=#name#" target="PodWin" onclick="window.open(this.href,this.target,'width=215,height=400');return false;">Show sample output</a> ] |
|---|
| 58 | [<a href="podform.cfm?pod=#name#">Edit Pod</a>] |
|---|
| 59 | [<a href="pods.cfm?deletePod=#name#">Delete Pod</a>] |
|---|
| 60 | </td> |
|---|
| 61 | <td align="center"><input type="text" name="#name#" value="#sortOrder#" size="3" tabindex="#currentrow#"></td> |
|---|
| 62 | </tr> |
|---|
| 63 | </cfoutput> |
|---|
| 64 | |
|---|
| 65 | <cfoutput></table> |
|---|
| 66 | <div align="right" style="margin-right:15px;"> |
|---|
| 67 | [<a href="podform.cfm">Add New Pod</a> ] |
|---|
| 68 | [<a href="Javascript: document.PodUpdate.submit()">Update Pods</a> ] |
|---|
| 69 | </div> |
|---|
| 70 | </form> |
|---|
| 71 | </cfoutput> |
|---|
| 72 | |
|---|
| 73 | </cfmodule> |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | <cfsetting enablecfoutputonly=false> |
|---|