aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-07-06 06:51:53 -0400
committerCash Costello <cash.costello@gmail.com>2011-07-06 06:51:53 -0400
commitd15c4bdf3388b7eca709bd81c522ac1ebf087f0a (patch)
treef8d7ce9e0e8a36be07041fef133d964628ff2d01
parent9b042da78566d284d71ca5299d9f9402c49d36ba (diff)
downloadelgg-d15c4bdf3388b7eca709bd81c522ac1ebf087f0a.tar.gz
elgg-d15c4bdf3388b7eca709bd81c522ac1ebf087f0a.tar.bz2
changed new convenience function from elgg_register_add_button() to elgg_register_title_button()
-rw-r--r--engine/lib/navigation.php17
-rw-r--r--mod/blog/lib/blog.php4
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php2
-rw-r--r--mod/bookmarks/pages/bookmarks/friends.php2
-rw-r--r--mod/bookmarks/pages/bookmarks/owner.php2
-rw-r--r--mod/file/pages/file/friends.php2
-rw-r--r--mod/file/pages/file/owner.php2
-rw-r--r--mod/file/pages/file/world.php2
-rw-r--r--mod/groups/lib/discussion.php2
-rw-r--r--mod/groups/lib/groups.php6
-rw-r--r--mod/messages/pages/messages/inbox.php2
-rw-r--r--mod/messages/pages/messages/sent.php2
-rw-r--r--mod/pages/pages/pages/friends.php2
-rw-r--r--mod/pages/pages/pages/owner.php2
-rw-r--r--mod/pages/pages/pages/world.php2
15 files changed, 27 insertions, 24 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php
index cdf3d0f67..1305ee3de 100644
--- a/engine/lib/navigation.php
+++ b/engine/lib/navigation.php
@@ -154,17 +154,20 @@ function elgg_is_menu_item_registered($menu_name, $item_name) {
}
/**
- * Convenience function for registering an add content button to title menu
+ * Convenience function for registering a button to title menu
*
- * The add URL must be $handler/add/$guid where $guid is the guid of the page owner.
- * The label of the button is "$handler:add" so that must be defined in a
+ * The URL must be $handler/$name/$guid where $guid is the guid of the page owner.
+ * The label of the button is "$handler:$name" so that must be defined in a
* language file.
*
+ * This is used primarily to support adding an add content button
+ *
* @param string $handler The handler to use or null to autodetect from context
+ * @param string $name Name of the button
* @return void
* @since 1.8.0
*/
-function elgg_register_add_button($handler = null) {
+function elgg_register_title_button($handler = null, $name = 'add') {
if (elgg_is_logged_in()) {
if (!$handler) {
@@ -179,9 +182,9 @@ function elgg_register_add_button($handler = null) {
if ($owner && $owner->canWriteToContainer()) {
$guid = $owner->getGUID();
elgg_register_menu_item('title', array(
- 'name' => 'add',
- 'href' => "$handler/add/$guid",
- 'text' => elgg_echo("$handler:add"),
+ 'name' => $name,
+ 'href' => "$handler/$name/$guid",
+ 'text' => elgg_echo("$handler:$name"),
'link_class' => 'elgg-button elgg-button-action',
));
}
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 0f81597eb..b7b1a2baa 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -92,7 +92,7 @@ function blog_get_page_content_list($container_guid = NULL) {
elgg_push_breadcrumb(elgg_echo('blog:blogs'));
}
- elgg_register_add_button();
+ elgg_register_title_button();
// show all posts for admin or users looking at their own blogs
// show only published posts for other users.
@@ -131,7 +131,7 @@ function blog_get_page_content_friends($user_guid) {
elgg_push_breadcrumb($crumbs_title, "blog/owner/{$user->username}");
elgg_push_breadcrumb(elgg_echo('friends'));
- elgg_register_add_button();
+ elgg_register_title_button();
if (!$friends = get_user_friends($user_guid, ELGG_ENTITIES_ANY_VALUE, 0)) {
$return['content'] .= elgg_echo('friends:none:you');
diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php
index 7b3f2059c..d9ac2767f 100644
--- a/mod/bookmarks/pages/bookmarks/all.php
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -8,7 +8,7 @@
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo('bookmarks'));
-elgg_register_add_button();
+elgg_register_title_button();
$offset = (int)get_input('offset', 0);
$content = elgg_list_entities(array(
diff --git a/mod/bookmarks/pages/bookmarks/friends.php b/mod/bookmarks/pages/bookmarks/friends.php
index ef5f078f5..3491090a5 100644
--- a/mod/bookmarks/pages/bookmarks/friends.php
+++ b/mod/bookmarks/pages/bookmarks/friends.php
@@ -10,7 +10,7 @@ $owner = elgg_get_page_owner_entity();
elgg_push_breadcrumb($owner->name, "bookmarks/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-elgg_register_add_button();
+elgg_register_title_button();
$title = elgg_echo('bookmarks:friends');
diff --git a/mod/bookmarks/pages/bookmarks/owner.php b/mod/bookmarks/pages/bookmarks/owner.php
index 46a22080d..679c986be 100644
--- a/mod/bookmarks/pages/bookmarks/owner.php
+++ b/mod/bookmarks/pages/bookmarks/owner.php
@@ -9,7 +9,7 @@ $page_owner = elgg_get_page_owner_entity();
elgg_push_breadcrumb($page_owner->name);
-elgg_register_add_button();
+elgg_register_title_button();
$offset = (int)get_input('offset', 0);
$content .= elgg_list_entities(array(
diff --git a/mod/file/pages/file/friends.php b/mod/file/pages/file/friends.php
index 7bde42962..0b351efaf 100644
--- a/mod/file/pages/file/friends.php
+++ b/mod/file/pages/file/friends.php
@@ -11,7 +11,7 @@ elgg_push_breadcrumb(elgg_echo('file'), "file/all");
elgg_push_breadcrumb($owner->name, "file/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-elgg_register_add_button();
+elgg_register_title_button();
$title = elgg_echo("file:friends");
diff --git a/mod/file/pages/file/owner.php b/mod/file/pages/file/owner.php
index 2244de095..4e2ec89d4 100644
--- a/mod/file/pages/file/owner.php
+++ b/mod/file/pages/file/owner.php
@@ -13,7 +13,7 @@ $owner = elgg_get_page_owner_entity();
elgg_push_breadcrumb(elgg_echo('file'), "file/all");
elgg_push_breadcrumb($owner->name);
-elgg_register_add_button();
+elgg_register_title_button();
$params = array();
diff --git a/mod/file/pages/file/world.php b/mod/file/pages/file/world.php
index 560743bed..e438ca2f0 100644
--- a/mod/file/pages/file/world.php
+++ b/mod/file/pages/file/world.php
@@ -7,7 +7,7 @@
elgg_push_breadcrumb(elgg_echo('file'));
-elgg_register_add_button();
+elgg_register_title_button();
$limit = get_input("limit", 10);
diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php
index 52df7e18d..e129e0f9d 100644
--- a/mod/groups/lib/discussion.php
+++ b/mod/groups/lib/discussion.php
@@ -45,7 +45,7 @@ function discussion_handle_list_page($guid) {
}
elgg_push_breadcrumb($group->name);
- elgg_register_add_button();
+ elgg_register_title_button();
group_gatekeeper();
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 2747f360b..126738566 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -12,7 +12,7 @@ function groups_handle_all_page() {
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo('groups'));
- elgg_register_add_button();
+ elgg_register_title_button();
$selected_tab = get_input('filter', 'newest');
@@ -100,7 +100,7 @@ function groups_handle_owned_page() {
$title = elgg_echo('groups:owned');
elgg_push_breadcrumb($title);
- elgg_register_add_button();
+ elgg_register_title_button();
$content = elgg_list_entities(array(
'type' => 'group',
@@ -128,7 +128,7 @@ function groups_handle_mine_page() {
$title = elgg_echo('groups:yours');
elgg_push_breadcrumb($title);
- elgg_register_add_button();
+ elgg_register_title_button();
$content = elgg_list_entities_from_relationship_count(array(
'type' => 'group',
diff --git a/mod/messages/pages/messages/inbox.php b/mod/messages/pages/messages/inbox.php
index 96712a193..fdfc20c43 100644
--- a/mod/messages/pages/messages/inbox.php
+++ b/mod/messages/pages/messages/inbox.php
@@ -15,7 +15,7 @@ if (!$page_owner) {
elgg_push_breadcrumb(elgg_echo('messages:inbox'));
-elgg_register_add_button();
+elgg_register_title_button();
$title = elgg_echo('messages:user', array($page_owner->name));
diff --git a/mod/messages/pages/messages/sent.php b/mod/messages/pages/messages/sent.php
index edf2b29fb..af06ab273 100644
--- a/mod/messages/pages/messages/sent.php
+++ b/mod/messages/pages/messages/sent.php
@@ -15,7 +15,7 @@ if (!$page_owner) {
elgg_push_breadcrumb(elgg_echo('messages:sent'));
-elgg_register_add_button();
+elgg_register_title_button();
$title = elgg_echo('messages:sentmessages', array($page_owner->name));
diff --git a/mod/pages/pages/pages/friends.php b/mod/pages/pages/pages/friends.php
index 88f26c45d..c55b27466 100644
--- a/mod/pages/pages/pages/friends.php
+++ b/mod/pages/pages/pages/friends.php
@@ -13,7 +13,7 @@ if (!$owner) {
elgg_push_breadcrumb($owner->name, "pages/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
-elgg_register_add_button();
+elgg_register_title_button();
$title = elgg_echo('pages:friends');
diff --git a/mod/pages/pages/pages/owner.php b/mod/pages/pages/pages/owner.php
index 312b56a54..2ff310ac8 100644
--- a/mod/pages/pages/pages/owner.php
+++ b/mod/pages/pages/pages/owner.php
@@ -17,7 +17,7 @@ $title = elgg_echo('pages:owner', array($owner->name));
elgg_push_breadcrumb($owner->name);
-elgg_register_add_button();
+elgg_register_title_button();
$content = elgg_list_entities(array(
'types' => 'object',
diff --git a/mod/pages/pages/pages/world.php b/mod/pages/pages/pages/world.php
index 9237a820e..e6a705b6b 100644
--- a/mod/pages/pages/pages/world.php
+++ b/mod/pages/pages/pages/world.php
@@ -10,7 +10,7 @@ $title = elgg_echo('pages:all');
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo('pages'));
-elgg_register_add_button();
+elgg_register_title_button();
$content = elgg_list_entities(array(
'types' => 'object',