diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-01 10:49:42 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-01 10:49:42 +0000 |
commit | fb48ea92032d56347d75baf77adc4a410bd38b31 (patch) | |
tree | be60e6ff49ab8bc07dc2ee13cd32672e8a18723d /views | |
parent | 80e56eb63923b56315b4c3fa2f69301e017155d1 (diff) | |
download | elgg-fb48ea92032d56347d75baf77adc4a410bd38b31.tar.gz elgg-fb48ea92032d56347d75baf77adc4a410bd38b31.tar.bz2 |
Introducing the consistent owner block
git-svn-id: https://code.elgg.org/elgg/trunk@1644 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/canvas/layouts/two_column_left_sidebar.php | 8 | ||||
-rw-r--r-- | views/default/page_elements/owner_block.php | 40 |
2 files changed, 45 insertions, 3 deletions
diff --git a/views/default/canvas/layouts/two_column_left_sidebar.php b/views/default/canvas/layouts/two_column_left_sidebar.php index 17740cd36..9894d51ad 100644 --- a/views/default/canvas/layouts/two_column_left_sidebar.php +++ b/views/default/canvas/layouts/two_column_left_sidebar.php @@ -15,9 +15,11 @@ <!-- left sidebar --> <div id="two_column_left_sidebar"> - <div id="owner_block"> - <?php echo $vars['area1']; ?> - </div> + <?php + + echo elgg_view('page_elements/owner_block',array('content' => $vars['area1'])); + + ?> <?php echo $vars['area3']; ?> diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php new file mode 100644 index 000000000..6bc0b86a8 --- /dev/null +++ b/views/default/page_elements/owner_block.php @@ -0,0 +1,40 @@ +<?php
+
+ /**
+ * Elgg owner block
+ * Displays page ownership information
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ */
+
+ echo "<div id=\"owner_block\">";
+ // Is there a page owner?
+ if ($owner = page_owner_entity()) {
+ $icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny'));
+ if ($owner instanceof ElggUser || $owner instanceof ElggGroup) {
+ $info = $owner->name;
+ }
+ $display = "<div id=\"owner_block_icon\">" . $icon . "</div>";
+ $display .= "<div id=\"owner_block_content\">" . $info . "</div>";
+ }
+ echo $display;
+
+ // Have we been asked to inject any content? If so, display it
+ if (isset($vars['content']))
+ echo $vars['content'];
+
+ // Initialise the submenu
+ $submenu = get_submenu(); // elgg_view('canvas_header/submenu');
+ if (!empty($submenu)) $submenu = "<ul>" . $submenu . "</ul>";
+ if (!empty($submenu))
+ echo "<div id=\"owner_block_submenu\">" . $submenu . "</div>"; // plugins can extend this to add menu options
+
+ echo "</div>";
+
+?>
\ No newline at end of file |