aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages/views/default/forms/expages/edit.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 23:10:18 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 23:10:18 +0000
commit0b3724c9b87f891b48c41ad61c1caf3486cc0799 (patch)
tree7bd117e0256e1857da935533eb064213bc890a39 /mod/externalpages/views/default/forms/expages/edit.php
parent26f9c39ae33bc01b0f8c62b4e27f7ee077d0fadc (diff)
downloadelgg-0b3724c9b87f891b48c41ad61c1caf3486cc0799.tar.gz
elgg-0b3724c9b87f891b48c41ad61c1caf3486cc0799.tar.bz2
updates externalpages to 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@8209 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/externalpages/views/default/forms/expages/edit.php')
-rw-r--r--mod/externalpages/views/default/forms/expages/edit.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/mod/externalpages/views/default/forms/expages/edit.php b/mod/externalpages/views/default/forms/expages/edit.php
new file mode 100644
index 000000000..afe091337
--- /dev/null
+++ b/mod/externalpages/views/default/forms/expages/edit.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Edit form body for external pages
+ *
+ * @uses $vars['type']
+ *
+ */
+
+$type = $vars['type'];
+
+//grab the required entity
+$page_contents = elgg_get_entities(array(
+ 'type' => 'object',
+ 'subtype' => $type,
+ 'limit' => 1,
+));
+
+if ($page_contents) {
+ $description = $page_contents[0]->description;
+ $guid = $page_contents[0]->guid;
+} else {
+ $description = "";
+ $guid = 0;
+}
+
+// set the required form variables
+$input_area = elgg_view('input/longtext', array(
+ 'internalname' => 'expagescontent',
+ 'value' => $description,
+));
+$submit_input = elgg_view('input/submit', array(
+ 'internalname' => 'submit',
+ 'value' => elgg_echo('save'),
+));
+$hidden_type = elgg_view('input/hidden', array(
+ 'internalname' => 'content_type',
+ 'value' => $type,
+));
+$hidden_guid = elgg_view('input/hidden', array(
+ 'internalname' => 'guid',
+ 'value' => $guid,
+));
+
+$external_page_title = elgg_echo("expages:$type");
+
+//construct the form
+echo <<<EOT
+<h3 class="mvm">$external_page_title</h3>
+<div>$input_area</div>
+ $hidden_value
+ $hidden_type
+ $submit_input
+
+EOT;
+