root/trunk/website/forums/admin/conferences_edit.cfm @ 46

Revision 5, 2.9 kB (checked in by DanWilson, 17 years ago)

Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)

Line 
1<cfsetting enablecfoutputonly=true>
2<!---
3        Name         : conferences_edit.cfm
4        Author       : Raymond Camden
5        Created      : June 01, 2004
6        Last Updated : November 5, 2006
7        History      : Removed mappings (rkc 8/27/05)
8                                 : Simple size change (rkc 7/27/06)
9                                 : Reverted description to text field (rkc 11/5/06)
10        Purpose          :
11--->
12
13<cfif isDefined("form.cancel") or not isDefined("url.id") or not len(url.id)>
14        <cflocation url="conferences.cfm" addToken="false">
15</cfif>
16
17<cfif isDefined("form.save")>
18        <cfset errors = "">
19        <cfif not len(trim(form.name))>
20                <cfset errors = errors & "You must specify a name.<br>">
21        </cfif>
22        <cfif not len(trim(form.description))>
23                <cfset errors = errors & "You must specify a description.<br>">
24        </cfif>
25        <cfif not len(errors)>
26                <cfset conference = structNew()>
27                <cfset conference.name = trim(htmlEditFormat(form.name))>
28                <cfset conference.description = trim(htmlEditFormat(form.description))>
29                <cfset conference.active = trim(htmlEditFormat(form.active))>
30                <cfif url.id neq 0>
31                        <cfset application.galleon.conference.saveConference(url.id, conference)>
32                <cfelse>
33                        <cfset application.galleon.conference.addConference(conference)>
34                </cfif>
35                <cfset msg = "Conferfence, #conference.name#, has been updated.">
36                <cflocation url="conferences.cfm?msg=#urlEncodedFormat(msg)#">
37        </cfif>
38</cfif>
39
40<!--- get conference if not new --->
41<cfif url.id neq "0">
42        <cfset conference = application.galleon.conference.getConference(url.id)>
43        <cfparam name="form.name" default="#conference.name#">
44        <cfparam name="form.description" default="#conference.description#">
45        <cfparam name="form.active" default="#conference.active#">
46<cfelse>
47        <cfparam name="form.name" default="">
48        <cfparam name="form.description" default="">
49        <cfparam name="form.active" default="false">
50</cfif>
51
52<cfmodule template="../tags/layout.cfm" templatename="admin" title="Conference Editor">
53
54<cfoutput>
55<p>
56<cfif isDefined("errors")><ul><b>#errors#</b></ul></cfif>
57<form action="#cgi.script_name#?#cgi.query_string#" method="post">
58<table width="100%" cellspacing=0 cellpadding=5 class="adminEditTable">
59        <tr valign="top">
60                <td align="right"><b>Name:</b></td>
61                <td><input type="text" name="name" value="#form.name#" size="100"></td>
62        </tr>
63        <tr valign="top">
64                <td align="right"><b>Description:</b></td>
65                <td><input type="text" name="description" value="#form.description#" size="100"></td>
66        </tr>
67        <tr valign="top">
68                <td align="right"><b>Active:</b></td>
69                <td><select name="active">
70                <option value="1" <cfif form.active>selected</cfif>>Yes</option>
71                <option value="0" <cfif not form.active>selected</cfif>>No</option>
72                </select></td>
73        </tr>
74        <tr>
75                <td>&nbsp;</td>
76                <td><input type="submit" name="save" value="Save"> <input type="submit" name="cancel" value="Cancel"></td>
77        </tr>
78</table>
79</form>
80</p>
81</cfoutput>
82
83</cfmodule>
84
85<cfsetting enablecfoutputonly=false>
Note: See TracBrowser for help on using the browser.