aboutsummaryrefslogtreecommitdiff
path: root/mod/externalpages/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/externalpages/views/default')
-rw-r--r--mod/externalpages/views/default/admin/appearance/expages.php10
-rw-r--r--mod/externalpages/views/default/expages/menu.php23
-rw-r--r--mod/externalpages/views/default/expages/wrapper.php16
-rw-r--r--mod/externalpages/views/default/forms/expages/edit.php58
4 files changed, 107 insertions, 0 deletions
diff --git a/mod/externalpages/views/default/admin/appearance/expages.php b/mod/externalpages/views/default/admin/appearance/expages.php
new file mode 100644
index 000000000..6a5a521a5
--- /dev/null
+++ b/mod/externalpages/views/default/admin/appearance/expages.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Admin section for editing external pages
+ */
+
+$type = get_input('type', 'about');
+
+echo elgg_view('expages/menu', array('type' => $type));
+
+echo elgg_view_form('expages/edit', array('class' => 'elgg-form-settings'), array('type' => $type));
diff --git a/mod/externalpages/views/default/expages/menu.php b/mod/externalpages/views/default/expages/menu.php
new file mode 100644
index 000000000..831be9125
--- /dev/null
+++ b/mod/externalpages/views/default/expages/menu.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * External pages menu
+ *
+ * @uses $vars['type']
+ */
+
+$type = $vars['type'];
+
+//set the url
+$url = $vars['url'] . "admin/site/expages?type=";
+
+$pages = array('about', 'terms', 'privacy');
+$tabs = array();
+foreach ($pages as $page) {
+ $tabs[] = array(
+ 'title' => elgg_echo("expages:$page"),
+ 'url' => "admin/appearance/expages?type=$page",
+ 'selected' => $page == $type,
+ );
+}
+
+echo elgg_view('navigation/tabs', array('tabs' => $tabs, 'class' => 'elgg-form-settings'));
diff --git a/mod/externalpages/views/default/expages/wrapper.php b/mod/externalpages/views/default/expages/wrapper.php
new file mode 100644
index 000000000..c579da1ba
--- /dev/null
+++ b/mod/externalpages/views/default/expages/wrapper.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Wrapper for site pages content area
+ *
+ * @uses $vars['content']
+ */
+
+echo $vars['content'];
+
+echo '<div class="mtm">';
+echo elgg_view('output/url', array(
+ 'text' => elgg_echo('back'),
+ 'href' => $_SERVER['HTTP_REFERER'],
+ 'class' => 'float-alt'
+));
+echo '</div>';
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..a15f2a7aa
--- /dev/null
+++ b/mod/externalpages/views/default/forms/expages/edit.php
@@ -0,0 +1,58 @@
+<?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(
+ 'name' => 'expagescontent',
+ 'value' => $description,
+));
+$submit_input = elgg_view('input/submit', array(
+ 'name' => 'submit',
+ 'value' => elgg_echo('save'),
+));
+$hidden_type = elgg_view('input/hidden', array(
+ 'name' => 'content_type',
+ 'value' => $type,
+));
+$hidden_guid = elgg_view('input/hidden', array(
+ 'name' => 'guid',
+ 'value' => $guid,
+));
+
+$external_page_title = elgg_echo("expages:$type");
+
+//construct the form
+echo <<<EOT
+<div class="mtm">
+ <label>$external_page_title</label>
+ $input_area
+</div>
+<div class="elgg-foot">
+$hidden_guid
+$hidden_type
+$submit_input
+</div>
+EOT;
+