]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
changed new convenience function from elgg_register_add_button() to elgg_register_tit...
authorCash Costello <cash.costello@gmail.com>
Wed, 6 Jul 2011 10:51:53 +0000 (06:51 -0400)
committerCash Costello <cash.costello@gmail.com>
Wed, 6 Jul 2011 10:51:53 +0000 (06:51 -0400)
15 files changed:
engine/lib/navigation.php
mod/blog/lib/blog.php
mod/bookmarks/pages/bookmarks/all.php
mod/bookmarks/pages/bookmarks/friends.php
mod/bookmarks/pages/bookmarks/owner.php
mod/file/pages/file/friends.php
mod/file/pages/file/owner.php
mod/file/pages/file/world.php
mod/groups/lib/discussion.php
mod/groups/lib/groups.php
mod/messages/pages/messages/inbox.php
mod/messages/pages/messages/sent.php
mod/pages/pages/pages/friends.php
mod/pages/pages/pages/owner.php
mod/pages/pages/pages/world.php

index cdf3d0f671e41575034bd8cc2082f6ed63bc5556..1305ee3def1009276eee188bfe0faafee33790bf 100644 (file)
@@ -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',
                        ));
                }
index 0f81597ebf983791f91d3abe25975dc68d39707d..b7b1a2baa8a867137058aaff35dadabf0cafe611 100644 (file)
@@ -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');
index 7b3f2059c72f03e5534ae87b48f291843724239a..d9ac2767fccc99bc2e627625c9b4388824b2e56c 100644 (file)
@@ -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(
index ef5f078f5b58a087b152a6b820019c39625de05a..3491090a5676548da07e49b1bbe8f44735316703 100644 (file)
@@ -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');
 
index 46a22080dd5fb7e43380f624b48aa6eb58f71024..679c986bef6c21a9dbe928e040cd3896067426a2 100644 (file)
@@ -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(
index 7bde42962cfa6bca0f32c9a10c36a1b4c1abe01c..0b351efaf59b18ae83098fb3bc13804e49baf5f8 100644 (file)
@@ -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");
 
index 2244de095443b166eedef70a829908034f37d698..4e2ec89d4170ecd4ba4d86db83c2a934ce973aa6 100644 (file)
@@ -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();
 
index 560743bed15c0833fe1ef949adb6ae975f6bb53e..e438ca2f0d2614aaa35906b931e679424da73c7f 100644 (file)
@@ -7,7 +7,7 @@
 
 elgg_push_breadcrumb(elgg_echo('file'));
 
-elgg_register_add_button();
+elgg_register_title_button();
 
 $limit = get_input("limit", 10);
 
index 52df7e18d4e543ecb4cc7bda871b2a8ac714a681..e129e0f9d3c0b08da0677d6bdd3efda78d03d0ce 100644 (file)
@@ -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();
 
index 2747f360ba5186b4c6153e44138848d23838f95c..1267385664adde321107b55102a5359b748140d3 100644 (file)
@@ -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',
index 96712a1933b175879006193e63df0c07c27020a4..fdfc20c43f02ac787fe497a9a2022223a92db178 100644 (file)
@@ -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));
 
index edf2b29fb8172af9a9bc99be197f5941f267c49e..af06ab273d17f297cca93b4af27113f65975ec80 100644 (file)
@@ -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));
 
index 88f26c45db2a1affd3010a9abfc913db6366b5ad..c55b274665fa993d6ae44ac3d24b4f81701b9784 100644 (file)
@@ -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');
 
index 312b56a54fbd5c23a86a2fec97984a13244bcd56..2ff310ac88005fe1a11b71fd1623de6be38d0f5c 100644 (file)
@@ -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',
index 9237a820e2862dae86690fb785116ceb827e9eaa..e6a705b6bbca1d2b49ed6be3b78d368ffdb602a5 100644 (file)
@@ -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',