Skip to content

Commit

Permalink
stringsupdate (#2062)
Browse files Browse the repository at this point in the history
* 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 6ab20ec
Show file tree
Hide file tree
Showing 324 changed files with 3,986 additions and 6,971 deletions.
4 changes: 3 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cs_fixer_tmp_*
.env
.project
.settings/
.vscode/
bootstrap/
components/
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[www.ampache.org](http:https://ampache.org/) |
[ampache.github.io](http:https://ampache.github.io)

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

## Basics

Expand Down
16 changes: 10 additions & 6 deletions admin/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
Expand All @@ -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');
Expand All @@ -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();
57 changes: 30 additions & 27 deletions admin/catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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')) {
Expand All @@ -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')) {
Expand All @@ -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')) {
Expand All @@ -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! */
Expand All @@ -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':
Expand All @@ -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! */
Expand All @@ -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')) {
Expand All @@ -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);

Expand All @@ -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');
}
Expand All @@ -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':
Expand All @@ -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 */
Expand All @@ -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':
Expand All @@ -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']);
Expand All @@ -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:
Expand All @@ -263,4 +265,5 @@
} // end switch

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
4 changes: 3 additions & 1 deletion admin/duplicates.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

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

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

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
7 changes: 4 additions & 3 deletions admin/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

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

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

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

Expand All @@ -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");
Expand All @@ -70,4 +69,6 @@
break;
} // end switch on action

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
4 changes: 3 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

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

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

/* Show the Footer */
UI::show_query_stats();
UI::show_footer();
12 changes: 7 additions & 5 deletions admin/license.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

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

return false;
Expand All @@ -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']);
Expand All @@ -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();
Expand All @@ -65,4 +65,6 @@
break;
}

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

0 comments on commit 6ab20ec

Please sign in to comment.