Skip to content
Permalink
Browse files

stringsupdate (#2062)

* Album::sanitize_disk()
* fix headphones call for artist
* allow cell wrapping for Ampache Debug
* reduce duplicate T_( runs
* hide the minimize button again.
* combining translations into variables
* Update sidebar_home.inc.php
* $t_string
* remove inline style (#2046)
* move footer statistics to the page being loaded
* followbtn needs a light color
* debug doesn't show array values. (theme_css_base)
* Sidebar tweak and translation add (#2048)
* fix markdown for changelog.
* link to the wiki for tvshows
* Core::get_cookie
* backticks in queries
* Let catalog manager actually edit catalogs
* report sql query on errors so i don't have to keep debugging individual queries
* fix, shares not getting a description, subsonic genre count and podcast episodes
* T_('RSS Feed')
* Add All to playlist
* Update icon_playlist_add_all.png
* fix bug with now_playing and podcasts
* allow any branch
* display forced branch
* Final Strings. Fixing scrutinizer issues
* encapsulate comparisons
  • Loading branch information
lachlan-00 committed Oct 3, 2019
1 parent 2eed93c commit 6ab20ec3d282face96ede8b32ac4a8385b7b2990
Showing 324 changed files with 3,986 additions and 6,971 deletions.
@@ -1,6 +1,8 @@
## Contribution
# Contribution

Please read [Development section](https://github.com/ampache/ampache/wiki#development).

## Bug report

Be sure the bug is not already fixed in `develop` branch or already reported in current open issues.
Please add [some logs](https://github.com/ampache/ampache/wiki/Troubleshooting#enable-logging) with your new issue.
@@ -29,6 +29,7 @@ cs_fixer_tmp_*
.env
.project
.settings/
.vscode/
bootstrap/
components/
node_modules/
@@ -5,7 +5,7 @@
[www.ampache.org](http://ampache.org/) |
[ampache.github.io](http://ampache.github.io)

**Notice:** Only pull requests (PR) for bug fixes will be considered.
**Notice:** Video features are considered a low priority feature.

## Basics

@@ -40,18 +40,19 @@
}
Access::delete(filter_input(INPUT_GET, 'access_id', FILTER_SANITIZE_SPECIAL_CHARS));
$url = AmpConfig::get('web_path') . '/admin/access.php';
show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'), $url);
show_confirmation(T_('No Problem'), T_('Your Access List entry has been removed'), $url);
break;
case 'show_delete_record':
if (AmpConfig::get('demo_mode')) {
break;
}
$access = new Access(Core::get_get('access_id'));
show_confirmation(T_('Confirm Action'), T_('Are you sure you want to permanently delete') . ' ' . $access->name,
$access = new Access((int) Core::get_get('access_id'));
show_confirmation(T_('Are you sure?'),
/* HINT: ACL Name */
sprintf(T_('This will permanently delete "%s"'), $access->name),
'admin/access.php?action=delete_record&access_id=' . $access->id, 1, 'delete_access');
break;
case 'add_host':

// Make sure we've got a valid form submission
if (!Core::form_verify('add_acl', 'post')) {
UI::access_denied();
@@ -75,7 +76,7 @@

if (!AmpError::occurred()) {
$url = AmpConfig::get('web_path') . '/admin/access.php';
show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'), $url);
show_confirmation(T_('No Problem'), T_('Your new Access Control List(s) have been created'), $url);
} else {
$action = 'show_add_' . Core::get_post('type');
require_once AmpConfig::get('prefix') . UI::find_template('show_add_access.inc.php');
@@ -90,7 +91,7 @@
$access = new Access(filter_input(INPUT_GET, 'access_id', FILTER_SANITIZE_SPECIAL_CHARS));
$access->update($_POST);
if (!AmpError::occurred()) {
show_confirmation(T_('Updated'), T_('Access List Entry updated'), AmpConfig::get('web_path') . '/admin/access.php');
show_confirmation(T_('No Problem'), T_('Your Access Control List has been updated'), AmpConfig::get('web_path') . '/admin/access.php');
} else {
$access->format();
require_once AmpConfig::get('prefix') . UI::find_template('show_edit_access.inc.php');
@@ -114,4 +115,7 @@
require_once AmpConfig::get('prefix') . UI::find_template('show_access_list.inc.php');
break;
} // end switch on action

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
@@ -23,7 +23,7 @@
require_once '../lib/init.php';
require_once AmpConfig::get('prefix') . '/modules/catalog/local/local.catalog.php';

if (!Access::check('interface', '100')) {
if (!Access::check('interface', '75')) {
UI::access_denied();

return false;
@@ -53,27 +53,27 @@
switch ($_REQUEST['action']) {
case 'add_to_all_catalogs':
catalog_worker('add_to_all_catalogs');
show_confirmation(T_('Catalog Update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('Catalog update process has started'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'add_to_catalog':
if (AmpConfig::get('demo_mode')) {
break;
}

catalog_worker('add_to_catalog', $catalogs);
show_confirmation(T_('Catalog Update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('Catalog update process has started'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'update_all_catalogs':
catalog_worker('update_all_catalogs');
show_confirmation(T_('Catalog Update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('Catalog update process has started'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'update_catalog':
if (AmpConfig::get('demo_mode')) {
break;
}

catalog_worker('update_catalog', $catalogs);
show_confirmation(T_('Catalog Update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('Catalog update process has started'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'full_service':
if (AmpConfig::get('demo_mode')) {
@@ -82,7 +82,7 @@
}

catalog_worker('full_service', $catalogs);
show_confirmation(T_('Catalog Update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('Catalog update process has started'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'delete_catalog':
if (AmpConfig::get('demo_mode')) {
@@ -105,14 +105,14 @@
}
$next_url = AmpConfig::get('web_path') . '/admin/catalog.php';
if ($deleted) {
show_confirmation(T_('Deleted'), T_('Catalog and all associated records have been deleted'), $next_url);
show_confirmation(T_('No Problem'), T_('The Catalog has been deleted'), $next_url);
} else {
show_confirmation(T_('Error'), T_('Cannot delete the catalog'), $next_url);
show_confirmation(T_("There Was a Problem"), T_("There was an error deleting this Catalog"), $next_url);
}
break;
case 'show_delete_catalog':
$next_url = AmpConfig::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalogs[]=' . implode(',', $catalogs);
show_confirmation(T_('Confirm Action'), T_('Delete Catalog'), $next_url, 1, 'delete_catalog');
show_confirmation(T_('Are You Sure?'), T_('This will permanently delete your Catalog'), $next_url, 1, 'delete_catalog');
break;
case 'enable_disabled':
if (AmpConfig::get('demo_mode')) {
@@ -125,21 +125,21 @@
foreach ($songs as $song_id) {
Song::update_enabled(true, $song_id);
}
$body = count($songs) . nT_(' Song Enabled', ' Songs Enabled', count($songs));
$body = count($songs) . ' ' . nT_('Song has been enabled', 'Songs have been enabled', count($songs));
} else {
$body = T_('No Disabled Songs selected');
$body = T_("You didn't select any disabled Songs");
}
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
$title = count($songs) . nT_(' Disabled Song Processed', ' Disabled Songs Processed', count($songs));
$title = T_('Finished Processing Disabled Songs');
show_confirmation($title, $body, $url);
break;
case 'clean_all_catalogs':
catalog_worker('clean_all_catalogs');
show_confirmation(T_('Catalog Clean started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('No Problem'), T_('The Catalog cleaning process has started'), AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'clean_catalog':
catalog_worker('clean_catalog', $catalogs);
show_confirmation(T_('Catalog Clean started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('No Problem'), T_('The Catalog cleaning process has started'), AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'update_catalog_settings':
/* No Demo Here! */
@@ -151,8 +151,8 @@
Catalog::update_settings($_POST);

$url = AmpConfig::get('web_path') . '/admin/catalog.php';
$title = T_('Catalog Updated');
$body = '';
$title = T_('No Problem');
$body = T_('The Catalog has been updated');
show_confirmation($title, $body, $url);
break;
case 'update_from':
@@ -161,7 +161,7 @@
}

catalog_worker('update_from', null, $_POST);
show_confirmation(T_('Subdirectory update started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('No Problem'), T_('The subdirectory update has started'), AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'add_catalog':
/* Wah Demo! */
@@ -172,11 +172,11 @@
ob_end_flush();

if (!strlen(filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) || filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES) == 'none') {
AmpError::add('general', T_('Error: Please select a catalog type'));
AmpError::add('general', T_('Please select a Catalog type'));
}

if (!strlen(filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES))) {
AmpError::add('general', T_('Error: Name not specified'));
AmpError::add('general', T_('Please enter a Catalog name'));
}

if (!Core::form_verify('add_catalog', 'post')) {
@@ -185,7 +185,7 @@
return false;
}

// If an error hasn't occured
// If an error hasn't occurred
if (!AmpError::occurred()) {
$catalog_id = Catalog::create($_POST);

@@ -196,7 +196,7 @@

$catalogs[] = $catalog_id;
catalog_worker('add_to_catalog', $catalogs, $_POST);
show_confirmation(T_('Catalog Creation started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('No Problem'), T_('The Catalog creation process has started'), AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
} else {
require AmpConfig::get('prefix') . UI::find_template('show_add_catalog.inc.php');
}
@@ -208,8 +208,8 @@
}
Stats::clear();
$url = AmpConfig::get('web_path') . '/admin/catalog.php';
$title = T_('Catalog statistics cleared');
$body = '';
$title = T_('No Problem');
$body = T_('Catalog statistics have been cleared');
show_confirmation($title, $body, $url);
break;
case 'show_add_catalog':
@@ -221,7 +221,7 @@
break;
}
Stream::clear_now_playing();
show_confirmation(T_('Now Playing Cleared'), T_('All now playing data has been cleared'), AmpConfig::get('web_path') . '/admin/catalog.php');
show_confirmation(T_('No Problem'), T_('All Now Playing data has been cleared'), AmpConfig::get('web_path') . '/admin/catalog.php');
break;
case 'show_disabled':
/* Stop the demo hippies */
@@ -233,7 +233,7 @@
if (count($songs)) {
require AmpConfig::get('prefix') . UI::find_template('show_disabled_songs.inc.php');
} else {
echo "<div class=\"error\" align=\"center\">" . T_('No Disabled songs found') . "</div>";
echo "<div class=\"error\" align=\"center\">" . T_('No disabled Songs found') . "</div>";
}
break;
case 'show_delete_catalog':
@@ -245,7 +245,9 @@

$catalog = Catalog::create_from_id($_REQUEST['catalog_id']);
$nexturl = AmpConfig::get('web_path') . '/admin/catalog.php?action=delete_catalog&amp;catalog_id=' . scrub_out($_REQUEST['catalog_id']);
show_confirmation(T_('Confirm Action'), T_('Do you really want to delete this catalog?') . " -- $catalog->name ($catalog->path)", $nexturl, 1);
show_confirmation(T_('Are You Sure?'),
/* HINT: Catalog Name */
sprintf(T_('This will permanently delete "%s"'), $catalog->name), $nexturl, 1);
break;
case 'show_customize_catalog':
$catalog = Catalog::create_from_id($_REQUEST['catalog_id']);
@@ -254,7 +256,7 @@
break;
case 'gather_media_art':
catalog_worker('gather_media_art', $catalogs);
show_confirmation(T_('Media Art Search started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
show_confirmation(T_('No Problem'), T_('The Catalog art search has started'), AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false);
break;
case 'show_catalogs':
default:
@@ -263,4 +265,5 @@
} // end switch

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
@@ -22,7 +22,7 @@

require_once '../lib/init.php';

if (!Access::check('interface', '100')) {
if (!Access::check('interface', '75')) {
UI::access_denied();

return false;
@@ -43,4 +43,6 @@
break;
} // end switch on action

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
@@ -22,7 +22,7 @@

require_once '../lib/init.php';

if (!Access::check('interface', '100')) {
if (!Access::check('interface', '75')) {
UI::access_denied();

return false;
@@ -33,7 +33,6 @@
// Switch on the actions
switch ($_REQUEST['action']) {
case 'export':

// This may take a while
set_time_limit(0);

@@ -43,7 +42,7 @@
// This will disable buffering so contents are sent immediately to browser.
// This is very useful for large catalogs because it will immediately display the download dialog to user,
// instead of waiting until contents are generated, which could take a long time.
ob_implicit_flush(true);
ob_implicit_flush(1);

header("Content-Transfer-Encoding: binary");
header("Cache-control: public");
@@ -70,4 +69,6 @@
break;
} // end switch on action

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
@@ -22,7 +22,7 @@

require_once '../lib/init.php';

if (!Access::check('interface', 100)) {
if (!Access::check('interface', 75)) {
UI::access_denied();

return false;
@@ -44,4 +44,6 @@
break;
}

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
@@ -22,7 +22,7 @@

require_once '../lib/init.php';

if (!Access::check('interface', '100')) {
if (!Access::check('interface', '75')) {
UI::access_denied();

return false;
@@ -38,12 +38,12 @@
if ($license->id) {
$license->update($_POST);
}
$text = T_('License Updated');
$text = T_('The License has been updated');
} else {
License::create($_POST);
$text = T_('License Created');
$text = T_('A new License has been created');
}
show_confirmation($text, '', AmpConfig::get('web_path') . '/admin/license.php');
show_confirmation(T_('No Problem'), $text, AmpConfig::get('web_path') . '/admin/license.php');
break;
case 'show_edit':
$license = new License($_REQUEST['license_id']);
@@ -53,7 +53,7 @@
break;
case 'delete':
License::delete($_REQUEST['license_id']);
show_confirmation(T_('License Deleted'), '', AmpConfig::get('web_path') . '/admin/license.php');
show_confirmation(T_('No Problem'), T_('The License has been deleted.'), AmpConfig::get('web_path') . '/admin/license.php');
break;
default:
$browse = new Browse();
@@ -65,4 +65,6 @@
break;
}

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();

0 comments on commit 6ab20ec

Please sign in to comment.
You can’t perform that action at this time.