Simple status box for the sidebar.
[elgg_plugins.git] / presentation / new.php
blobce70e2031278d234a6bc9ed1fa9325f30a8c3c7c
1 <?php
2 /**
3 * Elgg Presentation tool
4 *
5 * @author Sven Edge
6 * @package mod_presentation
7 */
9 // Load Elgg framework
10 @require_once("../../includes.php");
12 // Define context
13 define("context","presentation");
15 // Load global variables
16 global $CFG, $PAGE, $page_owner;
18 // Get the current user
19 $page_owner = optional_param('owner',$_SESSION['userid'],PARAM_INT);
21 // Initialise page body and title
22 $body = "";
23 $title = __gettext("Create presentation");
25 protect(1);
27 templates_page_setup();
29 // Are we eligible to edit this?
30 if (run("permissions:check","profile")) {
32 $Keywords = __gettext("Keywords (Separated by commas):"); // gettext variable
33 $keywordDesc = __gettext("Keywords commonly referred to as 'Tags' are words that represent the weblog post you have just made. This will make it easier for others to search and find your posting."); // gettext variable
34 $postTitle = __gettext("Title:"); // gettext variable
35 $accessRes = __gettext("Access restrictions:"); // gettext variable
37 $contentTitle = trim(optional_param('new_presentation_title'));
38 $contentKeywords = trim(optional_param('new_presentation_keywords'));
40 $body = "<p>" . __gettext("You can create a new presentation:") . "</p>";
42 $body .= "<form action=\"" . $CFG->wwwroot . "mod/presentation/new.php\" method=\"post\" >";
44 $body .= templates_draw(array(
45 'context' => 'databoxvertical',
46 'name' => $postTitle,
47 'contents' => display_input_field(array("new_presentation_title",$contentTitle,"text"))
52 $body .= templates_draw(array(
53 'context' => 'databoxvertical',
54 'name' => $Keywords . "<br />" . $keywordDesc,
55 'contents' => display_input_field(array("new_presentation_keywords","","keywords","presentation"))
59 $body .= templates_draw(array(
60 'context' => 'databoxvertical',
61 'name' => $accessRes,
62 'contents' => run("display:access_level_select",array("new_presentation_access",default_access))
66 $body .= "<input type=\"submit\" value=\"" . __gettext("Create") . "\" />";
67 $body .= "<input type=\"hidden\" name=\"action\" value=\"presentation:create\" />";
68 $body .= "<input type=\"hidden\" name=\"owner\" value=\"$page_owner\" />";
69 $body .= "</p>";
71 $body .= "</form>";
73 } else {
74 $body = "<p>" . __gettext("You do not have permission to create a new presentation.") . "</p>";
77 // Output to the screen
78 $body = templates_draw(array(
79 'context' => 'contentholder',
80 'title' => $title,
81 'body' => $body
85 echo templates_page_draw( array(
86 $title, $body