diff options
-rw-r--r-- | engine/lib/elgglib.php | 3 | ||||
-rw-r--r-- | entities/index.php | 8 | ||||
-rw-r--r-- | views/default/canvas/layouts/two_column_left_sidebar.php | 8 | ||||
-rw-r--r-- | views/default/page_elements/owner_block.php | 40 |
4 files changed, 54 insertions, 5 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index abfa28b35..d591ca00b 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -559,9 +559,10 @@ * Returns a view for the page title
*
* @param string $title The page title
+ * @param string $submenu Should a submenu be displayed? (default false, use not recommended)
* @return string The HTML (etc)
*/
- function elgg_view_title($title, $submenu = true) {
+ function elgg_view_title($title, $submenu = false) {
$title = elgg_view('page_elements/title', array('title' => $title, 'submenu' => $submenu));
diff --git a/entities/index.php b/entities/index.php index 96da8b790..3e573b338 100644 --- a/entities/index.php +++ b/entities/index.php @@ -27,10 +27,16 @@ // Get the entity, if possible
if ($entity = get_entity($guid)) {
+ if ($entity->container_guid) {
+ set_page_owner($entity->container_guid);
+ } else {
+ set_page_owner($entity->owner_guid);
+ }
+
// Set the body to be the full view of the entity, and the title to be its title
$area2 = elgg_view_entity($entity,true);
if ($shell)
- $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2);
+ $body = elgg_view_layout('two_column_left_sidebar', '', $area1 . $area2);
// Otherwise?
} else {
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 |