aboutsummaryrefslogtreecommitdiff
path: root/views/default/page_elements/main_header.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/page_elements/main_header.php')
-rw-r--r--views/default/page_elements/main_header.php27
1 files changed, 27 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;