aboutsummaryrefslogtreecommitdiff
path: root/views/default/page
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/page')
-rw-r--r--views/default/page/elements/comments.php30
-rw-r--r--views/default/page/elements/owner_block.php35
-rw-r--r--views/default/page/elements/page_links.php37
-rw-r--r--views/default/page/elements/sidebar.php29
-rw-r--r--views/default/page/elements/title.php14
5 files changed, 145 insertions, 0 deletions
diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php
new file mode 100644
index 000000000..c27a146ab
--- /dev/null
+++ b/views/default/page/elements/comments.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * List comments with optional add form
+ *
+ * @uses $vars['entity'] ElggEntity
+ * @uses $vars['show_add_form'] Display add form or not
+ * @uses $vars['id'] Optional id for the div
+ */
+
+$show_add_form = elgg_extract('show_add_form', $vars, true);
+
+$id = '';
+if (isset($vars['id'])) {
+ $id = "id =\"{$vars['id']}\"";
+}
+
+echo "<div $id class=\"elgg-comments\">";
+
+$options = array(
+ 'guid' => $vars['entity']->getGUID(),
+ 'annotation_name' => 'generic_comment'
+);
+echo elgg_list_annotations($options);
+
+if ($show_add_form) {
+ $form_vars = array('name' => 'elgg_add_comment');
+ echo elgg_view_form('comments/add', $form_vars, $vars);
+}
+
+echo '</div>';
diff --git a/views/default/page/elements/owner_block.php b/views/default/page/elements/owner_block.php
new file mode 100644
index 000000000..8cfa2d683
--- /dev/null
+++ b/views/default/page/elements/owner_block.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Elgg owner block
+ * Displays page ownership information
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ */
+
+elgg_push_context('owner_block');
+
+// groups and other users get owner block
+$owner = elgg_get_page_owner_entity();
+if ($owner instanceof ElggGroup ||
+ ($owner instanceof ElggUser && $owner->getGUID() != elgg_get_logged_in_user_guid())) {
+
+ $header = elgg_view_entity($owner, false);
+
+ $body = elgg_view_menu('owner_block', array(
+ 'entity' => $owner,
+ 'class' => 'elgg-owner-block-menu',
+ ));
+
+ $body .= elgg_view('page/elements/owner_block/extend', $vars);
+
+ //@todo elgg-module-owner-block?
+ echo elgg_view('layout/objects/module', array(
+ 'header' => $header,
+ 'body' => $body,
+ 'class' => 'elgg-owner-block',
+ ));
+}
+
+elgg_pop_context(); \ No newline at end of file
diff --git a/views/default/page/elements/page_links.php b/views/default/page/elements/page_links.php
new file mode 100644
index 000000000..fb9acbfb7
--- /dev/null
+++ b/views/default/page/elements/page_links.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Page links: RSS link, reported content link, etc.
+ */
+
+// Are there feeds to display?
+global $autofeed;
+$rss_link = '';
+if (isset($autofeed) && $autofeed == true) {
+ $url = full_url();
+ if (substr_count($url,'?')) {
+ $url .= "&view=rss";
+ } else {
+ $url .= "?view=rss";
+ }
+ $url = elgg_format_url($url);
+ $label = elgg_echo('feed:rss');
+
+ $rss_link = elgg_view('output/url', array(
+ 'text' => '<span class="elgg-icon elgg-icon-rss"></span>',
+ 'href' => $url,
+ 'title' => $label,
+ 'rel' => 'nofollow',
+ 'encode_text' => false,
+ 'class' => 'right',
+ ));
+}
+
+// view to extend by plugins
+$links = elgg_view('page/links', $vars);
+
+if ($links || $rss_link) {
+ echo '<div class="elgg-page-links clearfix mbm">';
+ echo $rss_link;
+ echo $links;
+ echo '</div>';
+}
diff --git a/views/default/page/elements/sidebar.php b/views/default/page/elements/sidebar.php
new file mode 100644
index 000000000..8950c5f3f
--- /dev/null
+++ b/views/default/page/elements/sidebar.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Elgg sidebar contents
+ *
+ * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar
+ */
+
+echo elgg_view('page/elements/page_links', $vars);
+
+echo elgg_view('page/elements/owner_block', $vars);
+
+echo elgg_view_menu('page', array('sort_by' => 'name'));
+
+// optional 'sidebar' parameter
+if (isset($vars['sidebar'])) {
+ echo $vars['sidebar'];
+}
+
+// @todo deprecated so remove in Elgg 2.0
+// optional second parameter of elgg_view_layout
+if (isset($vars['area2'])) {
+ echo $vars['area2'];
+}
+
+// @todo deprecated so remove in Elgg 2.0
+// optional third parameter of elgg_view_layout
+if (isset($vars['area3'])) {
+ echo $vars['area3'];
+} \ No newline at end of file
diff --git a/views/default/page/elements/title.php b/views/default/page/elements/title.php
new file mode 100644
index 000000000..19f47f4e6
--- /dev/null
+++ b/views/default/page/elements/title.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Elgg title element
+ *
+ * @uses $vars['title'] The page title
+ * @uses $vars['class'] Optional class for heading
+ */
+
+$class= '';
+if (isset($vars['class'])) {
+ $class = " class=\"{$vars['class']}\"";
+}
+
+echo "<h2{$class}>{$vars['title']}</h2>";