- $insertAt = count($stats);
- foreach ($stats as $i => $row) {
- if ($row['id'] == 'groups') {
- // Slip us in after them.
- $insertAt = $i + 1;
- break;
- }
+ function onHelpCommandMessages($cmd, &$commands)
+ {
+ // TRANS: Help message for IM/SMS command "track <word>"
+ $commands["track <word>"] = _m('COMMANDHELP', "Start following notices matching the given search query.");
+ // TRANS: Help message for IM/SMS command "untrack <word>"
+ $commands["untrack <word>"] = _m('COMMANDHELP', "Stop following notices matching the given search query.");
+ // TRANS: Help message for IM/SMS command "track off"
+ $commands["track off"] = _m('COMMANDHELP', "Disable all tracked search subscriptions.");
+ // TRANS: Help message for IM/SMS command "untrack all"
+ $commands["untrack all"] = _m('COMMANDHELP', "Disable all tracked search subscriptions.");
+ // TRANS: Help message for IM/SMS command "tracks"
+ $commands["tracks"] = _m('COMMANDHELP', "List all your search subscriptions.");
+ // TRANS: Help message for IM/SMS command "tracking"
+ $commands["tracking"] = _m('COMMANDHELP', "List all your search subscriptions.");
+ }
+
+ function onEndDefaultLocalNav($menu, $user)
+ {
+ $user = common_current_user();
+
+ if (!empty($user)) {
+ $searches = SearchSub::forProfile($user->getProfile());
+
+ if (!empty($searches) && count($searches) > 0) {
+ $searchSubMenu = new SearchSubMenu($menu->out, $user, $searches);
+ // TRANS: Sub menu for searches.
+ $menu->submenu(_m('MENU','Searches'), $searchSubMenu);