diff options
author | Paul Arthur <flowerysong00@yahoo.com> | 2012-03-31 17:01:04 -0400 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2012-04-12 21:13:29 -0400 |
commit | f65076b93d91fe9718cf9bef37638d64290b9f28 (patch) | |
tree | 40fbc65baffab34971d8c7b685ef9c99e0f4014f /admin | |
parent | 15457b16f17a141fa76a3b9882892362b601787c (diff) | |
download | ampache-f65076b93d91fe9718cf9bef37638d64290b9f28.tar.gz ampache-f65076b93d91fe9718cf9bef37638d64290b9f28.tar.bz2 ampache-f65076b93d91fe9718cf9bef37638d64290b9f28.zip |
Switch from _() to T_()
Even if we move away from php-gettext in the future, it's easy to
write a quick T_() as a simple wrapper; it's not so easy to rewrite
PHP to allow redeclaration of a function.
Diffstat (limited to 'admin')
-rw-r--r-- | admin/access.php | 8 | ||||
-rw-r--r-- | admin/catalog.php | 38 | ||||
-rw-r--r-- | admin/flag.php | 18 | ||||
-rw-r--r-- | admin/mail.php | 8 | ||||
-rw-r--r-- | admin/modules.php | 20 | ||||
-rw-r--r-- | admin/shout.php | 4 | ||||
-rw-r--r-- | admin/system.php | 2 | ||||
-rw-r--r-- | admin/users.php | 36 |
8 files changed, 67 insertions, 67 deletions
diff --git a/admin/access.php b/admin/access.php index cf570524..154d277a 100644 --- a/admin/access.php +++ b/admin/access.php @@ -43,12 +43,12 @@ switch ($_REQUEST['action']) { } Access::delete($_REQUEST['access_id']); $url = Config::get('web_path') . '/admin/access.php'; - show_confirmation(_('Deleted'),_('Your Access List Entry has been removed'),$url); + show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'),$url); break; case 'show_delete_record': if (Config::get('demo_mode')) { break; } $access = new Access($_GET['access_id']); - show_confirmation(_('Deletion Request'),_('Are you sure you want to permanently delete') . ' ' . $access->name, + show_confirmation(T_('Deletion Request'), T_('Are you sure you want to permanently delete') . ' ' . $access->name, 'admin/access.php?action=delete_record&access_id=' . $access->id,1,'delete_access'); break; case 'add_host': @@ -107,7 +107,7 @@ switch ($_REQUEST['action']) { if (!Error::occurred()) { $url = Config::get('web_path') . '/admin/access.php'; - show_confirmation(_('Added'),_('Your new Access Control List(s) have been created'),$url); + show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'),$url); } else { switch ($_GET['method']) { @@ -127,7 +127,7 @@ switch ($_REQUEST['action']) { $access = new Access($_REQUEST['access_id']); $access->update($_POST); if (!Error::occurred()) { - show_confirmation(_('Updated'),_('Access List Entry updated'), Config::get('web_path').'/admin/access.php'); + show_confirmation(T_('Updated'), T_('Access List Entry updated'), Config::get('web_path').'/admin/access.php'); } else { $access->format(); diff --git a/admin/catalog.php b/admin/catalog.php index 1a847c8d..62c8657b 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -57,7 +57,7 @@ switch ($_REQUEST['action']) { } } $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog Updated'); + $title = T_('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); @@ -77,7 +77,7 @@ switch ($_REQUEST['action']) { } } $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog Updated'); + $title = T_('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); @@ -103,7 +103,7 @@ switch ($_REQUEST['action']) { } Catalog::optimize_tables(); $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog Updated'); + $title = T_('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); @@ -120,13 +120,13 @@ switch ($_REQUEST['action']) { /* Delete the sucker, we don't need to check perms as thats done above */ Catalog::delete($_GET['catalog_id']); $next_url = Config::get('web_path') . '/admin/catalog.php'; - show_confirmation(_('Catalog Deleted'),_('The Catalog and all associated records have been deleted'),$next_url); + show_confirmation(T_('Catalog Deleted'), T_('The Catalog and all associated records have been deleted'),$next_url); break; case 'show_delete_catalog': $catalog_id = scrub_in($_GET['catalog_id']); $next_url = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($catalog_id); - show_confirmation(_('Catalog Delete'),_('Confirm Deletion Request'),$next_url,1,'delete_catalog'); + show_confirmation(T_('Catalog Delete'), T_('Confirm Deletion Request'),$next_url,1,'delete_catalog'); break; case 'remove_disabled': if (conf('demo_mode')) { break; } @@ -138,7 +138,7 @@ switch ($_REQUEST['action']) { $body = ngettext('Song Removed', 'Songs Removed', count($song)); } else { - $body = _('No Songs Removed'); + $body = T_('No Songs Removed'); } $url = Config::get('web_path') . '/admin/catalog.php'; $title = ngettext('Disabled Song Processed','Disabled Songs Processed',count($song)); @@ -163,7 +163,7 @@ switch ($_REQUEST['action']) { } $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog Cleaned'); + $title = T_('Catalog Cleaned'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); @@ -176,7 +176,7 @@ switch ($_REQUEST['action']) { Catalog::update_settings($_POST); $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog Updated'); + $title = T_('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); break; @@ -207,14 +207,14 @@ switch ($_REQUEST['action']) { ob_end_flush(); if (!strlen($_POST['path']) || !strlen($_POST['name'])) { - Error::add('general',_('Error: Name and path not specified')); + Error::add('general', T_('Error: Name and path not specified')); } if (substr($_POST['path'],0,7) != 'http://' && $_POST['type'] == 'remote') { - Error::add('general',_('Error: Remote selected, but path is not a URL')); + Error::add('general', T_('Error: Remote selected, but path is not a URL')); } if ($POST['type'] == 'remote' AND (!strlen($POST['remote_username']) OR !strlen($POST['remote_password']))) { - Error::add('general',_('Error: Username and Password Required for Remote Catalogs')); + Error::add('general', T_('Error: Username and Password Required for Remote Catalogs')); } if (!Core::form_verify('add_catalog','post')) { @@ -224,7 +224,7 @@ switch ($_REQUEST['action']) { // Make sure that there isn't a catalog with a directory above this one if (Catalog::get_from_path($_POST['path'])) { - Error::add('general',_('Error: Defined Path is inside an existing catalog')); + Error::add('general', T_('Error: Defined Path is inside an existing catalog')); } // If an error hasn't occured @@ -242,8 +242,8 @@ switch ($_REQUEST['action']) { // Run our initial add $catalog->run_add($_POST); - show_box_top(_('Catalog Created'), 'box box_catalog_created'); - echo "<h2>" . _('Catalog Created') . "</h2>"; + show_box_top(T_('Catalog Created'), 'box box_catalog_created'); + echo "<h2>" . T_('Catalog Created') . "</h2>"; Error::display('general'); Error::display('catalog_add'); show_box_bottom(); @@ -260,7 +260,7 @@ switch ($_REQUEST['action']) { Catalog::clear_stats(); $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Catalog statistics cleared'); + $title = T_('Catalog statistics cleared'); $body = ''; show_confirmation($title,$body,$url); break; @@ -274,7 +274,7 @@ switch ($_REQUEST['action']) { case 'clear_now_playing': if (Config::get('demo_mode')) { access_denied(); break; } Stream::clear_now_playing(); - show_confirmation(_('Now Playing Cleared'),_('All now playing data has been cleared'),Config::get('web_path') . '/admin/catalog.php'); + show_confirmation(T_('Now Playing Cleared'), T_('All now playing data has been cleared'),Config::get('web_path') . '/admin/catalog.php'); break; case 'show_disabled': /* Stop the demo hippies */ @@ -285,7 +285,7 @@ switch ($_REQUEST['action']) { require (conf('prefix') . '/templates/show_disabled_songs.inc.php'); } else { - echo "<div class=\"error\" align=\"center\">" . _('No Disabled songs found') . "</div>"; + echo "<div class=\"error\" align=\"center\">" . T_('No Disabled songs found') . "</div>"; } break; case 'show_delete_catalog': @@ -294,7 +294,7 @@ switch ($_REQUEST['action']) { $catalog = new Catalog($_REQUEST['catalog_id']); $nexturl = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']); - show_confirmation(_('Delete Catalog'),_('Do you really want to delete this catalog?') . " -- $catalog->name ($catalog->path)",$nexturl,1); + show_confirmation(T_('Delete Catalog'), T_('Do you really want to delete this catalog?') . " -- $catalog->name ($catalog->path)",$nexturl,1); break; case 'show_customize_catalog': $catalog = new Catalog($_REQUEST['catalog_id']); @@ -314,7 +314,7 @@ switch ($_REQUEST['action']) { $catalog->get_art('',1); } $url = Config::get('web_path') . '/admin/catalog.php'; - $title = _('Album Art Search Finished'); + $title = T_('Album Art Search Finished'); $body = ''; show_confirmation($title,$body,$url); break; diff --git a/admin/flag.php b/admin/flag.php index d0201302..6bd87729 100644 --- a/admin/flag.php +++ b/admin/flag.php @@ -84,7 +84,7 @@ switch ($_REQUEST['action']) { if (isset($cleaned['artist']) || isset($cleaned['album'])) { $_SESSION['source'] = Config::get('web_path') . '/index.php'; } - show_confirmation(_('Song Updated'),_('The requested song has been updated'),$_SESSION['source']); + show_confirmation(T_('Song Updated'), T_('The requested song has been updated'),$_SESSION['source']); break; // Show the page for editing a full album case 'show_edit_album': @@ -126,7 +126,7 @@ switch ($_REQUEST['action']) { // Clean out the old album $catalog->clean_albums(); - show_confirmation(_('Album Updated'),'',Config::get('web_path') . '/admin/index.php'); + show_confirmation(T_('Album Updated'),'',Config::get('web_path') . '/admin/index.php'); break; // Show the page for editing a full artist @@ -168,7 +168,7 @@ switch ($_REQUEST['action']) { // Clean out the old artist(s) $catalog->clean_artists(); - show_confirmation(_('Artist Updated'),'',Config::get('web_path') . '/admin/index.php'); + show_confirmation(T_('Artist Updated'),'',Config::get('web_path') . '/admin/index.php'); break; /* Done by 'Select' code passes array of song ids */ @@ -229,7 +229,7 @@ switch ($_REQUEST['action']) { } // end foreach songs // Show a confirmation that this worked - show_confirmation(_('Songs Updated'),'',return_referer()); + show_confirmation(T_('Songs Updated'),'',return_referer()); break; case 'reject_flag': $flag_id = scrub_in($_REQUEST['flag_id']); @@ -237,8 +237,8 @@ switch ($_REQUEST['action']) { $flag->delete_flag(); $flag->format_name(); $url = return_referer(); - $title = _('Flag Removed'); - $body = _('Flag Removed from') . " " . $flag->name; + $title = T_('Flag Removed'); + $body = T_('Flag Removed from') . " " . $flag->name; show_confirmation($title,$body,$url); break; case 'reject_flags': @@ -253,7 +253,7 @@ switch ($_REQUEST['action']) { $flag->approve(); } } // end foreach flags - $title = _('Flags Updated'); + $title = T_('Flags Updated'); show_confirmation($title,'',return_referer()); break; case 'show_edit_song': @@ -272,7 +272,7 @@ switch ($_REQUEST['action']) { $song_obj->update_enabled(0,$song_id); } // end foreach } // end else - show_confirmation(_('Songs Disabled'),_('The requested song(s) have been disabled'),return_referer()); + show_confirmation(T_('Songs Disabled'), T_('The requested song(s) have been disabled'),return_referer()); break; case 'enabled': $song_obj = new Song(); @@ -283,7 +283,7 @@ switch ($_REQUEST['action']) { $song_obj->update_enabled(1,$song_id); } // end foreach } // end else - show_confirmation(_('Songs Enabled'),_('The requested song(s) have been enabled'),return_referer()); + show_confirmation(T_('Songs Enabled'), T_('The requested song(s) have been enabled'),return_referer()); break; case 'show_disabled': $disabled = Flag::get_disabled(); diff --git a/admin/mail.php b/admin/mail.php index 29fb800c..595abab7 100644 --- a/admin/mail.php +++ b/admin/mail.php @@ -64,12 +64,12 @@ switch ($_REQUEST['action']) { } if($mailer->send_to_group($_REQUEST['to'])) { - $title = _('E-mail Sent'); - $body = _('Your E-mail was successfully sent.'); + $title = T_('E-mail Sent'); + $body = T_('Your E-mail was successfully sent.'); } else { - $title = _('E-mail Not Sent'); - $body = _('Your E-mail was not sent.'); + $title = T_('E-mail Not Sent'); + $body = T_('Your E-mail was not sent.'); } $url = Config::get('web_path') . '/admin/mail.php'; show_confirmation($title,$body,$url); diff --git a/admin/modules.php b/admin/modules.php index 846e7b2d..5ca03eb2 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -41,7 +41,7 @@ switch ($_REQUEST['action']) { case 'install_localplay': $localplay = new Localplay($_REQUEST['type']); if (!$localplay->player_loaded()) { - Error::add('general',_('Install Failed, Controller Error')); + Error::add('general', T_('Install Failed, Controller Error')); Error::display('general'); break; } @@ -59,7 +59,7 @@ switch ($_REQUEST['action']) { case 'confirm_uninstall_localplay': $type = scrub_in($_REQUEST['type']); $url = Config::get('web_path') . '/admin/modules.php?action=uninstall_localplay&type=' . $type; - $title = _('Are you sure you want to remove this plugin?'); + $title = T_('Are you sure you want to remove this plugin?'); $body = ''; show_confirmation($title,$body,$url,1); break; @@ -71,7 +71,7 @@ switch ($_REQUEST['action']) { /* Show Confirmation */ $url = Config::get('web_path') . '/admin/modules.php?action=show_localplay'; - $title = _('Plugin Deactivated'); + $title = T_('Plugin Deactivated'); $body = ''; show_confirmation($title,$body,$url); break; @@ -86,7 +86,7 @@ switch ($_REQUEST['action']) { if (!$plugin->install()) { debug_event('plugins','Error: Plugin Install Failed, ' . $_REQUEST['plugin'],'1'); $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; - $title = _('Unable to Install Plugin'); + $title = T_('Unable to Install Plugin'); $body = ''; show_confirmation($title,$body,$url); break; @@ -97,14 +97,14 @@ switch ($_REQUEST['action']) { /* Show Confirmation */ $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; - $title = _('Plugin Activated'); + $title = T_('Plugin Activated'); $body = ''; show_confirmation($title,$body,$url); break; case 'confirm_uninstall_plugin': $plugin = scrub_in($_REQUEST['plugin']); $url = Config::get('web_path') . '/admin/modules.php?action=uninstall_plugin&plugin=' . $plugin; - $title = _('Are you sure you want to remove this plugin?'); + $title = T_('Are you sure you want to remove this plugin?'); $body = ''; show_confirmation($title,$body,$url,1); break; @@ -123,7 +123,7 @@ switch ($_REQUEST['action']) { /* Show Confirmation */ $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; - $title = _('Plugin Deactivated'); + $title = T_('Plugin Deactivated'); $body = ''; show_confirmation($title,$body,$url); break; @@ -138,19 +138,19 @@ switch ($_REQUEST['action']) { $plugin->upgrade(); User::rebuild_all_preferences(); $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; - $title = _('Plugin Upgraded'); + $title = T_('Plugin Upgraded'); $body = ''; show_confirmation($title, $body, $url); break; case 'show_plugins': $plugins = Plugin::get_plugins(); - show_box_top(_('Plugins'), 'box box_localplay_plugins'); + show_box_top(T_('Plugins'), 'box box_localplay_plugins'); require_once Config::get('prefix') . '/templates/show_plugins.inc.php'; show_box_bottom(); break; case 'show_localplay': $controllers = Localplay::get_controllers(); - show_box_top(_('Localplay Controllers'), 'box box_localplay_controllers'); + show_box_top(T_('Localplay Controllers'), 'box box_localplay_controllers'); require_once Config::get('prefix') . '/templates/show_localplay_controllers.inc.php'; show_box_bottom(); break; diff --git a/admin/shout.php b/admin/shout.php index 6140b901..53bd8338 100644 --- a/admin/shout.php +++ b/admin/shout.php @@ -40,7 +40,7 @@ switch ($_REQUEST['action']) { case 'edit_shout': $shout_id = $_POST['shout_id']; $update = shoutBox::update($_POST); - show_confirmation(_('Shoutbox Post Updated'),'',Config::get('web_path').'/admin/shout.php'); + show_confirmation(T_('Shoutbox Post Updated'),'',Config::get('web_path').'/admin/shout.php'); break; case 'show_edit': $shout = new shoutBox($_REQUEST['shout_id']); @@ -52,7 +52,7 @@ switch ($_REQUEST['action']) { break; case 'delete': $shout_id = shoutBox::delete($_REQUEST['shout_id']); - show_confirmation(_('Shoutbox Post Deleted'),'',Config::get('web_path').'/admin/shout.php'); + show_confirmation(T_('Shoutbox Post Deleted'),'',Config::get('web_path').'/admin/shout.php'); break; default: $browse = new Browse(); diff --git a/admin/system.php b/admin/system.php index eefc1d7f..d3a2f816 100644 --- a/admin/system.php +++ b/admin/system.php @@ -51,7 +51,7 @@ switch ($_REQUEST['action']) { break; case 'reset_db_charset': Dba::reset_db_charset(); - show_confirmation(_('Database Charset Updated'),_('Your Database and associated tables have been updated to match your currently configured charset'), Config::get('web_path').'/admin/system.php?action=show_debug'); + show_confirmation(T_('Database Charset Updated'), T_('Your Database and associated tables have been updated to match your currently configured charset'), Config::get('web_path').'/admin/system.php?action=show_debug'); break; case 'show_debug': $configuration = Config::get_all(); diff --git a/admin/users.php b/admin/users.php index 16e87351..7c650193 100644 --- a/admin/users.php +++ b/admin/users.php @@ -59,10 +59,10 @@ switch ($_REQUEST['action']) { /* Verify Input */ if (empty($username)) { - Error::add('username',_("Error Username Required")); + Error::add('username', T_("Error Username Required")); } if ($pass1 !== $pass2 && !empty($pass1)) { - Error::add('password',_("Error Passwords don't match")); + Error::add('password', T_("Error Passwords don't match")); } /* If we've got an error then break! */ @@ -87,7 +87,7 @@ switch ($_REQUEST['action']) { $client->update_password($pass1); } - show_confirmation(_('User Updated'), $client->fullname . "(" . $client->username . ")" . _('updated'), Config::get('web_path'). '/admin/users.php'); + show_confirmation(T_('User Updated'), $client->fullname . "(" . $client->username . ")" . T_('updated'), Config::get('web_path'). '/admin/users.php'); break; case 'add_user': if (Config::get('demo_mode')) { break; } @@ -105,23 +105,23 @@ switch ($_REQUEST['action']) { $pass2 = $_POST['password_2']; if ($pass1 !== $pass2 || !strlen($pass1)) { - Error::add('password',_("Error Passwords don't match")); + Error::add('password', T_("Error Passwords don't match")); } if (empty($username)) { - Error::add('username',_('Error Username Required')); + Error::add('username', T_('Error Username Required')); } /* make sure the username doesn't already exist */ if (!User::check_username($username)) { - Error::add('username',_('Error Username already exists')); + Error::add('username', T_('Error Username already exists')); } if (!Error::occurred()) { /* Attempt to create the user */ $user_id = User::create($username, $fullname, $email, $pass1, $access); if (!$user_id) { - Error::add('general',_("Error: Insert Failed")); + Error::add('general', T_("Error: Insert Failed")); } } // if no errors @@ -129,25 +129,25 @@ switch ($_REQUEST['action']) { $_REQUEST['action'] = 'show_add_user'; break; } - if ($access == 5){ $access = _('Guest');} - elseif ($access == 25){ $access = _('User');} - elseif ($access == 100){ $access = _('Admin');} + if ($access == 5){ $access = T_('Guest');} + elseif ($access == 25){ $access = T_('User');} + elseif ($access == 100){ $access = T_('Admin');} /* HINT: %1 Username, %2 Access num */ - show_confirmation(_('New User Added'),sprintf(_('%1$s has been created with an access level of %2$s'), $username, $access), Config::get('web_path').'/admin/users.php'); + show_confirmation(T_('New User Added'),sprintf(T_('%1$s has been created with an access level of %2$s'), $username, $access), Config::get('web_path').'/admin/users.php'); break; case 'enable': $client = new User($_REQUEST['user_id']); $client->enable(); - show_confirmation(_('User Enabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php'); + show_confirmation(T_('User Enabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php'); break; case 'disable': $client = new User($_REQUEST['user_id']); if ($client->disable()) { - show_confirmation(_('User Disabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php'); + show_confirmation(T_('User Disabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php'); } else { - show_confirmation(_('Error'),_('Unable to Disabled last Administrator'), Config::get('web_path').'/admin/users.php'); + show_confirmation(T_('Error'), T_('Unable to Disabled last Administrator'), Config::get('web_path').'/admin/users.php'); } break; case 'show_edit': @@ -163,17 +163,17 @@ switch ($_REQUEST['action']) { } $client = new User($_REQUEST['user_id']); if ($client->delete()) { - show_confirmation(_('User Deleted'), sprintf(_('%s has been Deleted'), $client->username), Config::get('web_path'). "/admin/users.php"); + show_confirmation(T_('User Deleted'), sprintf(T_('%s has been Deleted'), $client->username), Config::get('web_path'). "/admin/users.php"); } else { - show_confirmation(_('Delete Error'), _("Unable to delete last Admin User"), Config::get('web_path')."/admin/users.php"); + show_confirmation(T_('Delete Error'), T_("Unable to delete last Admin User"), Config::get('web_path')."/admin/users.php"); } break; case 'delete': if (Config::get('demo_mode')) { break; } $client = new User($_REQUEST['user_id']); - show_confirmation(_('Deletion Request'), - sprintf(_('Are you sure you want to permanently delete %s?'), $client->fullname), + show_confirmation(T_('Deletion Request'), + sprintf(T_('Are you sure you want to permanently delete %s?'), $client->fullname), Config::get('web_path')."/admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1,'delete_user'); break; /* Show IP History for the Specified User */ |