| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 3 | <!--- |
|---|
| 4 | Name : C:\projects\blogcfc5\client\admin\entries.cfm |
|---|
| 5 | Author : Raymond Camden |
|---|
| 6 | Created : 04/07/06 |
|---|
| 7 | Last Updated : |
|---|
| 8 | History : |
|---|
| 9 | ---> |
|---|
| 10 | |
|---|
| 11 | <!--- handle deletes ---> |
|---|
| 12 | <cfif structKeyExists(form, "mark")> |
|---|
| 13 | <cfloop index="u" list="#form.mark#"> |
|---|
| 14 | <cfset application.blog.deleteEntry(u)> |
|---|
| 15 | </cfloop> |
|---|
| 16 | <!--- clear cache ---> |
|---|
| 17 | <cfmodule template="../tags/scopecache.cfm" scope="application" clearall="true"> |
|---|
| 18 | </cfif> |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | <cfparam name="url.keywords" default=""> |
|---|
| 22 | <cfparam name="form.keywords" default="#url.keywords#"> |
|---|
| 23 | <cfparam name="url.start" default="1"> |
|---|
| 24 | |
|---|
| 25 | <cfset params = structNew()> |
|---|
| 26 | <cfset params.mode = "short"> |
|---|
| 27 | <cfif len(trim(form.keywords))> |
|---|
| 28 | <cfset params.searchTerms = form.keywords> |
|---|
| 29 | <cfset params.dontlogsearch = true> |
|---|
| 30 | </cfif> |
|---|
| 31 | <cfset params.maxEntries = application.maxEntries> |
|---|
| 32 | <cfset params.startRow = url.start> |
|---|
| 33 | |
|---|
| 34 | <cfset entryData = application.blog.getEntries(params)> |
|---|
| 35 | <cfset entries = entryData.entries> |
|---|
| 36 | |
|---|
| 37 | <!--- modify to add a proper view col ---> |
|---|
| 38 | <!--- todo: only do rows in current view ---> |
|---|
| 39 | <cfset queryAddColumn(entries,"viewurl",arrayNew(1))> |
|---|
| 40 | <cfloop query="entries"> |
|---|
| 41 | <cfset vu = application.blog.makeLink(id)> |
|---|
| 42 | <cfset querySetCell(entries, "viewurl", vu & "?adminview=true", currentRow)> |
|---|
| 43 | </cfloop> |
|---|
| 44 | |
|---|
| 45 | <cfmodule template="../tags/adminlayout.cfm" title="Entries"> |
|---|
| 46 | |
|---|
| 47 | <cfoutput> |
|---|
| 48 | <p> |
|---|
| 49 | <cfif len(trim(form.keywords))> |
|---|
| 50 | Your filtered search returned |
|---|
| 51 | <cfelse> |
|---|
| 52 | Your blog currently has |
|---|
| 53 | </cfif> |
|---|
| 54 | <cfif entryData.totalEntries> |
|---|
| 55 | #entryData.totalEntries# entries. |
|---|
| 56 | <cfelseif entryData.totalEntries is 1> |
|---|
| 57 | 1 entry. |
|---|
| 58 | <cfelse> |
|---|
| 59 | 0 entries. |
|---|
| 60 | </cfif> |
|---|
| 61 | </p> |
|---|
| 62 | |
|---|
| 63 | <p> |
|---|
| 64 | <form action="entries.cfm" method="post"> |
|---|
| 65 | <input type="text" name="keywords" value="#form.keywords#"> <input type="submit" value="Filter by Keyword"> |
|---|
| 66 | </form> |
|---|
| 67 | </p> |
|---|
| 68 | </cfoutput> |
|---|
| 69 | |
|---|
| 70 | <cfmodule template="../tags/datatablenew.cfm" data="#entries#" editlink="entry.cfm" label="Entries" |
|---|
| 71 | linkcol="title" defaultsort="posted" defaultdir="desc" queryString="keywords=#urlencodedformat(form.keywords)#" totalRows="#entryData.totalEntries#"> |
|---|
| 72 | <cfmodule template="../tags/datacolnew.cfm" colname="title" label="Title" /> |
|---|
| 73 | <cfmodule template="../tags/datacolnew.cfm" colname="released" label="Released" format="yesno"/> |
|---|
| 74 | <cfmodule template="../tags/datacolnew.cfm" colname="posted" label="Posted" format="datetime" /> |
|---|
| 75 | <cfmodule template="../tags/datacolnew.cfm" colname="views" label="Views" format="number" /> |
|---|
| 76 | <cfmodule template="../tags/datacolnew.cfm" label="View" data="<a href=""$viewurl$"">View</a>" sort="false" /> |
|---|
| 77 | </cfmodule> |
|---|
| 78 | |
|---|
| 79 | </cfmodule> |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | <cfsetting enablecfoutputonly=false> |
|---|