From ca5c2911327cdbffb5bee1d44d1f673025fcdbce Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 8 Dec 2010 00:55:39 +0000 Subject: moved a few elements to layout from page git-svn-id: http://code.elgg.org/elgg/trunk@7556 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/layout/elements/owner_block.php | 77 ++++++++++++++++++++++ views/default/layout/elements/sidebar.php | 27 ++++++++ views/default/layout/elements/title.php | 22 +++++++ views/default/layout/shells/administration.php | 2 +- .../layout/shells/one_column_with_sidebar.php | 2 +- views/default/layout/shells/one_sidebar.php | 2 +- views/default/layout/shells/two_sidebar.php | 4 +- views/default/page_elements/owner_block.php | 77 ---------------------- views/default/page_elements/sidebar.php | 27 -------- views/default/page_elements/title.php | 22 ------- 10 files changed, 131 insertions(+), 131 deletions(-) create mode 100644 views/default/layout/elements/owner_block.php create mode 100644 views/default/layout/elements/sidebar.php create mode 100644 views/default/layout/elements/title.php delete mode 100644 views/default/page_elements/owner_block.php delete mode 100644 views/default/page_elements/sidebar.php delete mode 100644 views/default/page_elements/title.php (limited to 'views') diff --git a/views/default/layout/elements/owner_block.php b/views/default/layout/elements/owner_block.php new file mode 100644 index 000000000..66fc180dd --- /dev/null +++ b/views/default/layout/elements/owner_block.php @@ -0,0 +1,77 @@ +{$label} +END; +} + +if(is_plugin_enabled('profile')) { + // Is there a page owner? + $owner = elgg_get_page_owner(); + if ($owner instanceof ElggGroup || + ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid()) + ) { + $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); + $owner_url = $owner->getURL(); + $display = "
$icon
"; + $display .= '
'; + $display .= "

{$owner->name}

"; + + if ($owner->briefdescription) { + $display .= "

{$owner->briefdescription}

"; + } + + $location = elgg_view('output/tags', array('value' => $owner->location)); + $display .= "

$location

"; + + $display .= '
'; + + // Trigger owner block menu + $params = array('owner' => $owner); + $links = elgg_trigger_plugin_hook('profile_menu', 'profile', $params, array()); + if (is_array($links) && !empty($links)) { + // sort the links by name + usort($links, create_function( + '$a, $b', + 'return strnatcasecmp($a[\'text\'], $b[\'text\']);' + )); + + $display .= ''; + } + + // Allow plugins to extend the owner block contents + $display .= elgg_view('owner_block/profile_extend'); + + $contents .= "
$display
"; + } +} + +$contents .= elgg_view('owner_block/extend'); + + +echo $contents; diff --git a/views/default/layout/elements/sidebar.php b/views/default/layout/elements/sidebar.php new file mode 100644 index 000000000..d1323f2cd --- /dev/null +++ b/views/default/layout/elements/sidebar.php @@ -0,0 +1,27 @@ +" . $vars['title'] . ""; + +$submenu = elgg_get_submenu(); +if (!empty($submenu)) { + $submenu = ""; +} + +if (!empty($submenu) && $vars['submenu'] == true) { + // plugins can extend this to add menu options + $display .= $submenu; +} + +echo $display; \ No newline at end of file diff --git a/views/default/layout/shells/administration.php b/views/default/layout/shells/administration.php index f7ed84935..f9f5e3caa 100644 --- a/views/default/layout/shells/administration.php +++ b/views/default/layout/shells/administration.php @@ -29,7 +29,7 @@
diff --git a/views/default/layout/shells/one_column_with_sidebar.php b/views/default/layout/shells/one_column_with_sidebar.php index e408c6c1c..6698b7372 100644 --- a/views/default/layout/shells/one_column_with_sidebar.php +++ b/views/default/layout/shells/one_column_with_sidebar.php @@ -13,7 +13,7 @@
diff --git a/views/default/layout/shells/one_sidebar.php b/views/default/layout/shells/one_sidebar.php index d0bb3879f..2e78b0de6 100644 --- a/views/default/layout/shells/one_sidebar.php +++ b/views/default/layout/shells/one_sidebar.php @@ -13,7 +13,7 @@
diff --git a/views/default/layout/shells/two_sidebar.php b/views/default/layout/shells/two_sidebar.php index 26fb64920..d0a6825c9 100644 --- a/views/default/layout/shells/two_sidebar.php +++ b/views/default/layout/shells/two_sidebar.php @@ -14,7 +14,7 @@
@@ -24,7 +24,7 @@ $params = array( 'sidebar' => elgg_view('layout_elements/module', array('title' => 'Testing', 'body' => 'Hello, world!')) ); - echo elgg_view('page_elements/sidebar', $params); + echo elgg_view('layout/elements/sidebar', $params); ?>
diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php deleted file mode 100644 index 66fc180dd..000000000 --- a/views/default/page_elements/owner_block.php +++ /dev/null @@ -1,77 +0,0 @@ -{$label}
-END; -} - -if(is_plugin_enabled('profile')) { - // Is there a page owner? - $owner = elgg_get_page_owner(); - if ($owner instanceof ElggGroup || - ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid()) - ) { - $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); - $owner_url = $owner->getURL(); - $display = "
$icon
"; - $display .= '
'; - $display .= "

{$owner->name}

"; - - if ($owner->briefdescription) { - $display .= "

{$owner->briefdescription}

"; - } - - $location = elgg_view('output/tags', array('value' => $owner->location)); - $display .= "

$location

"; - - $display .= '
'; - - // Trigger owner block menu - $params = array('owner' => $owner); - $links = elgg_trigger_plugin_hook('profile_menu', 'profile', $params, array()); - if (is_array($links) && !empty($links)) { - // sort the links by name - usort($links, create_function( - '$a, $b', - 'return strnatcasecmp($a[\'text\'], $b[\'text\']);' - )); - - $display .= ''; - } - - // Allow plugins to extend the owner block contents - $display .= elgg_view('owner_block/profile_extend'); - - $contents .= "
$display
"; - } -} - -$contents .= elgg_view('owner_block/extend'); - - -echo $contents; diff --git a/views/default/page_elements/sidebar.php b/views/default/page_elements/sidebar.php deleted file mode 100644 index 8a5574da6..000000000 --- a/views/default/page_elements/sidebar.php +++ /dev/null @@ -1,27 +0,0 @@ -" . $vars['title'] . ""; - -$submenu = elgg_get_submenu(); -if (!empty($submenu)) { - $submenu = ""; -} - -if (!empty($submenu) && $vars['submenu'] == true) { - // plugins can extend this to add menu options - $display .= $submenu; -} - -echo $display; \ No newline at end of file -- cgit v1.2.3