Simple status box for the sidebar.
[elgg_plugins.git] / presentation / delete.php
blob8659c43705e42b727657db07e576cd3346318c73
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, $USER, $page_owner, $profile_id;
18 protect(1);
19 if (isloggedin()) {
21 $pres = optional_param('id',0,PARAM_INT);
22 $title = run("profile:display:name", $profile_id) . " :: " . __gettext("Delete Presentation");
24 $presrec = get_record("presentations", "ident", $pres);
25 $page_owner = $presrec->owner;
26 $profile_id = $page_owner;
28 templates_page_setup();
29 if ($presrec && $presrec->owner == $USER->ident) {
31 $body = '<p>' . sprintf(__gettext('Click Delete if you are sure you want to permanently delete the presentation "%s".'), htmlspecialchars($presrec->name)) . '</p>';
33 $body .= "<form action=\"" . $CFG->wwwroot . "mod/presentation/index.php\" method=\"post\" >";
35 $body .= "<input type=\"submit\" value=\"" . __gettext("Delete") . "\" />";
36 $body .= "<input type=\"hidden\" name=\"action\" value=\"presentation:delete\" />";
37 $body .= "<input type=\"hidden\" name=\"owner\" value=\"$page_owner\" />";
38 $body .= "<input type=\"hidden\" name=\"delete_presentation_ident\" value=\"$presrec->ident\" />";
39 $body .= "</p>";
41 $body .= "</form>";
43 } else {
44 $body = __gettext('Error: Presentation not found or not owned by you.');
48 // Output to the screen
49 $body = templates_draw(array(
50 'context' => 'contentholder',
51 'title' => $title,
52 'body' => $body
56 echo templates_page_draw( array(
57 $title, $body