aboutsummaryrefslogtreecommitdiff
path: root/views/default/page/layouts/content
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/page/layouts/content')
-rw-r--r--views/default/page/layouts/content/filter.php52
-rw-r--r--views/default/page/layouts/content/footer.php8
-rw-r--r--views/default/page/layouts/content/header.php43
-rw-r--r--views/default/page/layouts/content/sidebar.php8
4 files changed, 111 insertions, 0 deletions
diff --git a/views/default/page/layouts/content/filter.php b/views/default/page/layouts/content/filter.php
new file mode 100644
index 000000000..701c6418a
--- /dev/null
+++ b/views/default/page/layouts/content/filter.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Main content filter
+ *
+ * Select between user, friends, and all content
+ *
+ * @uses $vars['filter_context'] Filter context: all, friends, mine
+ * @uses $vars['filter_override'] HTML for overriding the default filter (override)
+ * @uses $vars['context'] Page context (override)
+ */
+
+if (isset($vars['filter_override'])) {
+ echo $vars['filter_override'];
+ return true;
+}
+
+$context = elgg_extract('context', $vars, elgg_get_context());
+
+if (elgg_is_logged_in() && $context) {
+ $username = elgg_get_logged_in_user_entity()->username;
+ $filter_context = elgg_extract('filter_context', $vars, 'all');
+
+ // generate a list of default tabs
+ $tabs = array(
+ 'all' => array(
+ 'text' => elgg_echo('all'),
+ 'href' => (isset($vars['all_link'])) ? $vars['all_link'] : "$context/all",
+ 'selected' => ($filter_context == 'all'),
+ 'priority' => 200,
+ ),
+ 'mine' => array(
+ 'text' => elgg_echo('mine'),
+ 'href' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "$context/owner/$username",
+ 'selected' => ($filter_context == 'mine'),
+ 'priority' => 300,
+ ),
+ 'friend' => array(
+ 'text' => elgg_echo('friends'),
+ 'href' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "$context/friends/$username",
+ 'selected' => ($filter_context == 'friends'),
+ 'priority' => 400,
+ ),
+ );
+
+ foreach ($tabs as $name => $tab) {
+ $tab['name'] = $name;
+
+ elgg_register_menu_item('filter', $tab);
+ }
+
+ echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
+}
diff --git a/views/default/page/layouts/content/footer.php b/views/default/page/layouts/content/footer.php
new file mode 100644
index 000000000..66f5d3ff8
--- /dev/null
+++ b/views/default/page/layouts/content/footer.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Main content footer
+ *
+ * @uses $vars['content'] The content for the footer
+ */
+
+echo $vars['content'];
diff --git a/views/default/page/layouts/content/header.php b/views/default/page/layouts/content/header.php
new file mode 100644
index 000000000..1e66e52db
--- /dev/null
+++ b/views/default/page/layouts/content/header.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Main content header
+ *
+ * Title and title menu
+ *
+ * @uses $vars['header_override'] HTML for overriding the default header (override)
+ * @uses $vars['title'] Title text (override)
+ * @uses $vars['context'] Page context (override)
+ */
+
+if (isset($vars['buttons'])) {
+ // it was a bad idea to implement buttons with a pass through
+ elgg_deprecated_notice("Use elgg_register_menu_item() to register for the title menu", 1.0);
+}
+
+if (isset($vars['header_override'])) {
+ echo $vars['header_override'];
+ return true;
+}
+
+$context = elgg_extract('context', $vars, elgg_get_context());
+
+$title = elgg_extract('title', $vars, '');
+if (!$title) {
+ $title = elgg_echo($context);
+}
+$title = elgg_view_title($title, array('class' => 'elgg-heading-main'));
+
+if (isset($vars['buttons']) && $vars['buttons']) {
+ $buttons = $vars['buttons'];
+} else {
+ $buttons = elgg_view_menu('title', array(
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+ ));
+}
+
+echo <<<HTML
+<div class="elgg-head clearfix">
+ $title$buttons
+</div>
+HTML;
diff --git a/views/default/page/layouts/content/sidebar.php b/views/default/page/layouts/content/sidebar.php
new file mode 100644
index 000000000..86ca8435f
--- /dev/null
+++ b/views/default/page/layouts/content/sidebar.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Main content sidebar
+ *
+ * @uses $vars['content] The content for the sidebar
+ */
+
+echo $vars['content'];