summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buddylist_ui/buddylist_ui.module51
1 files changed, 18 insertions, 33 deletions
diff --git a/buddylist_ui/buddylist_ui.module b/buddylist_ui/buddylist_ui.module
index 5916ace..d64effc 100644
--- a/buddylist_ui/buddylist_ui.module
+++ b/buddylist_ui/buddylist_ui.module
@@ -14,21 +14,6 @@ function buddylist_ui_help($section) {
}
/**
- * returns an array of common translation placeholders
- * @return array, translations
- */
-function buddylist_ui_translation() {
- $translations = array (
- '@buddy' => t('buddy'),
- '@Buddy' => t('Buddy'),
- '@buddylist' => t('buddylist'),
- '@Buddylist' => t('Buddylist'),
- '@buddies' => t('buddies'),
- '@Buddies' => t('Buddies'),);
- return variable_get('buddylist_ui_translation', $translations);
-}
-
-/**
* Implementation of hook_perm
* @return array, perms
*/
@@ -49,7 +34,7 @@ function buddylist_ui_menu($may_cache) {
if ($may_cache) {
$items[] = array (
'path' => 'buddylist',
- 'title' => t('My @buddylist', buddylist_ui_translation()),
+ 'title' => t('My @buddylist', buddy_api_translation()),
'callback' => 'theme',
'callback arguments' => array('buddylist_ui_page_buddylist', $id),
'type' => MENU_NORMAL_ITEM,
@@ -60,7 +45,7 @@ function buddylist_ui_menu($may_cache) {
// user page: buddylist
$items[] = array (
'path' => 'buddylist/confirmed',
- 'title' => t('My @Buddies', buddylist_ui_translation()),
+ 'title' => t('My @Buddies', buddy_api_translation()),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 1,
);
@@ -68,7 +53,7 @@ function buddylist_ui_menu($may_cache) {
// user page: pending requests
$items[] = array(
'path' => 'buddylist/requests',
- 'title' => t('My @Buddy Requests', buddylist_ui_translation()),
+ 'title' => t('My @Buddy Requests', buddy_api_translation()),
'access' => $editAccess,
'callback' => 'theme',
'type' => MENU_LOCAL_TASK,
@@ -89,7 +74,7 @@ function buddylist_ui_menu($may_cache) {
else {
$items[] = array (
'path' => 'buddy/add',
- 'title' => t('Add to @buddylist', buddylist_ui_translation()),
+ 'title' => t('Add to @buddylist', buddy_api_translation()),
'access' => $editAccess,
'callback' => 'drupal_get_form',
'callback arguments' => array ('buddylist_ui_addbuddy', arg(2)), 'type' => MENU_CALLBACK,
@@ -97,7 +82,7 @@ function buddylist_ui_menu($may_cache) {
$items[] = array (
'path' => 'buddy/delete',
- 'title' => t('Delete from @buddylist', buddylist_ui_translation()),
+ 'title' => t('Delete from @buddylist', buddy_api_translation()),
'access' => $editAccess,
'callback' => 'drupal_get_form',
'callback arguments' => array ('buddylist_ui_deletebuddy', arg(2)), 'type' => MENU_CALLBACK,
@@ -328,7 +313,7 @@ function buddylist_ui_user($type, & $edit, & $thisuser, $category = NULL) {
$output[] = theme('buddylist_ui_user_buddies', $thisuser);
$output[] = theme('buddylist_ui_user_actions', $thisuser);
if (count($output) > 0)
- return array (t('@Buddylist', buddylist_ui_translation()) => $output);
+ return array (t('@Buddylist', buddy_api_translation()) => $output);
}
else
if ($type == 'delete') {
@@ -357,10 +342,10 @@ function buddylist_ui_addbuddy($uid) {
drupal_set_message(t('This user does not exist'));
}
elseif (in_array($uid, array_keys(buddy_api_get_buddies($user->uid)))) {
- drupal_set_message(t('This user is already on your @buddylist', buddylist_ui_translation()));
+ drupal_set_message(t('This user is already on your @buddylist', buddy_api_translation()));
}
elseif ($user->uid == $uid) {
- drupal_set_message(t('Cannot add yourself to @buddylist', buddylist_ui_translation()));
+ drupal_set_message(t('Cannot add yourself to @buddylist', buddy_api_translation()));
}
else {
$form['requester_account'] = array (
@@ -378,7 +363,7 @@ function buddylist_ui_addbuddy($uid) {
);
$output = confirm_form($form, t('Add user %name to your @buddylist?', array (
'%name' => $buddy->name
- ) + buddylist_ui_translation()), $_GET['destination'], '', t('Add'), t('Cancel'), 'buddylist_ui_addbuddy_confirm');
+ ) + buddy_api_translation()), $_GET['destination'], '', t('Add'), t('Cancel'), 'buddylist_ui_addbuddy_confirm');
return $output;
}
drupal_goto();
@@ -415,7 +400,7 @@ function buddylist_ui_deletebuddy($uid) {
}
else
if (!in_array($uid, array_keys(buddy_api_get_buddies($user->uid)))) {
- drupal_set_message('This user is not on your @buddylist', buddylist_ui_translation());
+ drupal_set_message('This user is not on your @buddylist', buddy_api_translation());
}
else {
$form['requester_account'] = array (
@@ -428,7 +413,7 @@ function buddylist_ui_deletebuddy($uid) {
);
$output = confirm_form($form, t('Remove user %name from your @buddylist?', array (
'%name' => $buddy->name
- ) + buddylist_ui_translation()), $_GET['destination'], '', t('Remove'), t('Cancel'), 'buddylist_ui_deletebuddy_confirm');
+ ) + buddy_api_translation()), $_GET['destination'], '', t('Remove'), t('Cancel'), 'buddylist_ui_deletebuddy_confirm');
return $output;
}
drupal_goto();
@@ -451,7 +436,7 @@ function buddylist_ui_deletebuddy_submit($form_id, $form_values) {
function theme_buddylist_ui_action_add_buddy($buddyuser) {
return l(t('Add %name to my @buddylist', array (
'%name' => $buddyuser->name
- ) + buddylist_ui_translation()), 'buddy/add/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
+ ) + buddy_api_translation()), 'buddy/add/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
}
/**
@@ -461,7 +446,7 @@ function theme_buddylist_ui_action_add_buddy($buddyuser) {
function theme_buddylist_ui_action_remove_buddy($buddyuser) {
return l(t('Remove %name from my @buddylist', array (
'%name' => $buddyuser->name
- ) + buddylist_ui_translation()), 'buddy/delete/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
+ ) + buddy_api_translation()), 'buddy/delete/' . $buddyuser->uid, NULL, drupal_get_destination(), NULL, FALSE, TRUE);
}
/**
@@ -472,7 +457,7 @@ function theme_buddylist_ui_action_sent_request($buddyuser) {
return t('You have requested to add %name to your @buddylist. (See !your_pending_requests)', array (
'%name' => $buddyuser->name,
'!your_pending_requests' => l(t('your pending requests'
- ), 'buddylist/requests')) + buddylist_ui_translation());
+ ), 'buddylist/requests')) + buddy_api_translation());
}
/**
@@ -483,7 +468,7 @@ function theme_buddylist_ui_action_confirm_request($buddyuser) {
return t('%name has requested to add you to your @buddylist. (See !your_pending_requests)', array (
'%name' => $buddyuser->name,
'!your_pending_requests' => l(t('your pending requests'
- ), 'buddylist/requests')) + buddylist_ui_translation());
+ ), 'buddylist/requests')) + buddy_api_translation());
}
/**
@@ -492,7 +477,7 @@ function theme_buddylist_ui_action_confirm_request($buddyuser) {
* @return string, html formatted output
*/
function theme_buddylist_ui_page_buddylist() {
- drupal_set_title(t('@Buddylist', buddylist_ui_translation()));
+ drupal_set_title(t('@Buddylist', buddy_api_translation()));
$view = views_get_view('buddy_api_buddylist');
$title = views_get_title($view);
$view_buddylist = views_build_view('embed', $view, array(), FALSE);
@@ -549,7 +534,7 @@ function theme_buddylist_ui_user_buddies($buddyuser) {
}
$output .= $view_buddylist;
- return array ('title' => t('@Buddies', buddylist_ui_translation()), 'value' => theme_box('', $output, $region = 'main'));
+ return array ('title' => t('@Buddies', buddy_api_translation()), 'value' => theme_box('', $output, $region = 'main'));
}
/**
@@ -565,5 +550,5 @@ function theme_buddylist_ui_user_actions($buddyuser) {
// Return actions as a list, if there are any
if ($actions)
- return array ('title' => t('@Buddy actions', buddylist_ui_translation()), 'value' => theme('item_list', $actions), 'class' => 'buddylist_actions');
+ return array ('title' => t('@Buddy actions', buddy_api_translation()), 'value' => theme('item_list', $actions), 'class' => 'buddylist_actions');
} \ No newline at end of file