Add support for localization across the application, and add escaping to some user-input fields in various locations.

This commit is contained in:
Buster Silver 2016-09-30 17:31:30 -05:00
parent 12f937e349
commit ec7add8e23
61 changed files with 1682 additions and 452 deletions

View File

@ -275,9 +275,22 @@ $cache = $di->get('cache');
if (!APP_IS_COMMAND_LINE)
{
// Set time zone and localization.
// Set time zone.
$timezone = $di['em']->getRepository('Entity\Settings')->getSetting('timezone', date_default_timezone_get());
date_default_timezone_set($timezone);
// Set up localization.
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (!$locale)
$locale = $di['em']->getRepository('Entity\Settings')->getSetting('locale', 'en_US');
putenv("LANG=".$locale);
setlocale(LC_ALL, $locale);
$locale_domain = 'default';
bindtextdomain($locale_domain, APP_INCLUDE_BASE.'/locale');
bind_textdomain_codeset($locale_domain, 'UTF-8');
textdomain($locale_domain);
}
// Set up application and routing.

1278
app/locale/default.pot Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,32 +4,32 @@
*/
return [
'System Maintenance' => [
'System Settings' => [
_('System Maintenance') => [
_('System Settings') => [
'url' => 'admin:settings:index',
'icon' => 'fa fa-cog',
'permission' => 'administer all',
],
'API Keys' => [
_('API Keys') => [
'url' => 'admin:api:index',
'icon' => 'fa fa-share-alt',
'permission' => 'administer api keys',
],
],
'Users' => [
'User Accounts' => [
_('Users') => [
_('User Accounts') => [
'url' => 'admin:users:index',
'icon' => 'fa fa-user',
'permission' => 'administer all',
],
'Roles and Permissions' => [
_('Roles and Permissions') => [
'url' => 'admin:permissions:index',
'icon' => 'fa fa-key',
'permission' => 'administer all',
],
],
'Stations' => [
'Manage Stations' => [
_('Stations') => [
_('Manage Stations') => [
'url' => 'admin:stations:index',
'icon' => 'fa fa-cog',
'permission' => 'administer stations',

View File

@ -12,14 +12,14 @@ return [
'elements' => [
'name' => ['text', [
'label' => 'Action Name',
'label' => _('Action Name'),
'class' => 'half-width',
'required' => true,
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -5,14 +5,14 @@ return [
'elements' => [
'owner' => ['text', [
'label' => 'API Key Owner',
'label' => _('API Key Owner'),
'class' => 'half-width',
'required' => true,
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -12,19 +12,19 @@ return [
'elements' => [
'name' => ['text', [
'label' => 'Role Name',
'label' => _('Role Name'),
'class' => 'half-width',
'required' => true,
]],
'actions' => ['multiCheckbox', [
'label' => 'Actions',
'label' => _('Actions'),
// Supply options in controller class.
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -16,18 +16,18 @@ return [
'groups' => [
'system' => [
'legend' => 'System Settings',
'legend' => _('System Settings'),
'elements' => [
'base_url' => ['text', [
'label' => 'Site Base URL',
'description' => 'The base URL where this service is located. For local testing, use "localhost". Otherwise, use either the external IP address or fully-qualified domain name pointing to the server.',
'label' => _('Site Base URL'),
'description' => _('The base URL where this service is located. For local testing, use "localhost". Otherwise, use either the external IP address or fully-qualified domain name pointing to the server.'),
'default' => $base_url_default,
]],
'timezone' => ['select', [
'label' => 'Server Timezone',
'description' => 'All times displayed on the site will be based on this time zone.<br><b>Current server time is ' . date('F j, Y g:ia') . '.</b>',
'label' => _('Server Timezone'),
'description' => _('All times displayed on the site will be based on this time zone.').'<br>'.sprintf(_('Current server time is <b>%s</b>.'), date('g:ia')),
'options' => \App\Timezone::fetchSelect(),
'default' => date_default_timezone_get(),
]],
@ -40,7 +40,7 @@ return [
'elements' => [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -5,24 +5,24 @@ return [
'groups' => [
'profile' => [
'legend' => 'Metadata',
'legend' => _('Metadata'),
'elements' => [
'text' => ['text', [
'label' => 'Full Text',
'label' => _('Full Text'),
'description' => 'Typically in the form of "Artist - Title". Should not be edited.',
'class' => 'half-width',
'disabled' => 'disabled',
]],
'artist' => ['text', [
'label' => 'Artist Name',
'label' => _('Artist Name'),
'class' => 'half-width',
'description' => 'For multiple artists, format should be "Artist 1, Artist 2"',
]],
'title' => ['text', [
'label' => 'Song Title',
'label' => _('Song Title'),
'class' => 'half-width',
]],
@ -33,7 +33,7 @@ return [
'elements' => [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -18,50 +18,50 @@ return [
'groups' => [
'profile' => [
'legend' => 'Station Details',
'legend' => _('Station Details'),
'elements' => [
'name' => ['text', [
'label' => 'Station Name',
'label' => _('Station Name'),
'class' => 'half-width',
'required' => true,
]],
'description' => ['textarea', [
'label' => 'Station Description',
'label' => _('Station Description'),
'class' => 'full-width full-height',
]],
'frontend_type' => ['radio', [
'label' => 'Station Frontend Type',
'description' => 'The type of software you use to deliver your broadcast to the audience.',
'label' => _('Station Frontend Type'),
'description' => _('The type of software you use to deliver your broadcast to the audience.'),
'options' => $frontend_types,
'default' => $frontend_default,
]],
'backend_type' => ['radio', [
'label' => 'Station Backend Type',
'description' => 'The type of software you use to manage the station\'s playlists and media.',
'label' => _('Station Backend Type'),
'description' => _('The type of software you use to manage the station\'s playlists and media.'),
'options' => $backend_types,
'default' => $backend_default,
]],
'enable_requests' => ['radio', [
'label' => 'Allow Song Requests',
'description' => 'Setting this enables listeners to request a song for play on your station. Only songs that are already in your playlists are listed as requestable.',
'label' => _('Allow Song Requests'),
'description' => _('Setting this enables listeners to request a song for play on your station. Only songs that are already in your playlists are listed as requestable.'),
'default' => '0',
'options' => [0 => 'No', 1 => 'Yes'],
]],
'request_delay' => ['text', [
'label' => 'Request Minimum Delay (Minutes)',
'description' => 'If requests are enabled, this specifies the minimum delay (in minutes) between a request being submitted and being played. If set to zero, no delay is applied.<br><b>Important:</b> Some stream licensing rules require a minimum delay for requests (in the US, this is currently 60 minutes). Check your local regulations for more information.',
'label' => _('Request Minimum Delay (Minutes)'),
'description' => _('If requests are enabled, this specifies the minimum delay (in minutes) between a request being submitted and being played. If set to zero, no delay is applied.<br><b>Important:</b> Some stream licensing rules require a minimum delay for requests (in the US, this is currently 60 minutes). Check your local regulations for more information.'),
'default' => '5',
]],
'enable_streamers' => ['radio', [
'label' => 'Allow Streamers / DJs',
'description' => 'If this setting is turned on, streamers (or DJs) will be able to connect directly to your stream and broadcast live music that interrupts the AutoDJ stream.',
'label' => _('Allow Streamers / DJs'),
'description' => _('If this setting is turned on, streamers (or DJs) will be able to connect directly to your stream and broadcast live music that interrupts the AutoDJ stream.'),
'default' => '0',
'options' => [0 => 'No', 1 => 'Yes'],
]],
@ -98,7 +98,7 @@ return [
'elements' => [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'class' => 'btn btn-lg btn-primary',
]],
],

View File

@ -12,14 +12,14 @@ return [
'elements' => [
'email' => ['email', [
'label' => 'E-mail Address',
'label' => _('E-mail Address'),
'required' => true,
'autocomplete' => 'off',
]],
'auth_password' => ['password', [
'label' => 'Reset Password',
'description' => 'Leave blank to use the current password.',
'label' => _('Reset Password'),
'description' => _('Leave blank to use the current password.'),
'autocomplete' => 'off',
'required' => false,
]],
@ -31,7 +31,7 @@ return [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -38,12 +38,12 @@ class ApiController extends BaseController
$this->em->persist($record);
$this->em->flush();
$this->alert('Changes saved.', 'green');
$this->alert(_('Changes saved.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
}
return $this->renderForm($form, 'edit', 'Edit Record');
return $this->renderForm($form, 'edit', _('Edit Record'));
}
public function deleteAction()
@ -55,7 +55,7 @@ class ApiController extends BaseController
$this->em->flush();
$this->alert('Record deleted.', 'green');
$this->alert(_('Record deleted.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
}

View File

@ -39,11 +39,11 @@ class PermissionsController extends BaseController
$this->em->persist($record);
$this->em->flush();
$this->alert('Action updated.', 'green');
$this->alert(_('Action updated.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
return $this->renderForm($form, 'edit', 'Edit Action');
return $this->renderForm($form, 'edit', _('Edit Action'));
}
public function deleteactionAction()
@ -52,7 +52,7 @@ class PermissionsController extends BaseController
if ($action)
$action->delete();
$this->alert('Action deleted!', 'green');
$this->alert(_('Action deleted.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
@ -89,11 +89,11 @@ class PermissionsController extends BaseController
$this->em->persist($record);
$this->em->flush();
$this->alert('<b>Role updated!</b>', 'green');
$this->alert('<b>'._('Role updated.').'</b>', 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
return $this->renderForm($form, 'edit', 'Edit Role');
return $this->renderForm($form, 'edit', _('Edit Role'));
}
public function deleteroleAction()
@ -104,7 +104,7 @@ class PermissionsController extends BaseController
$this->em->flush();
$this->alert('<b>Role deleted!</b>', 'green');
$this->alert('<b>'._('Role deleted!').'</b>', 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
}

View File

@ -2,7 +2,7 @@
namespace Modules\Admin\Controllers;
use Entity\Settings;
use Repository\SettingsRepository;
use Entity\SettingsRepository;
class SettingsController extends BaseController
{
@ -26,10 +26,10 @@ class SettingsController extends BaseController
$data = $form->getValues();
$settings_repo->setSettings($data);
$this->alert('Settings updated!', 'green');
$this->alert(_('Settings updated!'), 'green');
return $this->redirectHere();
}
return $this->renderForm($form, 'edit', 'Site Settings');
return $this->renderForm($form, 'edit', _('Site Settings'));
}
}

View File

@ -49,11 +49,11 @@ class StationsController extends BaseController
$cache = $this->di->get('cache');
$cache->remove('stations');
$this->alert('Changes saved.', 'green');
$this->alert(_('Changes saved.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
}
return $this->renderForm($form, 'edit', 'Edit Record');
return $this->renderForm($form, 'edit', _('Edit Record'));
}
public function deleteAction()
@ -71,7 +71,7 @@ class StationsController extends BaseController
$this->em->flush();
}
$this->alert('Record deleted.', 'green');
$this->alert(_('Record deleted.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
}
}

View File

@ -60,11 +60,11 @@ class UsersController extends BaseController
$this->em->persist($record);
$this->em->flush();
$this->alert('User updated.', 'green');
$this->alert(_('Record updated.'), 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
}
return $this->renderForm($form, 'edit', 'Edit Record');
return $this->renderForm($form, 'edit', _('Edit Record'));
}
public function deleteAction()
@ -77,7 +77,7 @@ class UsersController extends BaseController
$this->em->flush();
$this->alert('<b>User deleted.</b>', 'green');
$this->alert('<b>'._('User deleted.').'</b>', 'green');
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
}
@ -87,12 +87,12 @@ class UsersController extends BaseController
$user = User::find($id);
if (!($user instanceof User))
throw new \App\Exception('User not found!');
throw new \App\Exception(_('User not found!'));
// Set new identity in Zend_Auth
$this->auth->masqueradeAsUser($user);
$this->alert('<b>Logged in as '.$user->firstname.' '.$user->lastname.'.</b>', 'green');
$this->alert('<b>'.sprintf(_('Logged in as %s.'), $user->firstname.' '.$user->lastname).'</b>', 'green');
return $this->redirectHome();
}
}

View File

@ -1,12 +1,12 @@
<?php $this->layout('main', ['title' => 'API Keys', 'manual' => true]); ?>
<?php $this->layout('main', ['title' => _('API Keys'), 'manual' => true]); ?>
<div class="block-header">
<h2>Administration</h2>
<h2><?=_('Administration') ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>API Keys</h2>
<h2><?=_('API Keys') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
<div class="table-responsive">
@ -20,21 +20,21 @@
<thead>
<tr>
<th>&nbsp;</th>
<th>API Key</th>
<th>Calls</th>
<th>Owner</th>
<th><?=_('API Key') ?></th>
<th><?=_('Calls') ?></th>
<th><?=_('Owner') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($records as $record): ?>
<tr class="input">
<td class="center">
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $record['id'])) ?>">Edit</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $record['id'])) ?>">Revoke</a>
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $record['id'])) ?>"><?=_('Edit') ?></a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $record['id'])) ?>"><?=_('Revoke') ?></a>
</td>
<td><code><?=$record['id'] ?></code></td>
<td><?=$record['calls_made'] ?></td>
<td><?=$record['owner'] ?></td>
<td><?=$this->e($record['owner']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>

View File

@ -1,7 +1,7 @@
<?php $this->layout('main', ['title' => 'Administration', 'manual' => true]); ?>
<div class="block-header">
<h2>Administration</h2>
<h2><?=_('Administration') ?></h2>
</div>
<div class="row">

View File

@ -1,14 +1,14 @@
<?php $this->layout('main', ['title' => 'Permissions', 'manual' => true]); ?>
<div class="block-header">
<h2>Manage Permissions</h2>
<h2><?=_('Manage Permissions') ?></h2>
</div>
<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Roles</h2>
<h2><?=_('Roles') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'editrole')) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
<div class="table-responsive">
@ -20,21 +20,21 @@
<thead>
<tr>
<th>&nbsp;</th>
<th>Role Name</th>
<th><?=_('Role Name') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($roles as $role): ?>
<tr class="input">
<td class="center">
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'editrole', 'id' => $role['id'])) ?>">Edit</a>
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'editrole', 'id' => $role['id'])) ?>"><?=_('Edit') ?></a>
<?php if( $role['id'] != 1 ): ?>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'deleterole', 'id' => $role['id'])) ?>">Delete</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'deleterole', 'id' => $role['id'])) ?>"><?=_('Delete') ?></a>
<?php else: ?>
<a class="btn btn-sm btn-danger disabled" href="#" onclick="alert('This role cannot be deleted.'); return false;">Delete</a>
<a class="btn btn-sm btn-danger disabled" href="#" onclick="alert('<?=_('This role cannot be deleted.') ?>'); return false;"><?=_('Delete') ?></a>
<?php endif; ?>
</td>
<td align="left"><?=$role['name'] ?></td>
<td align="left"><?=$this->e($role['name']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
@ -45,7 +45,7 @@
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Actions</h2>
<h2><?=_('Actions') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'editaction')) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
<div class="table-responsive">
@ -57,17 +57,17 @@
<thead>
<tr>
<th>&nbsp;</th>
<th>Action Name</th>
<th><?=_('Action Name') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($actions as $action): ?>
<tr class="input">
<td class="center">
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'editaction', 'id' => $action['id'])) ?>">Edit</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'deleteaction', 'id' => $action['id'])) ?>">Delete</a>
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'editaction', 'id' => $action['id'])) ?>"><?=_('Edit') ?></a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'deleteaction', 'id' => $action['id'])) ?>"><?=_('Delete') ?></a>
</td>
<td align="left"><?=$action['name'] ?></td>
<td align="left"><?=$this->e($action['name']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'Role Members']); ?>
<?php $this->layout('main', ['title' => _('Role Members')]); ?>
<?php foreach($roles as $role): ?>
<h2>
@ -16,7 +16,7 @@
<ul>
<?php foreach($role['users'] as $user): ?>
<li><a href="<?=$url->route(array('module' => 'admin', 'controller' => 'users', 'action' => 'edit', 'id' => $user['id'])) ?>" target="_blank"><?=$user['name'] ?></a></li>
<li><a href="<?=$url->route(array('module' => 'admin', 'controller' => 'users', 'action' => 'edit', 'id' => $user['id'])) ?>" target="_blank"><?=$this->e($user['name']) ?></a></li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>

View File

@ -1,12 +1,12 @@
<?php $this->layout('main', ['title' => 'Stations', 'manual' => true]); ?>
<?php $this->layout('main', ['title' => _('Stations'), 'manual' => true]); ?>
<div class="block-header">
<h2>Manage Stations</h2>
<h2><?=_('Administration') ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>All Stations</h2>
<h2><?=_('Manage Stations') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(['action' => 'edit']) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
@ -18,8 +18,8 @@
</colgroup>
<thead>
<tr>
<th>Actions</th>
<th>Station</th>
<th><?=_('Actions') ?></th>
<th><?=_('Station') ?></th>
</tr>
</thead>
<tbody>
@ -27,13 +27,13 @@
<tr class="input">
<td class="center">
<div class="btn-group">
<a class="btn btn-sm btn-primary" href="<?=$url->route(array('module' => 'stations', 'station' => $record['id'])) ?>" target="_blank">Manage</a>
<a class="btn btn-sm btn-default" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $record['id'])) ?>">Edit</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $record['id'])) ?>">Delete</a>
<a class="btn btn-sm btn-primary" href="<?=$url->route(array('module' => 'stations', 'station' => $record['id'])) ?>" target="_blank"><?=_('Manage') ?></a>
<a class="btn btn-sm btn-default" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $record['id'])) ?>"><?=_('Edit') ?></a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $record['id'])) ?>"><?=_('Delete') ?></a>
</div>
</td>
<td>
<big><?=$record['name'] ?></big>
<big><?=$this->e($record['name']) ?></big>
</td>
</tr>
<?php endforeach; ?>

View File

@ -1,15 +1,15 @@
<?php $this->layout('main', ['title' => 'Users', 'manual' => true]); ?>
<div class="block-header">
<h2>Manage Users</h2>
<h2><?=_('Administration') ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<?php if ($q): ?>
<h2>Search Results for "<?=$q ?>"</h2>
<h2><?=sprintf(_('Search Results for "%s"'), $this->e($q)) ?></h2>
<?php else: ?>
<h2>All Users</h2>
<h2><?=_('All Users') ?></h2>
<?php endif; ?>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><i class="zmdi zmdi-plus"></i></a>
@ -26,18 +26,18 @@
</colgroup>
<thead>
<tr>
<th>Actions</th>
<th>E-mail Address</th>
<th>Roles</th>
<th><?=_('Actions') ?></th>
<th><?=_('E-mail Address') ?></th>
<th><?=_('Roles') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($pager as $user): ?>
<tr class="input">
<td>
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'impersonate', 'id' => $user->id)) ?>">Log In</a>
<a class="btn btn-sm btn-default" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $user->id)) ?>">Edit</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $user->id)) ?>">Delete</a>
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'impersonate', 'id' => $user->id)) ?>"><?=_('Log In') ?></a>
<a class="btn btn-sm btn-default" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $user->id)) ?>"><?=_('Edit') ?></a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $user->id)) ?>"><?=_('Delete') ?></a>
</td>
<td><?=$this->mailto($user->email) ?></td>
<td>

View File

@ -8,21 +8,21 @@ return [
'elements' => [
'username' => ['text', [
'label' => 'E-mail Address',
'label' => _('E-mail Address'),
'class' => 'half-width',
'spellcheck' => 'false',
'required' => true,
]],
'password' => ['password', [
'label' => 'Password',
'label' => _('Password'),
'class' => 'half-width',
'required' => true,
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Log in',
'label' => _('Log in'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -8,7 +8,7 @@ return [
'groups' => [
'account_info' => [
'legend' => 'Account Information',
'legend' => _('Account Information'),
'elements' => [
/*
@ -20,15 +20,15 @@ return [
*/
'email' => ['text', [
'label' => 'E-mail Address',
'label' => _('E-mail Address'),
'class' => 'half-width',
'required' => true,
'autocomplete' => 'off',
]],
'auth_password' => ['password', [
'label' => 'Reset Password',
'description' => 'To change your password, enter the new password in the field below.',
'label' => _('Reset Password'),
'description' => _('To change your password, enter the new password in the field below.'),
'autocomplete' => 'off',
]],
@ -39,7 +39,7 @@ return [
'elements' => [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Profile',
'label' => _('Save Profile'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -4,18 +4,18 @@ return [
'groups' => [
'account' => [
'legend' => 'Account Information',
'legend' => _('Account Information'),
'elements' => [
'username' => ['text', [
'label' => 'E-mail Address',
'label' => _('E-mail Address'),
'class' => 'half-width',
'required' => true,
'validators' => ['EmailAddress'],
]],
'password' => ['password', [
'label' => 'Password',
'label' => _('Password'),
'required' => true,
]],
@ -26,7 +26,7 @@ return [
'elements' => [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Create Account',
'label' => _('Create Account'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -43,7 +43,7 @@ class AccountController extends BaseController
{
$user = $this->auth->getLoggedInUser();
$this->alert('<b>Logged in successfully.</b><br>'.$user->email, 'green');
$this->alert('<b>'._('Logged in successfully.').'</b><br>'.$user->email, 'green');
$url = $this->di->get('url');
@ -52,7 +52,7 @@ class AccountController extends BaseController
}
else
{
$this->alert('<b>Login unsuccessful.</b><br>Your credentials could not be verified.', 'red');
$this->alert('<b>'._('Login unsuccessful').'</b><br>'._('Your credentials could not be verified.'), 'red');
return $this->redirectHere();
}
}

View File

@ -77,7 +77,7 @@ class IndexController extends BaseController
foreach ($network_data as $network_name => $data_charts) {
if (isset($data_charts['ranges'])) {
$metric_row = new \stdClass;
$metric_row->name = $network_name . ' Listener Range';
$metric_row->name = sprintf(_('%s Listener Range'), $network_name);
$metric_row->type = 'arearange';
ksort($data_charts['ranges']);
@ -88,7 +88,7 @@ class IndexController extends BaseController
if (isset($data_charts['averages'])) {
$metric_row = new \stdClass;
$metric_row->name = $network_name . ' Daily Average';
$metric_row->name = sprintf(_('%s Daily Average'), $network_name);
$metric_row->type = 'spline';
ksort($data_charts['averages']);

View File

@ -50,13 +50,14 @@ class ProfileController extends BaseController
\App\Customization::set($custom_key, $custom_val);
*/
$this->alert('Profile saved!', 'green');
$this->alert(_('Profile saved!'), 'green');
return $this->redirectFromHere(array('action' => 'index'));
}
return $this->renderForm($form, 'edit', 'Edit Profile');
return $this->renderForm($form, 'edit', _('Edit Profile'));
}
/*
public function timezoneAction()
{
$form = new \App\Form($this->current_module_config->forms->timezone);
@ -80,4 +81,5 @@ class ProfileController extends BaseController
$this->view->setVar('title', 'Set Time Zone');
$this->renderForm($form);
}
}
*/
}

View File

@ -26,7 +26,7 @@ class SetupController extends BaseController
*/
public function completeAction()
{
$this->alert('<b>Setup has already been completed!</b>', 'red');
$this->alert('<b>'._('Setup has already been completed!').'</b>', 'red');
return $this->redirectHome();
}
@ -53,7 +53,7 @@ class SetupController extends BaseController
$this->em->persist($action);
$role = new \Entity\Role;
$role->name = 'Super Administrator';
$role->name = _('Super Administrator');
$role->actions->add($action);
$this->em->persist($role);
@ -135,11 +135,11 @@ class SetupController extends BaseController
$settings_repo->setSettings($data);
// Notify the user and redirect to homepage.
$this->alert('<b>Setup is now complete!</b><br>Continue setting up your station in the main AzuraCast app.', 'green');
$this->alert('<b>'._('Setup is now complete!').'</b><br>'._('Continue setting up your station in the main AzuraCast app.'), 'green');
return $this->redirectHome();
}
return $this->renderForm($form, 'edit', 'Site Settings');
return $this->renderForm($form, 'edit', _('Site Settings'));
}
/**

View File

@ -2,21 +2,21 @@
<!-- Login -->
<div class="lc-block toggled" id="l-login">
<h3 class="text-left">Welcome to <?=$config->application->name ?>!</h3>
<P class="text-left">Please log in to continue.</p>
<h3 class="text-left"><?=sprintf(_('Welcome to %s!'), $config->application->name) ?></h3>
<P class="text-left"><?=_('Please log in to continue.') ?></p>
<form action="" method="post">
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<div class="fg-line">
<input type="email" name="username" class="form-control" placeholder="E-mail Address">
<input type="email" name="username" class="form-control" placeholder="<?=_('E-mail Address') ?>">
</div>
</div>
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="fa fa-asterisk"></i></span>
<div class="fg-line">
<input type="password" name="password" class="form-control" placeholder="Password">
<input type="password" name="password" class="form-control" placeholder="<?=_('Password') ?>">
</div>
</div>

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'Dashboard', 'manual' => true]); ?>
<?php $this->layout('main', ['title' => _('Dashboard'), 'manual' => true]); ?>
<?php $this->start('custom_js') ?>
<script type="text/javascript" src="//code.highcharts.com/highcharts.js"></script>
@ -11,14 +11,14 @@
<?php $this->stop('custom_js') ?>
<div class="block-header">
<h2>Dashboard</h2>
<h2><?=_('Dashboard') ?></h2>
</div>
<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Listeners Across All Stations</h2>
<h2><?=_('Listeners Across All Stations') ?></h2>
</div>
<div class="card-body card-padding-sm">
<div id="network_chart" style="height: 250px;"></div>
@ -28,7 +28,7 @@
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Listeners Per Station</h2>
<h2><?=_('Listeners Per Station') ?></h2>
</div>
<div class="card-body card-padding-sm">
<div id="station_chart" style="height: 250px;"></div>
@ -41,7 +41,7 @@
<div class="col-sm-12">
<div class="card">
<div class="card-header ch-alt">
<h2>Station Overview</h2>
<h2><?=_('Station Overview') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->route(['module' => 'admin', 'controller' => 'stations', 'action' => 'edit']) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
@ -57,10 +57,10 @@
<thead>
<tr>
<th>&nbsp;</th>
<th>Station Name</th>
<th class="text-center">Listeners</th>
<th>Now Playing</th>
<th>Options</th>
<th><?=_('Station Name') ?></th>
<th class="text-center"><?=_('Listeners') ?></th>
<th><?=_('Now Playing') ?></th>
<th><?=_('Options') ?></th>
</tr>
</thead>
<tbody>
@ -72,17 +72,17 @@
</a>
</td>
<td>
<big><?=$row->name ?></big>
<big><?=$this->e($row->name) ?></big>
</td>
<td class="text-center">
<span class="nowplaying-listeners">0</span>
</td>
<td>
<strong><span class="nowplaying-title">Song Title</span></strong><br>
<span class="nowplaying-artist">Song Artist</span>
<strong><span class="nowplaying-title"><?=_('Song Title') ?></span></strong><br>
<span class="nowplaying-artist"><?=_('Song Artist') ?></span>
</td>
<td>
<a class="btn btn-primary" href="<?=$url->route(['module' => 'stations', 'station' => $row->id]) ?>">Manage</a>
<a class="btn btn-primary" href="<?=$url->route(['module' => 'stations', 'station' => $row->id]) ?>"><?=_('Manage') ?></a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -1,7 +1,7 @@
<?php $this->layout('main', ['title' => 'My Profile']); ?>
<?php $this->layout('main', ['title' => _('My Profile')]); ?>
<div class="buttons">
<a class="btn btn-lg btn-primary" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>">Edit Profile</a>
<a class="btn btn-lg btn-primary" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><?=_('Edit Profile') ?></a>
</div>
<?=$this->insert('partials/form_view') ?>

View File

@ -2,21 +2,21 @@
<!-- Login -->
<div class="lc-block toggled" id="l-login">
<h3 class="text-left">Welcome to <?=$config->application->name ?>!</h3>
<P class="text-left">Begin setup by creating a Super Administrator account.</p>
<h3 class="text-left"><?=sprintf(_('Welcome to %s!'), $config->application->name) ?>!</h3>
<P class="text-left"><?=_('Begin setup by creating a Super Administrator account.') ?></p>
<form action="" method="post">
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
<div class="fg-line">
<input type="email" name="username" class="form-control" placeholder="E-mail Address">
<input type="email" name="username" class="form-control" placeholder="<?=_('E-mail Address') ?>">
</div>
</div>
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="fa fa-asterisk"></i></span>
<div class="fg-line">
<input type="password" name="password" class="form-control" placeholder="Password">
<input type="password" name="password" class="form-control" placeholder="<?=_('Password') ?>">
</div>
</div>

View File

@ -1,5 +1,5 @@
<?php $this->layout('main', ['title' => 'Set Up']); ?>
<?php $this->layout('main', ['title' => _('Set Up')]); ?>
<p>Complete the setup process by providing some information about your broadcast environment.</p>
<p><?=_('Complete the setup process by providing some information about your broadcast environment.') ?></p>
<?=$form->render() ?>

View File

@ -1,9 +1,9 @@
<?php $this->layout('main', ['title' => 'Create Station']); ?>
<?php $this->layout('main', ['title' => _('Create Station')]); ?>
<p>To continue the setup process, enter the basic details of your first station below. Some technical details will automatically be retrieved from the system after you complete this step.</p>
<p><?=_('To continue the setup process, enter the basic details of your first station below. Some technical details will automatically be retrieved from the system after you complete this step.') ?></p>
<?=$this->fetch('partials/form') ?>
<div class="alert alert-info m-b-0 m-t-25">
Note: If you are not starting with an empty station directory, it may take a while to process any existing MP3 files or playlists that are in this station's directory.
<?=_('Note: If you are not starting with an empty station directory, it may take a while to process any existing MP3 files or playlists that are in this station\'s directory.') ?>
</div>

View File

@ -5,8 +5,8 @@ return [
'elements' => [
'is_enabled' => ['radio', [
'label' => 'Enable Automated Assignment',
'description' => 'Allow the system to periodically automatically assign songs to playlists based on their performance. This process will run in the background, and will only run if this option is set to "Enabled" and at least one playlist is set to "Include in Automated Assignment".',
'label' => _('Enable Automated Assignment'),
'description' => _('Allow the system to periodically automatically assign songs to playlists based on their performance. This process will run in the background, and will only run if this option is set to "Enabled" and at least one playlist is set to "Include in Automated Assignment".'),
'default' => '0',
'options' => [
0 => 'Disabled',
@ -15,8 +15,8 @@ return [
]],
'threshold_days' => ['radio', [
'label' => 'Days Between Automated Assignments',
'description' => 'Based on this setting, the system will automatically reassign songs every (this) days using data from the previous (this) days.',
'label' => _('Days Between Automated Assignments'),
'description' => _('Based on this setting, the system will automatically reassign songs every (this) days using data from the previous (this) days.'),
'class' => 'inline',
'default' => \App\Sync\RadioAutomation::DEFAULT_THRESHOLD_DAYS,
'options' => [
@ -29,7 +29,7 @@ return [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],

View File

@ -4,20 +4,20 @@ return [
'elements' => [
'title' => ['text', [
'label' => 'Song Title',
'label' => _('Song Title'),
]],
'artist' => ['text', [
'label' => 'Song Artist',
'label' => _('Song Artist'),
]],
'album' => ['text', [
'label' => 'Song Album',
'label' => _('Song Album'),
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'ui-button btn-lg btn-primary',
]],

View File

@ -19,14 +19,14 @@ return [
'elements' => [
'name' => ['text', [
'label' => 'Playlist Name',
'label' => _('Playlist Name'),
'required' => true,
]],
'is_enabled' => ['radio', [
'label' => 'Enable Playlist',
'label' => _('Enable Playlist'),
'required' => true,
'description' => 'If set to "No", the playlist will not be included in radio playback, but can still be managed.',
'description' => _('If set to "No", the playlist will not be included in radio playback, but can still be managed.'),
'options' => [
1 => 'Yes',
0 => 'No',
@ -35,13 +35,13 @@ return [
]],
'type' => ['radio', [
'label' => 'Playlist Type',
'label' => _('Playlist Type'),
'options' => [
'default' => '<b>Standard:</b> Plays all day, shuffles with other standard playlists based on weight.',
'scheduled' => '<b>Scheduled:</b> Play during a scheduled time range. Useful for mood-based time playlists.',
'once_per_x_songs' => '<b>Once per x Songs:</b> Play exactly once every <i>x</i> songs. Useful for station ID/jingles.',
'once_per_x_minutes' => '<b>Once Per x Minutes:</b> Play exactly once every <i>x</i> minutes. Useful for station ID/jingles.',
'once_per_day' => '<b>Daily</b>: Play once per day at the specified time. Useful for timely reminders.',
'default' => '<b>'._('Standard Playlist').':</b> '._('Plays all day, shuffles with other standard playlists based on weight.'),
'scheduled' => '<b>'._('Scheduled Playlist').':</b> '._('Play during a scheduled time range. Useful for mood-based time playlists.'),
'once_per_x_songs' => '<b>'._('Once per x Songs Playlist').':</b> '._('Play exactly once every <i>x</i> songs. Useful for station ID/jingles.'),
'once_per_x_minutes' => '<b>'._('Once Per x Minutes Playlist').':</b> '._('Play exactly once every <i>x</i> minutes. Useful for station ID/jingles.'),
'once_per_day' => '<b>'._('Daily Playlist').'</b>: '._('Play once per day at the specified time. Useful for timely reminders.'),
],
'default' => 'default',
'required' => true,
@ -51,13 +51,13 @@ return [
],
'type_default' => [
'legend' => 'Standard Playlist',
'legend' => _('Standard Playlist'),
'class' => 'type_fieldset',
'elements' => [
'weight' => ['radio', [
'label' => 'Playlist Weight',
'description' => 'How often the playlist\'s songs will be played. 1 is the most infrequent, 5 is the most frequent.',
'label' => _('Playlist Weight'),
'description' => _('How often the playlist\'s songs will be played. 1 is the most infrequent, 5 is the most frequent.'),
'default' => 3,
'required' => true,
'class' => 'inline',
@ -71,8 +71,8 @@ return [
]],
'include_in_automation' => ['radio', [
'label' => 'Include in Automated Assignment',
'description' => 'If auto-assignment is enabled, use this playlist as one of the targets for songs to be redistributed into. This will overwrite the existing contents of this playlist.',
'label' => _('Include in Automated Assignment'),
'description' => _('If auto-assignment is enabled, use this playlist as one of the targets for songs to be redistributed into. This will overwrite the existing contents of this playlist.'),
'required' => true,
'default' => '0',
'options' => [
@ -85,19 +85,19 @@ return [
],
'type_scheduled' => [
'legend' => 'Scheduled Playlist',
'legend' => _('Scheduled Playlist'),
'class' => 'type_fieldset',
'elements' => [
'schedule_start_time' => ['select', [
'label' => 'Start Time',
'description' => 'Current server time is <b>'.date('g:ia').'.</b>',
'label' => _('Start Time'),
'description' => sprintf(_('Current server time is <b>%s</b>.'), date('g:ia')),
'options' => $hour_select,
]],
'schedule_end_time' => ['select', [
'label' => 'End Time',
'description' => 'If the end time is before the start time, the playlist will play overnight until this time on the next day.',
'label' => _('End Time'),
'description' => _('If the end time is before the start time, the playlist will play overnight until this time on the next day.'),
'options' => $hour_select,
]],
@ -105,13 +105,13 @@ return [
],
'type_once_per_x_songs' => [
'legend' => 'Once per x Songs Playlist',
'legend' => _('Once per x Songs Playlist'),
'class' => 'type_fieldset',
'elements' => [
'play_per_songs' => ['radio', [
'label' => 'Number of Songs Between Plays',
'description' => 'This playlist will play every $x songs, where $x is specified below.',
'label' => _('Number of Songs Between Plays'),
'description' => _('This playlist will play every $x songs, where $x is specified below.'),
'options' => \App\Utilities::pairs([
5,
10,
@ -127,13 +127,13 @@ return [
],
'type_once_per_x_minutes' => [
'legend' => 'Once per x Minutes Playlist',
'legend' => _('Once per x Minutes Playlist'),
'class' => 'type_fieldset',
'elements' => [
'play_per_minutes' => ['radio', [
'label' => 'Number of Minutes Between Plays',
'description' => 'This playlist will play every $x minutes, where $x is specified below.',
'label' => _('Number of Minutes Between Plays'),
'description' => _('This playlist will play every $x minutes, where $x is specified below.'),
'options' => \App\Utilities::pairs([
5,
10,
@ -150,13 +150,13 @@ return [
],
'type_once_per_day' => [
'legend' => 'Daily Playlist',
'legend' => _('Daily Playlist'),
'class' => 'type_fieldset',
'elements' => [
'play_once_time' => ['select', [
'label' => 'Scheduled Play Time',
'description' => 'Current server time is <b>'.date('g:ia').'.</b>',
'label' => _('Scheduled Play Time'),
'description' => sprintf(_('Current server time is <b>%s</b>.'), date('g:ia')),
'options' => $hour_select,
]],
@ -168,7 +168,7 @@ return [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'ui-button btn-lg btn-primary',
]],

View File

@ -4,25 +4,25 @@ return [
'elements' => [
'streamer_username' => ['text', [
'label' => 'Login Username',
'description' => 'The streamer will use this username to connect to the radio server.',
'label' => _('Streamer Username'),
'description' => _('The streamer will use this username to connect to the radio server.'),
'required' => true,
]],
'streamer_password' => ['text', [
'label' => 'Login Password',
'description' => 'The streamer will use this password to connect to the radio server.',
'label' => _('Streamer Password'),
'description' => _('The streamer will use this password to connect to the radio server.'),
'required' => true,
]],
'comments' => ['textarea', [
'label' => 'Account Comments',
'description' => 'Internal notes or comments about the user, visible only on this control panel.',
'label' => _('Comments'),
'description' => _('Internal notes or comments about the user, visible only on this control panel.'),
]],
'is_active' => ['radio', [
'label' => 'Account is Active',
'description' => 'Set to "Yes" to allow this account to log in and stream.',
'label' => _('Account is Active'),
'description' => _('Set to "Yes" to allow this account to log in and stream.'),
'required' => true,
'default' => '1',
'options' => [
@ -33,7 +33,7 @@ return [
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'label' => _('Save Changes'),
'helper' => 'formButton',
'class' => 'ui-button btn-lg btn-primary',
]],

View File

@ -1,29 +0,0 @@
<?php
return [
'elements' => [
'long_url' => ['text', [
'label' => 'Original URL (Target)',
'description' => 'The URL you would like the short address to redirect to.',
'required' => true,
'maxlength' => 300,
'class' => 'full-width',
'placeholder' => 'http://full-url.here.com/',
]],
'short_url' => ['text', [
'label' => 'Short URL',
'maxlength' => 50,
'description' => 'If you want to specify the short URL, enter it in this field. Leave this field blank to automatically generate one.',
'class' => 'half-width',
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Save Changes',
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],
],
];

View File

@ -1,32 +0,0 @@
<?php
return [
'method' => 'post',
'enctype' => 'multipart/form-data',
'elements' => [
'decision' => ['radio', [
'label' => 'Your Recommendation',
'required' => true,
'multiOptions' => [
'Accept' => 'Accept the Station',
'Decline' => 'Decline the Station',
'Abstain' => 'Abstain / No Vote',
],
'default' => 'Abstain',
]],
'comments' => ['textarea', [
'label' => 'Comments',
'class' => 'full-width half-height',
]],
'submit' => ['submit', [
'type' => 'submit',
'label' => 'Submit Vote',
'helper' => 'formButton',
'class' => 'btn btn-lg btn-primary',
]],
],
];

View File

@ -23,7 +23,7 @@ class AutomationController extends BaseController
$this->em->persist($this->station);
$this->em->flush();
$this->alert('Changes saved!', 'green');
$this->alert(_('Changes saved.'), 'green');
return $this->redirectHere();
}
@ -37,11 +37,11 @@ class AutomationController extends BaseController
$automation = new \App\Sync\RadioAutomation($this->di);
if ($automation->runStation($this->station, true))
$this->alert('<b>Automated assignment complete!</b>', 'green');
$this->alert('<b>'._('Automated assignment complete!').'</b>', 'green');
}
catch(\Exception $e)
{
$this->alert('<b>Automated assignment error:</b><br>'.$e->getMessage(), 'red');
$this->alert('<b>'._('Automated assignment error').':</b><br>'.$e->getMessage(), 'red');
}
return $this->redirectFromHere(['action' => 'index']);

View File

@ -93,13 +93,13 @@ class FilesController extends BaseController
$this->em->persist($media);
$this->em->flush();
$this->alert('<b>Media metadata updated!</b>', 'green');
$this->alert('<b>'._('Media metadata updated!').'</b>', 'green');
$default_url = $this->url->routeFromHere(['action' => 'index']);
return $this->redirectToStoredReferrer('media_edit', $default_url);
}
return $this->renderForm($form, 'edit', 'Edit Media Metadata');
return $this->renderForm($form, 'edit', _('Edit Media Metadata'));
}
public function listAction()
@ -141,11 +141,11 @@ class FilesController extends BaseController
$short = ltrim(str_replace($this->base_dir, '', $i), '/');
if (is_dir($i))
$media = ['name' => 'Directory', 'playlists' => '', 'is_playable' => false];
$media = ['name' => _('Directory'), 'playlists' => '', 'is_playable' => false];
elseif (isset($media_in_dir[$short]))
$media = $media_in_dir[$short];
else
$media = ['name' => 'File Not Processed', 'playlists' => '', 'is_playable' => false];
$media = ['name' => _('File Not Processed'), 'playlists' => '', 'is_playable' => false];
$stat = stat($i);

View File

@ -64,13 +64,13 @@ class PlaylistsController extends BaseController
$this->_reloadStation();
$this->alert('<b>Stream updated!</b>', 'green');
$this->alert('<b>'._('Playlist updated.').'</b>', 'green');
return $this->redirectFromHere(['action' => 'index', 'id' => NULL]);
}
$this->view->form = $form;
$this->view->title = (($this->hasParam('id')) ? 'Edit' : 'Add').' Playlist';
$this->view->title = ($this->hasParam('id')) ? _('Edit Playlist') : _('Add Playlist');
}
public function deleteAction()
@ -89,7 +89,7 @@ class PlaylistsController extends BaseController
$this->_reloadStation();
$this->alert('<b>Record deleted.</b>', 'green');
$this->alert('<b>'._('Record deleted.').'</b>', 'green');
return $this->redirectFromHere(['action' => 'index', 'id' => NULL]);
}
@ -101,6 +101,6 @@ class PlaylistsController extends BaseController
$backend->write();
$backend->start();
$this->alert('<b>Radio backend reloaded.</b><br>Your listeners will not be disconnected by playlist changes, but songs may change abruptly.', 'green');
$this->alert('<b>'._('Radio backend reloaded.').'</b><br>'._('Your listeners will not be disconnected by playlist changes, but songs may change abruptly.'), 'green');
}
}

View File

@ -64,7 +64,7 @@ class ProfileController extends BaseController
return $this->redirectFromHere(array('action' => 'index'));
}
return $this->renderForm($form, 'edit', 'Edit Station Profile');
return $this->renderForm($form, 'edit', _('Edit Station Profile'));
}
public function backendAction()
@ -76,19 +76,19 @@ class ProfileController extends BaseController
case "skip":
$adapter->skip();
$this->alert('<b>Song skipped.</b>', 'green');
$this->alert('<b>'._('Song skipped.').'</b>', 'green');
break;
case "stop":
$adapter->stop();
$this->alert('<b>Adapter stopped.</b>', 'green');
$this->alert('<b>'._('Adapter stopped.').'</b>', 'green');
break;
case "start":
$adapter->start();
$this->alert('<b>Adapter started.</b>', 'green');
$this->alert('<b>'._('Adapter started.').'</b>', 'green');
break;
case "restart":
@ -97,7 +97,7 @@ class ProfileController extends BaseController
$adapter->write();
$adapter->start();
$this->alert('<b>Adapter rebooted.</b>', 'green');
$this->alert('<b>'._('Adapter rebooted.').'</b>', 'green');
break;
}
@ -113,13 +113,13 @@ class ProfileController extends BaseController
case "stop":
$adapter->stop();
$this->alert('<b>Adapter stopped.</b>', 'green');
$this->alert('<b>'._('Adapter stopped.').'</b>', 'green');
break;
case "start":
$adapter->start();
$this->alert('<b>Adapter started.</b>', 'green');
$this->alert('<b>'._('Adapter started.').'</b>', 'green');
break;
case "restart":
@ -128,7 +128,7 @@ class ProfileController extends BaseController
$adapter->write();
$adapter->start();
$this->alert('<b>Frontend rebooted.</b>', 'green');
$this->alert('<b>'._('Adapter rebooted.').'</b>', 'green');
break;
}

View File

@ -19,7 +19,7 @@ class StreamersController extends BaseController
$this->em->persist($this->station);
$this->em->flush();
$this->alert('<b>Streamers enabled!</b><br>You can now set up streamer (DJ) accounts.', 'green');
$this->alert('<b>'._('Streamers enabled!').'</b><br>'._('You can now set up streamer (DJ) accounts.'), 'green');
return $this->redirectFromHere(['enable' => null]);
}
@ -61,12 +61,12 @@ class StreamersController extends BaseController
$this->em->persist($record);
$this->em->flush();
$this->alert('<b>Streamer account updated!</b>', 'green');
$this->alert('<b>'._('Streamer account updated!').'</b>', 'green');
return $this->redirectFromHere(['action' => 'index', 'id' => NULL]);
}
$title = (($this->hasParam('id')) ? 'Edit' : 'Add').' Streamer (DJ) Account';
$title = (($this->hasParam('id')) ? _('Edit Streamer') : _('Add Streamer'));
return $this->renderForm($form, 'edit', $title);
}
@ -84,7 +84,7 @@ class StreamersController extends BaseController
$this->em->flush();
$this->alert('<b>Record deleted.</b>', 'green');
$this->alert('<b>'._('Record deleted.').'</b>', 'green');
return $this->redirectFromHere(['action' => 'index', 'id' => NULL]);
}
}

View File

@ -1,25 +1,25 @@
<?php $this->layout('main', ['title' => 'Automated Playlist Assignment', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Automated Playlist Assignment'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Automated Playlist Assignment</h2>
<h2><?=_('Automated Playlist Assignment') ?></h2>
</div>
<div class="card-body card-padding">
<p>Based on the previous performance of your station's songs, <?=$config->application->name ?> can automatically distribute songs evenly among your playlists, placing the highest performing songs in the highest-weighted playlists.</p>
<p><?=sprintf(_('Based on the previous performance of your station\'s songs, %s can automatically distribute songs evenly among your playlists, placing the highest performing songs in the highest-weighted playlists.'), $config->application->name) ?></p>
<p>Once you have configured automated assignment, click the button below to run the automated assignment process. This process will not run at all unless you have selected "Enable" below.</p>
<p><?=_('Once you have configured automated assignment, click the button below to run the automated assignment process. This process will not run at all unless you have selected "Enable" below.') ?></p>
<a class="btn btn-warning" href="<?=$url->routeFromHere(['action' => 'run']) ?>">Run Automated Assignment</a>
<a class="btn btn-warning" href="<?=$url->routeFromHere(['action' => 'run']) ?>"><?=_('Run Automated Assignment') ?></a>
</div>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Configure Automated Assignment</h2>
<h2><?=_('Configure Automated Assignment') ?></h2>
</div>
<div class="card-body card-padding">
<?=$this->fetch('partials/form') ?>

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'File Manager', 'manual' => true, 'page_class' => 'page-file-manager']) ?>
<?php $this->layout('main', ['title' => _('Media Manager'), 'manual' => true, 'page_class' => 'page-file-manager']) ?>
<?php $this->start('custom_js') ?>
<script type="text/javascript" src="<?=$url->content('vendors/bower_components/jPlayer/dist/jplayer/jquery.jplayer.min.js') ?>"></script>
@ -7,14 +7,14 @@
<?php $this->stop('custom_js') ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header ch-alt">
<h2>Music File Manager</h2>
<h2><?=_('Media Manager') ?></h2>
</div>
<div class="card-body">
@ -23,37 +23,36 @@
<div class="card-body card-padding-sm">
<div id="upload_progress"></div>
<div id="file_drop_target">
Drag files here to upload to this folder
<b>or</b>
<?=_('Drag files here to upload to this folder or ') ?>
<input type="file" multiple />
</div>
<div class="row p-t-20">
<div class="col-sm-6">
With selected:
<?=_('With selected:') ?>
<?php if (!empty($playlists)): ?>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
Add to Playlist
<?=_('Add to Playlist') ?>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<?php foreach($playlists as $playlist_id => $playlist_name): ?>
<li><a href="#" class="btn-batch" data-action="playlist_<?=$playlist_id ?>"><?=$playlist_name ?></a></li>
<li><a href="#" class="btn-batch" data-action="playlist_<?=$playlist_id ?>"><?=$this->e($playlist_name) ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<button type="button" class="btn btn-warning btn-batch" data-action="clear">Clear Playlists</button>
<button type="button" class="btn btn-danger btn-batch" data-action="delete">Delete</button>
<button type="button" class="btn btn-warning btn-batch" data-action="clear"><?=_('Clear Playlists') ?></button>
<button type="button" class="btn btn-danger btn-batch" data-action="delete"><?=_('Delete') ?></button>
</div>
<div class="col-sm-6">
<form method="post" id="mkdir">
<div class="input-group">
<input name="name" type="text" class="form-control" placeholder="New Folder Name" aria-label="...">
<input name="name" type="text" class="form-control" placeholder="<?=_('New Folder Name') ?>" aria-label="...">
<div class="input-group-btn">
<button type="submit" class="btn btn-default">Create Folder</button>
<button type="submit" class="btn btn-default"><?=_('Create Folder') ?></button>
</div>
</div>
</form>
@ -64,14 +63,14 @@
<table class="data-table table table-striped" id="file-table">
<thead>
<tr>
<th data-column-id="name" data-formatter="playable" data-identifier="true">Name</th>
<th data-column-id="media_title" data-visible="false">Title</th>
<th data-column-id="media_artist" data-visible="false">Artist</th>
<th data-column-id="media_length" data-formatter="file_length">Length</th>
<th data-column-id="size" data-formatter="file_size">Size</th>
<th data-column-id="mtime" data-formatter="file_mtime">Modified</th>
<th data-column-id="media_playlists">Playlists</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">Actions</th>
<th data-column-id="name" data-formatter="playable" data-identifier="true"><?=_('Name') ?></th>
<th data-column-id="media_title" data-visible="false"><?=_('Title') ?></th>
<th data-column-id="media_artist" data-visible="false"><?=_('Artist') ?></th>
<th data-column-id="media_length" data-formatter="file_length"><?=_('Length') ?></th>
<th data-column-id="size" data-formatter="file_size"><?=_('Size') ?></th>
<th data-column-id="mtime" data-formatter="file_mtime"><?=_('Modified') ?></th>
<th data-column-id="media_playlists"><?=_('Playlists') ?></th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false"><?=_('Actions') ?></th>
</tr>
</thead>
<tbody></tbody>
@ -121,7 +120,7 @@ $(function() {
},
"commands": function(column, row) {
if (row.media_edit_url)
return '<a class="btn btn-sm btn-primary" href="'+row.media_edit_url+'">Edit</a>';
return '<a class="btn btn-sm btn-primary" href="'+row.media_edit_url+'"><?=_('Edit') ?></a>';
else
return '';
},

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'Station Center', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Station Center'), 'manual' => true]) ?>
<?php $this->start('custom_js') ?>
<script type="text/javascript" src="//code.highcharts.com/highcharts.js"></script>
@ -18,14 +18,14 @@ $(function () {
</script>
<div class="block-header">
<h2>Station Center</h2>
<h2><?=_('Station Center') ?></h2>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header ch-alt">
<h2>Listeners By Day</h2>
<h2><?=_('Listeners By Day') ?></h2>
</div>
<div class="card-body card-padding-sm">
<?=$this->fetch('controller::index-dailystats') ?>
@ -38,7 +38,7 @@ $(function () {
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Listeners by Hour of Day</h2>
<h2><?=_('Listeners by Hour of Day') ?></h2>
</div>
<div class="card-body card-padding-sm">
<?=$this->fetch('controller::index-hourlystats') ?>
@ -48,7 +48,7 @@ $(function () {
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Listeners by Day of Week</h2>
<h2><?=_('Listeners by Day of Week') ?></h2>
</div>
<div class="card-body card-padding-sm">
<?=$this->fetch('controller::index-dayofweek') ?>
@ -61,7 +61,7 @@ $(function () {
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2><i class="zmdi zmdi-thumb-up"></i> Best Performing Songs<br><small>in the last 48 hours</small></h2>
<h2><i class="zmdi zmdi-thumb-up"></i> <?=_('Best Performing Songs') ?><br><small><?=_('in the last 48 hours') ?></small></h2>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-nopadding">
@ -71,8 +71,8 @@ $(function () {
</colgroup>
<thead>
<tr>
<th>Change</th>
<th>Song</th>
<th><?=_('Change') ?></th>
<th><?=_('Song') ?></th>
</tr>
</thead>
<tbody>
@ -101,7 +101,7 @@ $(function () {
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2><i class="zmdi zmdi-thumb-down"></i> Worst Performing Songs<br><small>in the last 48 hours</small></h2>
<h2><i class="zmdi zmdi-thumb-down"></i> <?=_('Worst Performing Songs') ?><br><small><?=_('in the last 48 hours') ?></small></h2>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-nopadding">
@ -111,8 +111,8 @@ $(function () {
</colgroup>
<thead>
<tr>
<th>Change</th>
<th>Song</th>
<th><?=_('Change') ?></th>
<th><?=_('Song') ?></th>
</tr>
</thead>
<tbody>
@ -144,7 +144,7 @@ $(function () {
<div class="col-sm-12">
<div class="card">
<div class="card-header ch-alt">
<h2>Most Played Songs<br><small>in the last month</small></h2>
<h2><?=_('Most Played Songs') ?><br><small><?=_('in the last month') ?></small></h2>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-nopadding">
@ -154,8 +154,8 @@ $(function () {
</colgroup>
<thead>
<tr>
<th>Plays</th>
<th>Song</th>
<th><?=_('Plays') ?></th>
<th><?=_('Song') ?></th>
</tr>
</thead>
<tbody>

View File

@ -1,7 +1,7 @@
<?php $this->layout('main', ['title' => 'Recent Playback Timeline', 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">

View File

@ -1,7 +1,7 @@
<?php $this->layout('main', ['manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">

View File

@ -1,12 +1,12 @@
<?php $this->layout('main', ['title' => 'Playlists', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Playlists'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Station Playlists</h2>
<h2><?=_('Playlists') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
@ -20,10 +20,10 @@
</colgroup>
<thead>
<tr>
<th>Actions</th>
<th>Playlist</th>
<th>Type</th>
<th># Songs</th>
<th><?=_('Actions') ?></th>
<th><?=_('Playlist') ?></th>
<th><?=_('Type') ?></th>
<th><?=_('# Songs') ?></th>
</tr>
</thead>
<tbody>
@ -36,26 +36,25 @@
<td>
<big><?=$row['name'] ?></big>
<?php if ($row['include_in_automation']): ?>
<br><span class="label label-success">Auto-Assigned</span>
<br><span class="label label-success"><?=_('Auto-Assigned') ?></span>
<?php endif; ?>
</td>
<td>
<?php if (!$row['is_enabled']): ?>
Disabled
<?=_('Disabled') ?>
<?php elseif ($row['type'] == 'default'): ?>
Standard Playlist<br>
Weight: <?=$row['weight'] ?> (<?=$row['probability'] ?>)
<?=_('Standard Playlist') ?><br>
<?=_('Weight') ?>: <?=$row['weight'] ?> (<?=$row['probability'] ?>)
<?php elseif ($row['type'] == 'scheduled'): ?>
Scheduled Playlist<br>
Plays between <?=\Entity\StationPlaylist::formatTimeCode($row['schedule_start_time']) ?>
and <?=\Entity\StationPlaylist::formatTimeCode($row['schedule_end_time']) ?>
<?=_('Scheduled Playlist') ?><br>
<?=sprintf(_('Plays between %s and %s'), \Entity\StationPlaylist::formatTimeCode($row['schedule_start_time']), \Entity\StationPlaylist::formatTimeCode($row['schedule_end_time'])) ?>
<?php elseif ($row['type'] == 'once_per_x_songs'): ?>
Once per <?=$row['play_per_songs'] ?> Songs
<?=sprintf(_('Once per %d Songs'), $row['play_per_songs']) ?>
<?php elseif ($row['type'] == 'once_per_x_minutes'): ?>
Once per <?=$row['play_per_minutes'] ?> Minutes
<?=sprintf(_('Once per %d Minutes'), $row['play_per_minutes']) ?>
<?php elseif ($row['type'] == 'once_per_day'): ?>
Once per Day<br>
Plays at <?=\Entity\StationPlaylist::formatTimeCode($row['play_once_time']) ?>
<?=_('Once per Day') ?><br>
<?=sprintf(_('Plays at %s'), \Entity\StationPlaylist::formatTimeCode($row['play_once_time'])) ?>
<?php endif; ?>
</td>
<td><?=$row['num_songs'] ?></td>

View File

@ -1,56 +1,56 @@
<?php $this->layout('main', ['title' => 'Station Profile', 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="row">
<div class="col-sm-6">
<div class="card">
<div class="card-header ch-alt">
<h2>Basic Profile</h2>
<h2><?=_('Basic Profile') ?></h2>
<a class="btn bgm-blue btn-float" title="Edit Profile" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><i class="zmdi zmdi-edit"></i></a>
</div>
<div class="card-body card-padding">
<dl>
<dt>Station Name:</dt>
<dd><?=$station->name ?></dd>
<dt><?=_('Station Name') ?>:</dt>
<dd><?=$this->e($station->name) ?></dd>
<dt>Description:</dt>
<dd><?=$station->description ?></dd>
<dt><?=_('Station Description') ?>:</dt>
<dd><?=$this->e($station->description) ?></dd>
</dl>
</div>
</div>
<div class="card">
<div class="card-header <?php if ($station->enable_requests): ?>bgm-green<?php else: ?>bgm-red<?php endif; ?>">
<h2>Song Requests</h2>
<h2><?=_('Song Requests') ?></h2>
</div>
<div class="card-body card-padding">
<?php if ($station->enable_requests): ?>
<p>Song requests are currently <b>enabled</b> for this station.</p>
<p><?=_('Song requests are currently <b>enabled</b> for this station.') ?></p>
<?php if ($station->request_delay == 0): ?>
<p>Requests are queued for playback immediately after the currently playing song.</p>
<p><?=_('Requests are queued for playback immediately after the currently playing song.') ?></p>
<?php else: ?>
<p>Requests are queued for playback on the station within <b><?=$station->request_delay ?> to <?=($station->request_delay*2) ?> minutes</b> of being submitted.</p>
<p><?=sprintf(_('Requests are queued for playback on the station within <b>%d to %d minutes</b> of being submitted.'), $station->request_delay, $station->request_delay*2) ?></p>
<?php endif; ?>
<?php else: ?>
<p>Song requests are currently <b>disabled</b> for this station. Edit your profile above to enable them.</p>
<p><?=_('Song requests are currently <b>disabled</b> for this station. Edit your profile above to enable them.') ?></p>
<?php endif; ?>
</div>
</div>
<div class="card">
<div class="card-header <?php if ($station->enable_streamers): ?>bgm-green<?php else: ?>bgm-red<?php endif; ?>">
<h2>Streamers/DJs</h2>
<h2><?=_('Streamers/DJs') ?></h2>
</div>
<div class="card-body card-padding">
<?php if ($station->enable_streamers): ?>
<p>Support for live streamers / DJs is currently <b>enabled</b> for this station. Edit your profile above to enable it.</p>
<p>Manage streamer accounts <a href="<?=$url->routeFromHere(['controller' => 'streamers']) ?>">on the Streamers / DJ Accounts page</a>.</p>
<p><?=_('Support for live streamers / DJs is currently <b>enabled</b> for this station. Edit your profile above to enable it.') ?></p>
<p><?=sprintf(_('Manage streamer accounts <a href="%s">on the Streamers / DJ Accounts page</a>.'), $url->routeFromHere(['controller' => 'streamers'])) ?></p>
<?php else: ?>
<p>Support for live streamers / DJs is currently <b>disabled</b> for this station.</p>
<p>Only the AutoDJ (based on your uploaded media and playlists) will be able to play on the air.</p>
<p><?=_('Support for live streamers / DJs is currently <b>disabled</b> for this station.') ?></p>
<p><?=_('Only the AutoDJ (based on your uploaded media and playlists) will be able to play on the air.') ?></p>
<?php endif; ?>
</div>
</div>
@ -60,8 +60,8 @@
<div class="card">
<div class="card-header <?php if ($frontend_is_running): ?>bgm-green<?php else: ?>bgm-red<?php endif; ?> ch-alt">
<h2>
IceCast (Broadcasting Service)<br>
<small><?php if ($frontend_is_running): ?>Running<?php else: ?>Not Running<?php endif; ?></small>
<?=_('IceCast (Broadcasting Service)') ?><br>
<small><?php if ($frontend_is_running): ?><?=_('Running') ?><?php else: ?><?=_('Not Running') ?><?php endif; ?></small>
</h2>
<ul class="actions">
@ -70,27 +70,27 @@
<i class="zmdi zmdi-more-vert"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'restart']) ?>">Restart Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'start']) ?>">Start Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'stop']) ?>">Stop Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'restart']) ?>"><?=_('Restart Service') ?></a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'start']) ?>"><?=_('Start Service') ?></a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'frontend', 'do' => 'stop']) ?>"><?=_('Stop Service') ?></a></li>
</ul>
</li>
</ul>
</div>
<div class="card-body card-padding">
<dl>
<dt>Stream Public URL:</dt>
<dt><?=_('Stream Public URL') ?>:</dt>
<dd><a href="<?=$frontend_adapter->getStreamUrl() ?>"><?=$frontend_adapter->getStreamUrl() ?></a></dd>
</dl>
<dl>
<dt>Administration URL:</dt>
<dt><?=_('Administration URL') ?>:</dt>
<dd><a href="<?=$frontend_adapter->getAdminUrl() ?>"><?=$frontend_adapter->getAdminUrl() ?></a></dd>
<dt>Administrator Password:</dt>
<dt><?=_('Administrator Password') ?>:</dt>
<dd><?=$frontend_config['admin_pw'] ?></dd>
<dt>Source Password:</dt>
<dt><?=_('Source Password') ?>:</dt>
<dd><?=$frontend_config['source_pw'] ?></dd>
</dl>
</div>
@ -101,8 +101,8 @@
<div class="card">
<div class="card-header <?php if ($backend_is_running): ?>bgm-green<?php else: ?>bgm-red<?php endif; ?> ch-alt">
<h2>
LiquidSoap (AutoDJ Service)<br>
<small><?php if ($backend_is_running): ?>Running<?php else: ?>Not Running<?php endif; ?></small>
<?=_('LiquidSoap (AutoDJ Service)') ?><br>
<small><?php if ($backend_is_running): ?><?=_('Running') ?><?php else: ?><?=_('Not Running') ?><?php endif; ?></small>
</h2>
<ul class="actions">
@ -111,17 +111,17 @@
<i class="zmdi zmdi-more-vert"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'skip']) ?>">Skip Song</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'skip']) ?>"><?=_('Skip Song') ?></a></li>
<li class="divider">&nbsp;</li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'restart']) ?>">Restart Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'start']) ?>">Start Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'stop']) ?>">Stop Service</a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'restart']) ?>"><?=_('Restart Service') ?></a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'start']) ?>"><?=_('Start Service') ?></a></li>
<li><a href="<?=$url->routeFromHere(['action' => 'backend', 'do' => 'stop']) ?>"><?=_('Stop Service') ?></a></li>
</ul>
</li>
</ul>
</div>
<div class="card-body card-padding">
<p>LiquidSoap is currently shuffling from <b><?=$num_songs ?> uploaded songs</b> in <b><?=$num_playlists ?> playlists</b>.</p>
<p><?=sprintf(_('LiquidSoap is currently shuffling from <b>%d uploaded songs</b> in <b>%d playlists</b>.'), $num_songs, $num_playlists) ?></p>
</div>
</div>
<?php endif; ?>

View File

@ -1,16 +1,16 @@
<?php $this->layout('main', ['title' => 'Song Duplicates', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Song Duplicates'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Possible Song Duplicates</h2>
<h2><?=_('Song Duplicates') ?></h2>
</div>
<?php if (empty($dupes)): ?>
<div class="card-body card-padding">
No duplicates were found. Nice work!
<?=_('No duplicates were found. Nice work!') ?>
</div>
<?php else: ?>
<?php foreach($dupes as $dupe_row): ?>
@ -24,17 +24,17 @@
</colgroup>
<thead>
<tr>
<th>Actions</th>
<th>Title / File Path</th>
<th class="text-right">Playlists</th>
<th class="text-right">Length</th>
<th><?=_('Actions') ?></th>
<th><?=_('Title / File Path') ?></th>
<th class="text-right"><?=_('Playlists') ?></th>
<th class="text-right"><?=_('Length') ?></th>
</tr>
</thead>
<tbody>
<?php foreach($dupe_row as $media_row): ?>
<tr class="input">
<td>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(['action' => 'deletedupe', 'media_id' => $media_row['id']]) ?>">Delete</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(['action' => 'deletedupe', 'media_id' => $media_row['id']]) ?>"><?=_('Delete') ?></a>
</td>
<td>
<big><?=$media_row['song']['artist'] ?> - <?=$media_row['song']['title'] ?></big><br>

View File

@ -1,16 +1,16 @@
<?php $this->layout('main', ['title' => 'Listener Impact Report', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Song Listener Impact'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Song Listener Impact Report</h2>
<h2><?=_('Song Listener Impact') ?></h2>
<ul class="actions">
<li>
<a href="<?=$url->routeFromHere(['format' => 'csv']) ?>" title="Download Excel CSV">
<a href="<?=$url->routeFromHere(['format' => 'csv']) ?>" title="<?=_('Download CSV') ?>">
<i class="zmdi zmdi-download"></i>
</a>
</li>

View File

@ -1,16 +1,16 @@
<?php $this->layout('main', ['title' => 'Manage Streamers/DJs', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Streamer/DJ Accounts'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="card">
<div class="card-header ch-alt">
<h2>Streamer/DJ Accounts</h2>
<h2><?=_('Streamer/DJ Accounts') ?></h2>
</div>
<div class="card-body card-padding">
<p>Streamer accounts are currently disabled for this station. To enable streamer accounts, click the button below.</p>
<p><?=_('Streamer accounts are currently disabled for this station. To enable streamer accounts, click the button below.') ?></p>
<a class="btn btn-lg btn-success" href="<?=$url->current() ?>?enable=true">Enable Streaming</a>
<a class="btn btn-lg btn-success" href="<?=$url->current() ?>?enable=true"><?=_('Enable Streaming') ?></a>
</div>
</div>

View File

@ -1,14 +1,14 @@
<?php $this->layout('main', ['title' => 'Manage Streamers/DJs', 'manual' => true]) ?>
<?php $this->layout('main', ['title' => _('Streamer/DJ Accounts'), 'manual' => true]) ?>
<div class="block-header">
<h2><?=$station->name ?></h2>
<h2><?=$this->e($station->name) ?></h2>
</div>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header ch-alt">
<h2>Streamer/DJ Accounts</h2>
<h2><?=_('Streamer/DJ Accounts') ?></h2>
<a class="btn bgm-blue btn-float" href="<?=$url->routeFromHere(array('action' => 'edit')) ?>"><i class="zmdi zmdi-plus"></i></a>
</div>
@ -22,10 +22,10 @@
</colgroup>
<thead>
<tr>
<th>Actions</th>
<th>Username</th>
<th>Password</th>
<th>Notes</th>
<th><?=_('Actions') ?></th>
<th><?=_('Username') ?></th>
<th><?=_('Password') ?></th>
<th><?=_('Notes') ?></th>
</tr>
</thead>
<tbody>
@ -35,9 +35,9 @@
<a class="btn btn-sm btn-primary" href="<?=$url->routeFromHere(array('action' => 'edit', 'id' => $row->id)) ?>">Edit</a>
<a class="btn btn-sm btn-danger" href="<?=$url->routeFromHere(array('action' => 'delete', 'id' => $row->id)) ?>">Delete</a>
</td>
<td><code><?=$row->streamer_username ?></code></td>
<td><code><?=$row->streamer_password ?></code></td>
<td><?=nl2br($row->comments) ?></td>
<td><code><?=$this->e($row->streamer_username) ?></code></td>
<td><code><?=$this->e($row->streamer_password) ?></code></td>
<td><?=nl2br($this->e($row->comments)) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
@ -48,7 +48,7 @@
<div class="col-md-4">
<div class="card">
<div class="card-header ch-alt">
<h2>Connection Information</h2>
<h2><?=_('Connection Information') ?></h2>
</div>
<div class="card-body card-padding">
<?
@ -57,30 +57,30 @@
if ($frontend_type == 'icecast'):
?>
<h4>IceCast Clients</h4>
<h4><?=_('IceCast Clients') ?></h4>
<dl>
<dt>Server:</dt>
<dt><?=_('Server') ?>:</dt>
<dd><?=$server_url ?></dd>
<dt>Port:</dt>
<dt><?=_('Port') ?>:</dt>
<dd><?=(int)$frontend_info['port'] ?></dd>
<dt>Mount Name:</dt>
<dt><?=_('Mount Name') ?>:</dt>
<dd>/radio.mp3</dd>
</dl>
<h4>ShoutCast 1.x Legacy Clients</h4>
<h4><?=_('ShoutCast 1.x Legacy Clients') ?></h4>
<dl>
<dt>Server:</dt>
<dt><?=_('Server') ?>:</dt>
<dd><?=$server_url ?></dd>
<dt>Port:</dt>
<dt><?=_('Port') ?>:</dt>
<dd><?=(int)$frontend_info['port']+1 ?></dd>
<dt>Username:</dt>
<dt><?=('Username') ?>:</dt>
<dd>(Leave blank)</dd>
<dt>Password:</dt>
<dt><?=_('Password') ?>:</dt>
<dd><?=$frontend_info['streamer_pw'] ?></dd>
</dl>
<?

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'Restart Services']) ?>
<?php $this->layout('main', ['title' => _('Restart Broadcasting')]) ?>
<h3>Rewriting Configuration and Restarting Services</h3>
<p>Any status messages related to this process will appear as notifications on this page.</p>
<h3><?=_('Restart Broadcasting') ?></h3>
<p><?=_('Any status messages related to this process will appear as notifications on this page.') ?></p>

View File

@ -1,4 +1,4 @@
<?php $this->layout('main', ['title' => 'Write Configuration']) ?>
<?php $this->layout('main', ['title' => _('Write Configuration')]) ?>
<h3>Rewriting Configuration Only (No Restart)</h3>
<p>Any status messages related to this process will appear as notifications on this page.</p>
<h3><?=_('Write Configuration') ?></h3>
<p><?=_('Any status messages related to this process will appear as notifications on this page.') ?></p>

View File

@ -68,16 +68,16 @@ var APP_ContentPath = '<?=$url->content('') ?>';
<a data-toggle="dropdown" href=""><i class="tm-icon zmdi zmdi-radio"></i></a>
<ul class="dropdown-menu dm-icon pull-right">
<li>
<a href="javascript:;" class="jp-pause"><i class="zmdi zmdi-pause"></i> Pause</a>
<a href="javascript:;" class="jp-pause"><i class="zmdi zmdi-pause"></i> <?=_('Pause') ?></a>
</li>
<li>
<a href="javascript:;" class="jp-play"><i class="zmdi zmdi-play"></i> Play</a>
<a href="javascript:;" class="jp-play"><i class="zmdi zmdi-play"></i> <?=_('Play') ?></a>
</li>
<li>
<a href="javascript:;" class="jp-mute"><i class="zmdi zmdi-portable-wifi-off"></i> Mute</a>
<a href="javascript:;" class="jp-mute"><i class="zmdi zmdi-portable-wifi-off"></i> <?=_('Mute') ?></a>
</li>
<li>
<a href="javascript:;" class="jp-unmute"><i class="zmdi zmdi-portable-wifi"></i> Unmute</a>
<a href="javascript:;" class="jp-unmute"><i class="zmdi zmdi-portable-wifi"></i> <?=_('Unmute') ?></a>
</li>
<li>
<div class="progress jp-volume-bar">
@ -91,14 +91,14 @@ var APP_ContentPath = '<?=$url->content('') ?>';
<a data-toggle="dropdown" href=""><i class="tm-icon zmdi zmdi-more-vert"></i></a>
<ul class="dropdown-menu dm-icon pull-right">
<? if ($di['acl']->isAllowed('administer all')): ?>
<li><a href="<?=$url->named('admin:index:index') ?>"><i class="fa fa-cog"></i> System Administration</a></li>
<li><a href="<?=$url->named('admin:index:index') ?>"><i class="fa fa-cog"></i> <?=_('System Administration') ?></a></li>
<? endif; ?>
<li><a href="<?=$url->named('profile:index') ?>"><i class="fa fa-user"></i> My Account</a></li>
<li><a href="<?=$url->named('profile:index') ?>"><i class="fa fa-user"></i> <?=_('My Account') ?></a></li>
<li class="divider">&nbsp;</li>
<li class="hidden-xs">
<a data-action="fullscreen" href=""><i class="zmdi zmdi-fullscreen"></i> Toggle Fullscreen</a>
<a data-action="fullscreen" href=""><i class="zmdi zmdi-fullscreen"></i> <?=_('Toggle Fullscreen') ?></a>
</li>
<li><a href="<?=$url->named('account:logout') ?>"><i class="fa fa-sign-out"></i> Sign Out</a></li>
<li><a href="<?=$url->named('account:logout') ?>"><i class="fa fa-sign-out"></i> <?=_('Sign Out') ?></a></li>
</ul>
</li>
</ul>

View File

@ -1,43 +1,43 @@
<ul class="main-menu">
<li class="menu-header">
<a href="<?=$url->named('stations:index:index', ['station' => $station->id]) ?>">
<?=$station->name ?>
<?=$this->e($station->name) ?>
</a>
</li>
<li><a href="<?=$url->named('stations:profile:index', ['station' => $station->id]) ?>"><i class="zmdi zmdi-image"></i> Profile</a></li>
<li><a href="<?=$url->named('stations:streamers:index', ['station' => $station->id]) ?>"><i class="zmdi zmdi-account"></i> Streamer/DJ Accounts</a></li>
<li><a href="<?=$url->named('stations:profile:index', ['station' => $station->id]) ?>"><i class="zmdi zmdi-image"></i> <?=_('Profile') ?></a></li>
<li><a href="<?=$url->named('stations:streamers:index', ['station' => $station->id]) ?>"><i class="zmdi zmdi-account"></i> <?=_('Streamer/DJ Accounts') ?></a></li>
<li class="sub-menu">
<a href=""><i class="zmdi zmdi-collection-music"></i> Media</a>
<a href=""><i class="zmdi zmdi-collection-music"></i> <?=_('Media') ?></a>
<ul>
<li><a href="<?=$url->named('stations:files:index', ['station' => $station->id]) ?>">Music Files</a></li>
<li><a href="<?=$url->named('stations:playlists:index', ['station' => $station->id]) ?>">Playlists</a></li>
<li><a href="<?=$url->named('stations:files:index', ['station' => $station->id]) ?>"><?=_('Music Files') ?></a></li>
<li><a href="<?=$url->named('stations:playlists:index', ['station' => $station->id]) ?>"><?=_('Playlists') ?></a></li>
</ul>
</li>
<li class="sub-menu">
<a href=""><i class="zmdi zmdi-assignment"></i> Reports</a>
<a href=""><i class="zmdi zmdi-assignment"></i> <?=_('Reports') ?></a>
<ul>
<li><a href="<?=$url->named('stations:index:timeline', ['station' => $station->id]) ?>">Song Playback Timeline</a></li>
<li><a href="<?=$url->named('stations:reports:performance', ['station' => $station->id]) ?>">Song Listener Impact</a></li>
<li><a href="<?=$url->named('stations:reports:duplicates', ['station' => $station->id]) ?>">Duplicate Songs</a></li>
<li><a href="<?=$url->named('stations:index:timeline', ['station' => $station->id]) ?>"><?=_('Song Playback Timeline') ?></a></li>
<li><a href="<?=$url->named('stations:reports:performance', ['station' => $station->id]) ?>"><?=_('Song Listener Impact') ?></a></li>
<li><a href="<?=$url->named('stations:reports:duplicates', ['station' => $station->id]) ?>"><?=_('Duplicate Songs') ?></a></li>
</ul>
</li>
<li class="sub-menu">
<a href=""><i class="zmdi zmdi-settings"></i> Utilities</a>
<a href=""><i class="zmdi zmdi-settings"></i> <?=_('Utilities') ?></a>
<ul>
<li><a href="<?=$url->named('stations:automation:index', ['station' => $station->id]) ?>">Automated Assignment</a></li>
<li><a href="<?=$url->named('stations:automation:index', ['station' => $station->id]) ?>"><?=_('Automated Assignment') ?></a></li>
<li><a href="<?=$url->named('stations:util:playlist', ['station' => $station->id, 'format' => 'pls']) ?>">Download Playlist File (PLS)</a></li>
<li><a href="<?=$url->named('stations:util:playlist', ['station' => $station->id, 'format' => 'm3u']) ?>">Download Playlist File (M3U)</a></li>
<li><a href="<?=$url->named('stations:util:playlist', ['station' => $station->id, 'format' => 'pls']) ?>"><?=_('Download Playlist File') ?> (PLS)</a></li>
<li><a href="<?=$url->named('stations:util:playlist', ['station' => $station->id, 'format' => 'm3u']) ?>"><?=_('Download Playlist File') ?> (M3U)</a></li>
<li><a href="<?=$url->named('stations:util:write', ['station' => $station->id]) ?>">Rebuild Backend Configuration</a></li>
<li><a href="<?=$url->named('stations:util:restart', ['station' => $station->id]) ?>">Restart Broadcasting</a></li>
<li><a href="<?=$url->named('stations:util:write', ['station' => $station->id]) ?>"><?=_('Write Configuration') ?></a></li>
<li><a href="<?=$url->named('stations:util:restart', ['station' => $station->id]) ?>"><?=_('Restart Broadcasting') ?></a></li>
</ul>
</li>
</ul>

View File

@ -25,10 +25,10 @@
- php7.0-fpm
- php7.0-cli
- php7.0-gd
- php7.0-mysqlnd
- php7.0-curl
- php7.0-xml
- php7.0-zip
- php7.0-intl
- name: Remove Old PHP Libraries
become: true