diff options
author | momo-i <momo-i@ampache> | 2009-05-06 23:14:16 +0000 |
---|---|---|
committer | momo-i <momo-i@ampache> | 2009-05-06 23:14:16 +0000 |
commit | bd3b70008b4738880789a14b7e16d2410b04d3e8 (patch) | |
tree | 3b5a7ff886f781f44a77449a99ffb76bf3367542 /admin | |
parent | b85fa736cfdab471196d325edd2b77fc2b6ff6e6 (diff) | |
download | ampache-bd3b70008b4738880789a14b7e16d2410b04d3e8.tar.gz ampache-bd3b70008b4738880789a14b7e16d2410b04d3e8.tar.bz2 ampache-bd3b70008b4738880789a14b7e16d2410b04d3e8.zip |
Update translate strings
Change indent tab from blank
Fix show_confirmation web_path
Diffstat (limited to 'admin')
-rw-r--r-- | admin/catalog.php | 44 | ||||
-rw-r--r-- | admin/flag.php | 33 | ||||
-rw-r--r-- | admin/index.php | 1 | ||||
-rw-r--r-- | admin/mail.php | 2 | ||||
-rw-r--r-- | admin/modules.php | 35 | ||||
-rw-r--r-- | admin/shout.php | 16 | ||||
-rw-r--r-- | admin/system.php | 13 | ||||
-rw-r--r-- | admin/users.php | 48 |
8 files changed, 96 insertions, 96 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index e4fd66f4..e7900950 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -32,6 +32,7 @@ show_header(); /* Big switch statement to handle various actions */ switch ($_REQUEST['action']) { case 'fixed': + /* Does this use now? */ delete_flagged($flag); $type = 'show_flagged_songs'; include(conf('prefix') . '/templates/flag.inc'); @@ -42,13 +43,13 @@ switch ($_REQUEST['action']) { case 'add_to_catalog': toggle_visible('ajax-loading'); ob_end_flush(); - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } if ($_REQUEST['catalogs'] ) { foreach ($_REQUEST['catalogs'] as $catalog_id) { $catalog = new Catalog($catalog_id); $catalog->add_to_catalog(); } - } + } $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; @@ -60,8 +61,8 @@ switch ($_REQUEST['action']) { case 'update_catalog': toggle_visible('ajax-loading'); ob_end_flush(); - /* If they are in demo mode stop here */ - if (Config::get('demo_mode')) { break; } + /* If they are in demo mode stop here */ + if (Config::get('demo_mode')) { break; } if (isset($_REQUEST['catalogs'])) { foreach ($_REQUEST['catalogs'] as $catalog_id) { @@ -102,7 +103,7 @@ switch ($_REQUEST['action']) { break; case 'delete_catalog': /* Make sure they aren't in demo mode */ - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } if (!Core::form_verify('delete_catalog')) { access_denied(); @@ -121,7 +122,7 @@ switch ($_REQUEST['action']) { show_confirmation(_('Catalog Delete'),_('Confirm Deletion Request'),$next_url,1,'delete_catalog'); break; case 'remove_disabled': - if (conf('demo_mode')) { break; } + if (conf('demo_mode')) { break; } $song = $_REQUEST['song']; @@ -142,8 +143,8 @@ switch ($_REQUEST['action']) { case 'clean_catalog': toggle_visible('ajax-loading'); ob_end_flush(); - /* If they are in demo mode stop them here */ - if (Config::get('demo_mode')) { break; } + /* If they are in demo mode stop them here */ + if (Config::get('demo_mode')) { break; } // Make sure they checked something if (isset($_REQUEST['catalogs'])) { @@ -161,7 +162,7 @@ switch ($_REQUEST['action']) { break; case 'update_catalog_settings': /* No Demo Here! */ - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } /* Update the catalog */ Catalog::update_settings($_REQUEST); @@ -198,20 +199,20 @@ switch ($_REQUEST['action']) { ob_end_flush(); if (!strlen($_REQUEST['path']) || !strlen($_REQUEST['name'])) { - Error::add('general','Error Name and path not specified'); + Error::add('general',_('Error: Name and path not specified')); } if (substr($_REQUEST['path'],0,7) != 'http://' && $_REQUEST['type'] == 'remote') { - Error::add('general','Error Remote selected, but path is not a URL'); + Error::add('general',_('Error: Remote selected, but path is not a URL')); } if ($_REQUEST['type'] == 'remote' && !strlen($_REQUEST['key'])) { - Error::add('general','Error Remote Catalog specified, but no key provided'); + Error::add('general',_('Error: Remote Catalog specified, but no key provided')); } // Make sure that there isn't a catalog with a directory above this one if (Catalog::get_from_path($_REQUEST['path'])) { - Error::add('general',_('Error: Defined Path is inside an existing catalog')); + Error::add('general',_('Error: Defined Path is inside an existing catalog')); } // If an error hasn't occured @@ -222,10 +223,10 @@ switch ($_REQUEST['action']) { if (!$catalog_id) { require Config::get('prefix') . '/templates/show_add_catalog.inc.php'; break; - } + } $catalog = new Catalog($catalog_id); - + // Run our initial add $catalog->run_add($_REQUEST); @@ -243,7 +244,7 @@ switch ($_REQUEST['action']) { } break; case 'clear_stats': - if (Config::get('demo_mode')) { access_denied(); break; } + if (Config::get('demo_mode')) { access_denied(); break; } Catalog::clear_stats(); $url = Config::get('web_path') . '/admin/index.php'; @@ -258,12 +259,13 @@ switch ($_REQUEST['action']) { require Config::get('prefix') . '/templates/show_add_catalog.inc.php'; break; case 'clear_now_playing': - if (Config::get('demo_mode')) { access_denied(); break; } - Stream::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/index.php'); break; case 'show_disabled': - if (conf('demo_mode')) { break; } + /* Stop the demo hippies */ + if (conf('demo_mode')) { break; } $songs = $catalog->get_disabled(); if (count($songs)) { @@ -275,7 +277,7 @@ switch ($_REQUEST['action']) { break; case 'show_delete_catalog': /* Stop the demo hippies */ - if (Config::get('demo_mode')) { access_denied(); break; } + if (Config::get('demo_mode')) { access_denied(); break; } $catalog = new Catalog($_REQUEST['catalog_id']); $nexturl = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($_REQUEST['catalog_id']); @@ -302,7 +304,7 @@ switch ($_REQUEST['action']) { $title = _('Album Art Search Finished'); $body = ''; show_confirmation($title,$body,$url); - break; + break; default: /* Not sure what to put here anymore */ break; diff --git a/admin/flag.php b/admin/flag.php index 20b7524d..6f52e8c2 100644 --- a/admin/flag.php +++ b/admin/flag.php @@ -175,7 +175,7 @@ switch ($_REQUEST['action']) { /* Done by 'Select' code passes array of song ids */ case 'mass_update': $songs = $_REQUEST['song']; - $catalog = new Catalog(); + $catalog = new Catalog(); $object = $_REQUEST['update_field']; $flag = new Flag(); @@ -199,10 +199,10 @@ switch ($_REQUEST['action']) { foreach ($songs as $song_id) { $new_song = new Song($song_id); - $old_song = new Song(); - $old_song->artist = $new_song->artist; - $old_song->album = $new_song->album; - $old_song->genre = $new_song->genre; + $old_song = new Song(); + $old_song->artist = $new_song->artist; + $old_song->album = $new_song->album; + $old_song->genre = $new_song->genre; /* Restrict which fields can be updated */ switch ($object) { @@ -223,11 +223,11 @@ switch ($_REQUEST['action']) { break; } // end switch - /* Update this mofo, store an old copy for cleaning */ - $new_song->update_song($song_id,$new_song); + /* Update this mofo, store an old copy for cleaning */ + $new_song->update_song($song_id,$new_song); - /* Now that it's been updated clean old junk entries */ - $cleaned = $catalog->clean_single_song($old_song); + /* Now that it's been updated clean old junk entries */ + $cleaned = $catalog->clean_single_song($old_song); $flag->add($song_id,'song','retag','Edited Song, auto-tag'); @@ -267,13 +267,13 @@ switch ($_REQUEST['action']) { $song->fill_ext_info(); $song->format_song(); require_once (conf('prefix') . '/templates/show_edit_song.inc.php'); - break; + break; case 'disable': $song_obj = new Song(); // If we pass just one, make it still work - if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(0,$_REQUEST['song_ids']); } + if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(0,$_REQUEST['song_ids']); } else { - foreach ($_REQUEST['song_ids'] as $song_id) { + foreach ($_REQUEST['song_ids'] as $song_id) { $song_obj->update_enabled(0,$song_id); } // end foreach } // end else @@ -282,14 +282,14 @@ switch ($_REQUEST['action']) { case 'enabled': $song_obj = new Song(); // If we pass just one, make it still work - if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(1,$_REQUEST['song_ids']); } + if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(1,$_REQUEST['song_ids']); } else { - foreach ($_REQUEST['song_ids'] as $song_id) { + foreach ($_REQUEST['song_ids'] as $song_id) { $song_obj->update_enabled(1,$song_id); } // end foreach } // end else - show_confirmation(_('Songs Enabled'),_('The requested song(s) have been enabled'),return_referer()); - break; + show_confirmation(_('Songs Enabled'),_('The requested song(s) have been enabled'),return_referer()); + break; case 'show_disabled': $disabled = Flag::get_disabled(); Browse::set_type('song'); @@ -310,4 +310,3 @@ switch ($_REQUEST['action']) { show_footer(); ?> - diff --git a/admin/index.php b/admin/index.php index ee66a291..2cf3c824 100644 --- a/admin/index.php +++ b/admin/index.php @@ -38,3 +38,4 @@ switch ($_REQUEST['action']) { } show_footer(); +?> diff --git a/admin/mail.php b/admin/mail.php index 19a21b91..6cc3b7ea 100644 --- a/admin/mail.php +++ b/admin/mail.php @@ -73,7 +73,7 @@ switch ($_REQUEST['action']) { AmpacheMail::$fromname = $fullname; AmpacheMail::send(); - + /* Confirmation Send */ $url = Config::get('web_path') . '/admin/mail.php'; $title = _('E-mail Sent'); diff --git a/admin/modules.php b/admin/modules.php index 23fc5429..a57e5170 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -63,11 +63,11 @@ switch ($_REQUEST['action']) { $localplay = new Localplay($type); $localplay->uninstall(); - /* Show Confirmation */ - $url = Config::get('web_path') . '/admin/modules.php?action=show_localplay'; - $title = _('Plugin Deactivated'); - $body = ''; - show_confirmation($title,$body,$url); + /* Show Confirmation */ + $url = Config::get('web_path') . '/admin/modules.php?action=show_localplay'; + $title = _('Plugin Deactivated'); + $body = ''; + show_confirmation($title,$body,$url); break; case 'install_plugin': /* Verify that this plugin exists */ @@ -79,7 +79,7 @@ switch ($_REQUEST['action']) { $plugin = new Plugin($_REQUEST['plugin']); if (!$plugin->install()) { debug_event('plugins','Error: Plugin Install Failed, ' . $_REQUEST['plugin'],'1'); - $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; + $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; $title = _('Unable to Install Plugin'); $body = ''; show_confirmation($title,$body,$url); @@ -104,22 +104,22 @@ switch ($_REQUEST['action']) { break; case 'uninstall_plugin': /* Verify that this plugin exists */ - $plugins = Plugin::get_plugins(); - if (!array_key_exists($_REQUEST['plugin'],$plugins)) { - debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1'); - break; - } - $plugin = new Plugin($_REQUEST['plugin']); + $plugins = Plugin::get_plugins(); + if (!array_key_exists($_REQUEST['plugin'],$plugins)) { + debug_event('plugins','Error: Invalid Plugin: ' . $_REQUEST['plugin'] . ' selected','1'); + break; + } + $plugin = new Plugin($_REQUEST['plugin']); $plugin->uninstall(); // Don't trust the plugin to do it User::rebuild_all_preferences(); - /* Show Confirmation */ - $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; - $title = _('Plugin Deactivated'); - $body = ''; - show_confirmation($title,$body,$url); + /* Show Confirmation */ + $url = Config::get('web_path') . '/admin/modules.php?action=show_plugins'; + $title = _('Plugin Deactivated'); + $body = ''; + show_confirmation($title,$body,$url); break; case 'upgrade_plugin': @@ -143,5 +143,4 @@ switch ($_REQUEST['action']) { show_footer(); - ?> diff --git a/admin/shout.php b/admin/shout.php index 9a398c5e..e439d348 100644 --- a/admin/shout.php +++ b/admin/shout.php @@ -21,8 +21,8 @@ require_once '../lib/init.php'; if (!Access::check('interface','100')) { - access_denied(); - exit; + access_denied(); + exit; } show_header(); @@ -32,19 +32,19 @@ switch ($_REQUEST['action']) { case 'edit_shout': $shout_id = $_POST['shout_id']; $update = shoutBox::update($_POST); - show_confirmation(_('Shoutbox Post Updated'),'','admin/shout.php'); + show_confirmation(_('Shoutbox Post Updated'),'',Config::get('web_path').'/admin/shout.php'); break; - case 'show_edit': - $shout = new shoutBox($_REQUEST['shout_id']); + case 'show_edit': + $shout = new shoutBox($_REQUEST['shout_id']); $object = shoutBox::get_object($shout->object_type,$shout->object_id); $object->format(); $client = new User($shout->user); $client->format(); - require_once Config::get('prefix') . '/templates/show_edit_shout.inc.php'; - break; + require_once Config::get('prefix') . '/templates/show_edit_shout.inc.php'; + break; case 'delete': $shout_id = shoutBox::delete($_REQUEST['shout_id']); - show_confirmation(_('Shoutbox Post Deleted'),'','admin/shout.php'); + show_confirmation(_('Shoutbox Post Deleted'),'',Config::get('web_path').'/admin/shout.php'); break; default: Browse::set_type('shoutbox'); diff --git a/admin/system.php b/admin/system.php index 17d443aa..a5e9a775 100644 --- a/admin/system.php +++ b/admin/system.php @@ -39,25 +39,24 @@ switch ($_REQUEST['action']) { ob_end_clean(); $current = parse_ini_file(Config::get('prefix') . '/config/ampache.cfg.php'); $final = generate_config($current); - $browser = new Browser(); - $browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(Config::get('prefix') . '/config/ampache.cfg.php.dist')); - echo $final; + $browser = new Browser(); + $browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize(Config::get('prefix') . '/config/ampache.cfg.php.dist')); + echo $final; exit; 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'),'/admin/system.php?action=show_debug'); + 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'); break; case 'show_debug': - $configuration = Config::get_all(); - require_once Config::get('prefix') . '/templates/show_debug.inc.php'; + $configuration = Config::get_all(); + require_once Config::get('prefix') . '/templates/show_debug.inc.php'; break; default: // Rien a faire break; } // end switch - show_footer(); ?> diff --git a/admin/users.php b/admin/users.php index 1f487980..970a1f75 100644 --- a/admin/users.php +++ b/admin/users.php @@ -31,8 +31,8 @@ show_header(); // Switch on the actions switch ($_REQUEST['action']) { case 'update_user': - if (Config::get('demo_mode')) { break; } - + if (Config::get('demo_mode')) { break; } + if (!Core::form_verify('edit_user','post')) { access_denied(); exit; @@ -48,7 +48,7 @@ switch ($_REQUEST['action']) { $pass2 = scrub_in($_POST['password_2']); /* Setup the temp user */ - $client = new User($user_id); + $client = new User($user_id); /* Verify Input */ if (empty($username)) { @@ -80,15 +80,15 @@ switch ($_REQUEST['action']) { $client->update_password($pass1); } - show_confirmation(_('User Updated'), $client->fullname . "(" . $client->username . ")" . _('updated'),'admin/users.php'); + show_confirmation(_('User Updated'), $client->fullname . "(" . $client->username . ")" . _('updated'), Config::get('web_path'). '/admin/users.php'); break; case 'add_user': - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } - if (!Core::form_verify('add_user','post')) { - access_denied(); - exit; - } + if (!Core::form_verify('add_user','post')) { + access_denied(); + exit; + } $username = scrub_in($_POST['username']); $fullname = scrub_in($_POST['fullname']); @@ -114,9 +114,9 @@ switch ($_REQUEST['action']) { /* 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',_("Error: Insert Failed")); } - + } // if no errors else { $_REQUEST['action'] = 'show_add_user'; @@ -126,49 +126,49 @@ switch ($_REQUEST['action']) { elseif ($access == 25){ $access = _('User');} elseif ($access == 100){ $access = _('Admin');} - show_confirmation(_('New User Added'),__('%user% has been created with an access level of ' . $access,'%user%',$username),'admin/users.php'); + show_confirmation(_('New User Added'),__('%user% has been created with an access level of ' . $access,'%user%',$username), 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 . ')','admin/users.php'); + show_confirmation(_('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 . ')','admin/users.php'); + show_confirmation(_('User Disabled'),$client->fullname . ' (' . $client->username . ')', Config::get('web_path'). '/admin/users.php'); } else { - show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php'); + show_confirmation(_('Error'),_('Unable to Disabled last Administrator'), Config::get('web_path').'/admin/users.php'); } break; case 'show_edit': - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } $client = new User($_REQUEST['user_id']); require_once Config::get('prefix') . '/templates/show_edit_user.inc.php'; break; case 'confirm_delete': - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } $client = new User($_REQUEST['user_id']); if ($client->delete()) { - show_confirmation(_('User Deleted'), "$client->username has been Deleted","admin/users.php"); + show_confirmation(_('User Deleted'), sprintf(_('%s has been Deleted'), $client->username), Config::get('web_path'). "/admin/users.php"); } else { - show_confirmation(_('Delete Error'), _("Unable to delete last Admin User"),"admin/users.php"); + show_confirmation(_('Delete Error'), _("Unable to delete last Admin User"), Config::get('web_path')."/admin/users.php"); } break; case 'delete': - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } $client = new User($_REQUEST['user_id']); show_confirmation(_('Deletion Request'), - _('Are you sure you want to permanently delete') . " $client->fullname ($client->username)?", - "admin/users.php?action=confirm_delete&user_id=" . $_REQUEST['user_id'],1); + sprintf(_('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); break; /* Show IP History for the Specified User */ case 'show_ip_history': /* get the user and their history */ $working_user = new User($_REQUEST['user_id']); - + if (!isset($_REQUEST['all'])){ $history = $working_user->get_ip_history(0,1); } @@ -178,7 +178,7 @@ switch ($_REQUEST['action']) { require Config::get('prefix') . '/templates/show_ip_history.inc.php'; break; case 'show_add_user': - if (Config::get('demo_mode')) { break; } + if (Config::get('demo_mode')) { break; } require_once Config::get('prefix') . '/templates/show_add_user.inc.php'; break; case 'show_preferences': |