aboutsummaryrefslogtreecommitdiff
path: root/views/default/page_elements
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/page_elements')
-rw-r--r--views/default/page_elements/main_header.php27
-rw-r--r--views/default/page_elements/main_module.php5
-rw-r--r--views/default/page_elements/main_nav.php32
3 files changed, 64 insertions, 0 deletions
diff --git a/views/default/page_elements/main_header.php b/views/default/page_elements/main_header.php
new file mode 100644
index 000000000..438a6c432
--- /dev/null
+++ b/views/default/page_elements/main_header.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Header for main module
+ *
+ * @uses string $vars['type'] The section type. Should be the same as the page handler. Used for generating URLs.
+ */
+
+$type = $vars['type'];
+$username = get_loggedin_user()->username;
+
+$title = elgg_echo($type);
+
+$new_button = '';
+if (isloggedin()) {
+ $new_link = elgg_get_array_value('new_link', $vars, "pg/$type/$username/new");
+ $params = array(
+ 'href' => $new_link = elgg_normalize_url($new_link),
+ 'text' => elgg_echo("$type:new"),
+ 'class' => 'action-button right',
+ );
+ $new_button = elgg_view('output/url', $params);
+}
+
+echo <<<HTML
+<h2 class="elgg-module-heading">$title</h2>
+$new_button
+HTML;
diff --git a/views/default/page_elements/main_module.php b/views/default/page_elements/main_module.php
new file mode 100644
index 000000000..388a500fe
--- /dev/null
+++ b/views/default/page_elements/main_module.php
@@ -0,0 +1,5 @@
+<?php
+
+$vars['class'] = 'elgg-module-maincontent';
+$vars['header_class'] = 'elgg-maincontent-header clearfix';
+echo elgg_view_layout('module', $vars); \ No newline at end of file
diff --git a/views/default/page_elements/main_nav.php b/views/default/page_elements/main_nav.php
new file mode 100644
index 000000000..0c267b3f2
--- /dev/null
+++ b/views/default/page_elements/main_nav.php
@@ -0,0 +1,32 @@
+<?php
+
+// page handler type
+$type = $vars['type'];
+
+$username = get_loggedin_user()->username;
+
+// so we know if the user is looking at their own, everyone's or all friends
+$filter_context = $vars['context'];
+
+// generate a list of default tabs
+$default_tabs = array(
+ 'all' => array(
+ 'title' => elgg_echo('all'),
+ 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$type/",
+ 'selected' => ($filter_context == 'everyone'),
+ ),
+ 'mine' => array(
+ 'title' => elgg_echo('mine'),
+ 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username",
+ 'selected' => ($filter_context == 'mine'),
+ ),
+ 'friend' => array(
+ 'title' => elgg_echo('friends'),
+ 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends",
+ 'selected' => ($filter_context == 'friends'),
+ ),
+);
+
+// determine if using default or overwritten tabs
+$tabs = elgg_get_array_value('tabs', $vars, $default_tabs);
+echo elgg_view('navigation/tabs', array('tabs' => $tabs)); \ No newline at end of file