CMS  Version 3.9
forum_request_form.inc
Go to the documentation of this file.
1 <?php
2 /**************************************************************
3 
4  Copyright (c) 2010 Sonjara, Inc
5 
6  Permission is hereby granted, free of charge, to any person
7  obtaining a copy of this software and associated documentation
8  files (the "Software"), to deal in the Software without
9  restriction, including without limitation the rights to use,
10  copy, modify, merge, publish, distribute, sublicense, and/or sell
11  copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following
13  conditions:
14 
15  The above copyright notice and this permission notice shall be
16  included in all copies or substantial portions of the Software.
17 
18  Except as contained in this notice, the name(s) of the above
19  copyright holders shall not be used in advertising or otherwise
20  to promote the sale, use or other dealings in this Software
21  without prior written authorization.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30  OTHER DEALINGS IN THE SOFTWARE.
31 
32 *****************************************************************/
33 
34 /*
35  * forum_request_form.inc
36  *
37  * Description: Mail form for users with "member" role to request
38  * a new type of discussion forum.
39  *
40  * author: Janice Gallant for Sonjara, Inc.
41  *
42  * date: 7/12/10
43  */
44 
45 Fakoli::using("forum", "mail", "email");
46 Fakoli::usingFile("framework/auto_form.inc");
47 
48 $msg = checkNumeric($_GET["msg"]);
49 
51 $forumRequest->to = $config["email_tech"];
52 $forumRequest->subject = "New Forum Request";
53 
54 $form = new AutoForm($forumRequest);
55 $form->readonly("to", "subject");
56 $form->submitLabel = "Email Technical Support";
57 $form->button("Cancel", "forum_list");
58 $form->annotate("message", "Please specify a suggested title for the new forum and a description of its intended topic area.");
59 
60 $mgr = new UserManager();
61 
62 $form->hide("owner_id");
63 $forumRequest->owner_id = $user->get($user->primary_key);
64 
65 if ($method == "POST")
66 {
67  $emailHandler = new EmailHandler($form->data->to, $form->data->subject, $_POST["message"], $user->email);
68  $sent = $emailHandler->send();
69  $msg = ($sent > 0) ? 1 : 2;
70  redirect("forum_list");
71 }
72 
73 $script .= $form->writeScript();
74 if(!$msg)
75  $form->drawForm();
76 else
77 {
78  //echo $forumRequest->getInfoText($msg);
79 ?>
80 <button onclick="go('forum_list')" class="button">Return to Discussion Forums</button>
81 <?
82 }
83 ?>
$_POST["owner_id"]
Definition: blog_form.inc:54
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static usingFile()
Uses the specified framework file(s) from the framework directory.
Definition: core.inc:369
Definition: forum.inc:42
Provides the interface to the user model for the application.
global $user
$method
Pull out a simple reference to the request method.
Definition: core.inc:1573
$forumRequest to
if($method=="POST") $script
global $config
Definition: import.inc:4