aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-06-27 03:12:42 -0700
committerCash Costello <cash.costello@gmail.com>2011-06-27 03:12:42 -0700
commite82534d0bceb80f7a9e7ba8f00748ee1eb32b214 (patch)
treeae8e98a12caa77f78dbfdbc9c492ee808c411c1c /views/default
parent33f5c59d5318bc1e9a607215a31e48c6f7ab5b29 (diff)
parentfe1e3b3923659a4bea73e1596e0ba946f473635c (diff)
downloadelgg-e82534d0bceb80f7a9e7ba8f00748ee1eb32b214.tar.gz
elgg-e82534d0bceb80f7a9e7ba8f00748ee1eb32b214.tar.bz2
Merge pull request #52 from cash/banishing-auto-button
Fixes #3616 Banishing auto 'add' button
Diffstat (limited to 'views/default')
-rw-r--r--views/default/page/layouts/content.php1
-rw-r--r--views/default/page/layouts/content/header.php30
2 files changed, 10 insertions, 21 deletions
diff --git a/views/default/page/layouts/content.php b/views/default/page/layouts/content.php
index 35d695f0a..c406c9faf 100644
--- a/views/default/page/layouts/content.php
+++ b/views/default/page/layouts/content.php
@@ -10,7 +10,6 @@
* @uses $vars['filter'] HTML of the content area filter (override)
* @uses $vars['title'] Title text (override)
* @uses $vars['context'] Page context (override)
- * @uses $vars['buttons'] Content header buttons (override)
* @uses $vars['filter_context'] Filter context: everyone, friends, mine
* @uses $vars['class'] Additional class to apply to layout
*/
diff --git a/views/default/page/layouts/content/header.php b/views/default/page/layouts/content/header.php
index 403da8a0a..345163bdd 100644
--- a/views/default/page/layouts/content/header.php
+++ b/views/default/page/layouts/content/header.php
@@ -7,9 +7,13 @@
* @uses $vars['header_override'] HTML for overriding the default header (override)
* @uses $vars['title'] Title text (override)
* @uses $vars['context'] Page context (override)
- * @uses $vars['buttons'] Content header buttons (override)
*/
+if (isset($vars['buttons'])) {
+ // it was a bad idea to implement buttons with a pass through
+ elgg_deprecated_notice("Use elgg_register_menu_item() to register for the title menu", 1.0);
+}
+
if (isset($vars['header_override'])) {
echo $vars['header_override'];
return true;
@@ -22,27 +26,13 @@ if ($context) {
$title = elgg_echo($context);
}
- if (isset($vars['buttons'])) {
+ if (isset($vars['buttons']) && $vars['buttons']) {
$buttons = $vars['buttons'];
} else {
- if (elgg_is_logged_in() && $context) {
- $owner = elgg_get_page_owner_entity();
- if (!$owner) {
- // this is probably an all page
- $owner = elgg_get_logged_in_user_entity();
- }
- if ($owner && $owner->canWriteToContainer()) {
- $guid = $owner->getGUID();
- elgg_register_menu_item('title', array(
- 'name' => 'add',
- 'href' => elgg_extract('new_link', $vars, "$context/add/$guid"),
- 'text' => elgg_echo("$context:add"),
- 'link_class' => 'elgg-button elgg-button-action',
- ));
- }
- }
-
- $buttons = elgg_view_menu('title', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
+ $buttons = elgg_view_menu('title', array(
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+ ));
}
echo <<<HTML
<div class="elgg-head clearfix">