Supply DI container to config objects, combine some similar language usage in the localization template.
This commit is contained in:
parent
cad8810a57
commit
dd0f3c4170
|
@ -38,12 +38,22 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']))
|
|||
$_SERVER['HTTPS'] = (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https');
|
||||
|
||||
// Composer autoload.
|
||||
$autoloader = require(APP_INCLUDE_VENDOR . DIRECTORY_SEPARATOR . 'autoload.php');
|
||||
$autoloader = require(APP_INCLUDE_VENDOR . '/autoload.php');
|
||||
$autoloader->add('App', APP_INCLUDE_LIB);
|
||||
|
||||
// Set up DI container.
|
||||
$app_settings = [
|
||||
'displayErrorDetails' => true,
|
||||
'addContentLengthHeader' => false,
|
||||
];
|
||||
|
||||
if (APP_APPLICATION_ENV !== 'development')
|
||||
$app_settings['routerCacheFile'] = APP_INCLUDE_TEMP.'/app_routes.cache.php';
|
||||
|
||||
$di = new \Slim\Container(['settings' => $app_settings]);
|
||||
|
||||
// Save configuration object.
|
||||
$config = new \App\Config(APP_INCLUDE_BASE.'/config');
|
||||
$config->preload(array('application'));
|
||||
$config = new \App\Config(APP_INCLUDE_BASE.'/config', $di);
|
||||
|
||||
// Add application autoloaders to Composer's autoloader handler.
|
||||
$autoload_classes = $config->application->autoload->toArray();
|
||||
|
@ -70,16 +80,7 @@ foreach($php_settings as $setting_key => $setting_value)
|
|||
}
|
||||
}
|
||||
|
||||
$app_settings = [
|
||||
'displayErrorDetails' => true,
|
||||
'addContentLengthHeader' => false,
|
||||
];
|
||||
|
||||
if (APP_APPLICATION_ENV !== 'development')
|
||||
$app_settings['routerCacheFile'] = APP_INCLUDE_TEMP.'/app_routes.cache.php';
|
||||
|
||||
$di = new \Slim\Container(['settings' => $app_settings]);
|
||||
|
||||
// Override Slim handlers.
|
||||
$di['callableResolver'] = function($di) {
|
||||
return new \App\Mvc\Resolver($di);
|
||||
};
|
||||
|
@ -110,7 +111,7 @@ foreach($modules as $module)
|
|||
|
||||
$config_directory = $full_path.'/config';
|
||||
if (file_exists($config_directory))
|
||||
$module_config[$module] = new \App\Config($config_directory);
|
||||
$module_config[$module] = new \App\Config($config_directory, $di);
|
||||
|
||||
$module_class = 'Modules\\'.ucfirst($module).'\\Controllers\\';
|
||||
$autoloader->addPsr4($module_class, $full_path.'/controllers');
|
||||
|
@ -125,7 +126,7 @@ $di['em'] = function($di) {
|
|||
try
|
||||
{
|
||||
$config = $di['config'];
|
||||
$db_conf = $config->application->resources->doctrine->toArray();
|
||||
$db_conf = $config->application->doctrine->toArray();
|
||||
$db_conf['conn'] = $config->db->toArray();
|
||||
|
||||
return \App\Doctrine\EntityManagerFactory::create($di, $db_conf);
|
||||
|
@ -141,7 +142,7 @@ $di['db'] = function($di) {
|
|||
{
|
||||
$config = $di['config'];
|
||||
|
||||
$db_conf = $config->application->resources->doctrine->toArray();
|
||||
$db_conf = $config->application->doctrine->toArray();
|
||||
$db_conf['conn'] = $config->db->toArray();
|
||||
|
||||
$config = new \Doctrine\DBAL\Configuration;
|
||||
|
@ -282,32 +283,27 @@ if (!APP_IS_COMMAND_LINE)
|
|||
/*
|
||||
* Commands:
|
||||
* find /var/azuracast/www -type f \( -name '*.php' -or -name '*.phtml' \) -print > list
|
||||
* xgettext --files-from=list --language=PHP -o /var/azuracast/www/app/locale/messages.pot
|
||||
* xgettext --files-from=list --language=PHP -o /var/azuracast/www/app/locale/default.pot
|
||||
*
|
||||
* find /var/azuracast/www/app/locale -name \*.po -execdir msgfmt default.po -o default.mo \;
|
||||
*/
|
||||
|
||||
// Set up localization.
|
||||
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
if (!$locale)
|
||||
$locale = $di['em']->getRepository('Entity\Settings')->getSetting('locale', 'en_US.UTF-8');
|
||||
$browser_locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
|
||||
$langs = [
|
||||
'es' => 'es_ES.UTF-8',
|
||||
'fr' => 'fr_FR.UTF-8',
|
||||
'de' => 'de_DE.UTF-8',
|
||||
'ru' => 'ru_RU.UTF-8',
|
||||
];
|
||||
|
||||
foreach($langs as $lang_prefix => $lang_resolved)
|
||||
$supported_locales = $config->application->locale->supported->toArray();
|
||||
foreach($supported_locales as $lang_code => $lang_name)
|
||||
{
|
||||
if (substr($locale, 0, strlen($lang_prefix)) == $lang_prefix)
|
||||
if (strcmp(substr($browser_locale, 0, 2), substr($lang_code, 0, 2)) == 0)
|
||||
{
|
||||
$locale = $lang_resolved;
|
||||
$locale = $lang_code;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($locale))
|
||||
$locale = $di['em']->getRepository('Entity\Settings')->getSetting('locale', $config->application->locale->default);
|
||||
|
||||
putenv("LANG=".$locale);
|
||||
setlocale(LC_ALL, $locale);
|
||||
|
||||
|
|
|
@ -3,67 +3,72 @@
|
|||
* Application Settings
|
||||
*/
|
||||
|
||||
$session_lifetime = 86400*1;
|
||||
$session_lifetime = 86400 * 1;
|
||||
|
||||
$config = array(
|
||||
$config = [
|
||||
// Application name
|
||||
'name' => 'AzuraCast',
|
||||
'name' => 'AzuraCast',
|
||||
|
||||
// Subfolder for the application (if applicable)
|
||||
'base_uri' => '/',
|
||||
'base_uri' => '/',
|
||||
|
||||
// Base of the static URL.
|
||||
'static_uri' => '/static/',
|
||||
'static_uri' => '/static/',
|
||||
|
||||
'phpSettings' => array(
|
||||
'phpSettings' => [
|
||||
'display_startup_errors' => 0,
|
||||
'display_errors' => 0,
|
||||
'log_errors' => 1,
|
||||
'error_log' => APP_INCLUDE_TEMP.'/php_errors.log',
|
||||
'error_reporting' => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT,
|
||||
'session' => array(
|
||||
'use_only_cookies' => 1,
|
||||
'gc_maxlifetime' => $session_lifetime,
|
||||
'gc_probability' => 1,
|
||||
'gc_divisor' => 100,
|
||||
'cookie_lifetime' => $session_lifetime,
|
||||
'hash_function' => 'sha512',
|
||||
'display_errors' => 0,
|
||||
'log_errors' => 1,
|
||||
'error_log' => APP_INCLUDE_TEMP . '/php_errors.log',
|
||||
'error_reporting' => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT,
|
||||
'session' => [
|
||||
'use_only_cookies' => 1,
|
||||
'gc_maxlifetime' => $session_lifetime,
|
||||
'gc_probability' => 1,
|
||||
'gc_divisor' => 100,
|
||||
'cookie_lifetime' => $session_lifetime,
|
||||
'hash_function' => 'sha512',
|
||||
'hash_bits_per_character' => 4,
|
||||
),
|
||||
),
|
||||
|
||||
'includePaths' => array(
|
||||
APP_INCLUDE_LIB.'/ThirdParty',
|
||||
),
|
||||
|
||||
'pluginpaths' => array(
|
||||
],
|
||||
],
|
||||
|
||||
'includePaths' => [
|
||||
APP_INCLUDE_LIB . '/ThirdParty',
|
||||
],
|
||||
|
||||
'pluginpaths' => [
|
||||
'DF\Application\Resource\\' => 'DF/Application/Resource',
|
||||
),
|
||||
|
||||
'autoload' => array(
|
||||
'psr0' => array(
|
||||
'Entity' => APP_INCLUDE_MODELS,
|
||||
),
|
||||
'psr4' => array(
|
||||
'\\Proxy\\' => APP_INCLUDE_TEMP.'/proxies',
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
'resources' => array(
|
||||
/* RESOURCES: Locale */
|
||||
'locale' => array(
|
||||
'default' => 'en_US',
|
||||
),
|
||||
'autoload' => [
|
||||
'psr0' => [
|
||||
'Entity' => APP_INCLUDE_MODELS,
|
||||
],
|
||||
'psr4' => [
|
||||
'\\Proxy\\' => APP_INCLUDE_TEMP . '/proxies',
|
||||
],
|
||||
],
|
||||
|
||||
/* RESOURCES: Doctrine ORM Layer */
|
||||
'doctrine' => array(
|
||||
'autoGenerateProxies' => (APP_APPLICATION_ENV == "development"),
|
||||
'proxyNamespace' => 'Proxy',
|
||||
'proxyPath' => APP_INCLUDE_TEMP.'/proxies',
|
||||
'modelPath' => APP_INCLUDE_MODELS,
|
||||
),
|
||||
),
|
||||
);
|
||||
/* Localization Settings */
|
||||
'locale' => [
|
||||
'default' => 'en_US.UTF-8',
|
||||
'supported' => [
|
||||
'en_US.UTF-8' => 'English (Default)',
|
||||
'es_ES.UTF-8' => 'Español',
|
||||
'fr_FR.UTF-8' => 'Français',
|
||||
// 'de_DE.UTF-8' => 'Deutsch',
|
||||
// 'ru_RU.UTF-8' => 'Русский язык',
|
||||
],
|
||||
],
|
||||
|
||||
/* RESOURCES: Doctrine ORM Layer */
|
||||
'doctrine' => [
|
||||
'autoGenerateProxies' => (APP_APPLICATION_ENV == "development"),
|
||||
'proxyNamespace' => 'Proxy',
|
||||
'proxyPath' => APP_INCLUDE_TEMP . '/proxies',
|
||||
'modelPath' => APP_INCLUDE_MODELS,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Development mode changes.
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
<?php
|
||||
namespace App;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class Config
|
||||
{
|
||||
protected $_baseFolder;
|
||||
protected $_loaded_configs;
|
||||
|
||||
/** @var ContainerInterface */
|
||||
protected $di;
|
||||
|
||||
public function __construct($baseFolder)
|
||||
public function __construct($baseFolder, ContainerInterface $di)
|
||||
{
|
||||
$this->di = $di;
|
||||
$this->_loaded_configs = array();
|
||||
|
||||
if(is_dir($baseFolder))
|
||||
|
@ -38,7 +44,7 @@ class Config
|
|||
$config_base = $this->_baseFolder.DIRECTORY_SEPARATOR.$config_name;
|
||||
|
||||
if (is_dir($config_base))
|
||||
return new self($config_base); // Return entire directories.
|
||||
return new self($config_base, $this->di); // Return entire directories.
|
||||
else
|
||||
$this_config = $this->getFile($config_base); // Return single files.
|
||||
|
||||
|
@ -50,34 +56,15 @@ class Config
|
|||
|
||||
public function getFile($config_base)
|
||||
{
|
||||
$di = $this->di;
|
||||
|
||||
if (file_exists($config_base))
|
||||
return new \Zend\Config\Config(require $config_base);
|
||||
$config = require $config_base;
|
||||
elseif (file_exists($config_base.'.conf.php'))
|
||||
return new \Zend\Config\Config(require $config_base.'.conf.php');
|
||||
$config = require $config_base.'.conf.php';
|
||||
else
|
||||
return new \Zend\Config\Config(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Static Functions
|
||||
*/
|
||||
|
||||
public static function loadConfig($directory)
|
||||
{
|
||||
return new self($directory);
|
||||
}
|
||||
public static function loadModuleConfig($directory)
|
||||
{
|
||||
$module_config = array();
|
||||
foreach(new \DirectoryIterator($directory) as $item)
|
||||
{
|
||||
if($item->isDir() && !$item->isDot())
|
||||
{
|
||||
$config = $item->getPathname().DIRECTORY_SEPARATOR.'config';
|
||||
if(file_exists($config))
|
||||
$module_config[$item->getFilename()] = new self($config);
|
||||
}
|
||||
}
|
||||
return $module_config;
|
||||
$config = [];
|
||||
|
||||
return new \Zend\Config\Config($config);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-09-30 22:30+0000\n"
|
||||
"POT-Creation-Date: 2016-10-02 03:55+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -22,7 +22,7 @@ msgid "System Maintenance"
|
|||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/dashboard.conf.php:8
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:19
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:22
|
||||
msgid "System Settings"
|
||||
msgstr ""
|
||||
|
||||
|
@ -61,11 +61,11 @@ msgstr ""
|
|||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/action.conf.php:22
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/api_key.conf.php:15
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:27
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:43
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:30
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:52
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/song.conf.php:36
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/station.conf.php:101
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:34
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:37
|
||||
#: /var/azuracast/www/app/modules/stations/config/forms/automation.conf.php:32
|
||||
#: /var/azuracast/www/app/modules/stations/config/forms/media.conf.php:20
|
||||
#: /var/azuracast/www/app/modules/stations/config/forms/playlist.conf.php:171
|
||||
|
@ -77,12 +77,12 @@ msgstr ""
|
|||
msgid "API Key Owner"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:15
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:18
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:23
|
||||
msgid "Role Name"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:21
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/role.conf.php:24
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:48
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/stations/index.phtml:21
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/users/index.phtml:29
|
||||
|
@ -93,26 +93,30 @@ msgstr ""
|
|||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:23
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:26
|
||||
msgid "Site Base URL"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:24
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:27
|
||||
msgid ""
|
||||
"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."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:29
|
||||
msgid "Server Timezone"
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:32
|
||||
msgid "Default Language"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:30
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:38
|
||||
msgid "Server Time Zone"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:39
|
||||
msgid "All times displayed on the site will be based on this time zone."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:30
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/settings.conf.php:39
|
||||
#: /var/azuracast/www/app/modules/stations/config/forms/playlist.conf.php:94
|
||||
#: /var/azuracast/www/app/modules/stations/config/forms/playlist.conf.php:159
|
||||
#, php-format
|
||||
|
@ -203,7 +207,7 @@ msgid ""
|
|||
"stream."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:15
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:18
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/users/index.phtml:30
|
||||
#: /var/azuracast/www/app/modules/frontend/config/forms/login.conf.php:11
|
||||
#: /var/azuracast/www/app/modules/frontend/config/forms/profile.conf.php:23
|
||||
|
@ -213,60 +217,52 @@ msgstr ""
|
|||
msgid "E-mail Address"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:21
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:24
|
||||
#: /var/azuracast/www/app/modules/frontend/config/forms/profile.conf.php:30
|
||||
msgid "Reset Password"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:22
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:25
|
||||
msgid "Leave blank to use the current password."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/config/forms/user.conf.php:31
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:11
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/users/index.phtml:31
|
||||
msgid "Roles"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/ApiController.php:41
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/SettingsController.php:29
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/StationsController.php:52
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/AutomationController.php:26
|
||||
msgid "Changes saved."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/ApiController.php:46
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:46
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:94
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/StationsController.php:56
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:67
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:65
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:73
|
||||
msgid "Edit Record"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/ApiController.php:58
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:55
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:105
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/StationsController.php:74
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:78
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:92
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/StreamersController.php:87
|
||||
msgid "Record deleted."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:42
|
||||
msgid "Action updated."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:46
|
||||
msgid "Edit Action"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:55
|
||||
msgid "Action deleted."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:92
|
||||
msgid "Role updated."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:96
|
||||
msgid "Edit Role"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:107
|
||||
msgid "Role deleted!"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/SettingsController.php:29
|
||||
msgid "Settings updated!"
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/PermissionsController.php:90
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:61
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:67
|
||||
msgid "Record updated."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/SettingsController.php:33
|
||||
|
@ -274,19 +270,11 @@ msgstr ""
|
|||
msgid "Site Settings"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:63
|
||||
msgid "Record updated."
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:88
|
||||
msgid "Record not found!"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:80
|
||||
msgid "User deleted."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:90
|
||||
msgid "User not found!"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:95
|
||||
#: /var/azuracast/www/app/modules/admin/controllers/UsersController.php:93
|
||||
#, php-format
|
||||
msgid "Logged in as %s."
|
||||
msgstr ""
|
||||
|
@ -327,11 +315,6 @@ msgstr ""
|
|||
msgid "Manage Permissions"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:11
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/users/index.phtml:31
|
||||
msgid "Roles"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:32
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:34
|
||||
#: /var/azuracast/www/app/modules/admin/views/scripts/permissions/index.phtml:68
|
||||
|
@ -738,16 +721,8 @@ msgstr ""
|
|||
msgid "File Not Processed"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:67
|
||||
msgid "Playlist updated."
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:73
|
||||
msgid "Edit Playlist"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:73
|
||||
msgid "Add Playlist"
|
||||
msgid "Add Record"
|
||||
msgstr ""
|
||||
|
||||
#: /var/azuracast/www/app/modules/stations/controllers/PlaylistsController.php:104
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* Edit Role Form
|
||||
*/
|
||||
|
||||
/** @var \Doctrine\ORM\EntityManager $em */
|
||||
$em = $di['em'];
|
||||
|
||||
return [
|
||||
/**
|
||||
* Form Configuration
|
||||
|
@ -19,7 +22,7 @@ return [
|
|||
|
||||
'actions' => ['multiCheckbox', [
|
||||
'label' => _('Actions'),
|
||||
// Supply options in controller class.
|
||||
'options' => $em->getRepository(\Entity\Action::class)->fetchSelect(),
|
||||
]],
|
||||
|
||||
'submit' => ['submit', [
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
$base_url_parts = parse_url($_SERVER['HTTP_HOST']);
|
||||
$base_url_default = $base_url_parts['host'];
|
||||
|
||||
/** @var \App\Config $config */
|
||||
$config = $di['config'];
|
||||
|
||||
return [
|
||||
/**
|
||||
* Form Configuration
|
||||
|
@ -25,8 +28,14 @@ return [
|
|||
'default' => $base_url_default,
|
||||
]],
|
||||
|
||||
'locale' => ['radio', [
|
||||
'label' => _('Default Language'),
|
||||
'options' => $config->application->locale->supported->toArray(),
|
||||
'default' => $config->application->locale->default,
|
||||
]],
|
||||
|
||||
'timezone' => ['select', [
|
||||
'label' => _('Server Timezone'),
|
||||
'label' => _('Server Time Zone'),
|
||||
'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(),
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
* Edit User form
|
||||
*/
|
||||
|
||||
/** @var \Doctrine\ORM\EntityManager $em */
|
||||
$em = $di['em'];
|
||||
|
||||
return [
|
||||
/**
|
||||
* Form Configuration
|
||||
|
@ -25,8 +28,8 @@ return [
|
|||
]],
|
||||
|
||||
'roles' => ['multiCheckbox', [
|
||||
'label' => 'Roles',
|
||||
// Supply options in controller class.
|
||||
'label' => _('Roles'),
|
||||
'options' => $em->getRepository(\Entity\Role::class)->fetchSelect(),
|
||||
]],
|
||||
|
||||
'submit' => ['submit', [
|
||||
|
|
|
@ -39,11 +39,11 @@ class PermissionsController extends BaseController
|
|||
$this->em->persist($record);
|
||||
$this->em->flush();
|
||||
|
||||
$this->alert(_('Action updated.'), 'green');
|
||||
$this->alert(_('Record 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 Record'));
|
||||
}
|
||||
|
||||
public function deleteactionAction()
|
||||
|
@ -52,7 +52,7 @@ class PermissionsController extends BaseController
|
|||
if ($action)
|
||||
$action->delete();
|
||||
|
||||
$this->alert(_('Action deleted.'), 'green');
|
||||
$this->alert(_('Record deleted.'), 'green');
|
||||
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,6 @@ class PermissionsController extends BaseController
|
|||
public function editroleAction()
|
||||
{
|
||||
$form_config = $this->current_module_config->forms->role->form->toArray();
|
||||
$form_config['elements']['actions'][1]['options'] = $this->em->getRepository(Action::class)->fetchSelect();
|
||||
|
||||
$form = new \App\Form($form_config);
|
||||
|
||||
if ($this->hasParam('id'))
|
||||
|
@ -89,11 +87,11 @@ class PermissionsController extends BaseController
|
|||
$this->em->persist($record);
|
||||
$this->em->flush();
|
||||
|
||||
$this->alert('<b>'._('Role updated.').'</b>', 'green');
|
||||
$this->alert('<b>'._('Record 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 Record'));
|
||||
}
|
||||
|
||||
public function deleteroleAction()
|
||||
|
@ -104,7 +102,7 @@ class PermissionsController extends BaseController
|
|||
|
||||
$this->em->flush();
|
||||
|
||||
$this->alert('<b>'._('Role deleted!').'</b>', 'green');
|
||||
$this->alert('<b>'._('Record deleted.').'</b>', 'green');
|
||||
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL, 'csrf' => NULL));
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@ class SettingsController extends BaseController
|
|||
$data = $form->getValues();
|
||||
$settings_repo->setSettings($data);
|
||||
|
||||
$this->alert(_('Settings updated!'), 'green');
|
||||
$this->alert(_('Changes saved.'), 'green');
|
||||
return $this->redirectHere();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ class UsersController extends BaseController
|
|||
public function editAction()
|
||||
{
|
||||
$form_config = $this->current_module_config->forms->user->form->toArray();
|
||||
$form_config['elements']['roles'][1]['options'] = $this->em->getRepository(Role::class)->fetchSelect();
|
||||
|
||||
$form = new \App\Form($form_config);
|
||||
|
||||
if ($this->hasParam('id'))
|
||||
|
@ -77,17 +75,17 @@ class UsersController extends BaseController
|
|||
|
||||
$this->em->flush();
|
||||
|
||||
$this->alert('<b>'._('User deleted.').'</b>', 'green');
|
||||
$this->alert('<b>'._('Record deleted.').'</b>', 'green');
|
||||
return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
|
||||
}
|
||||
|
||||
public function impersonateAction()
|
||||
{
|
||||
$id = (int)$this->getParam('id');
|
||||
$user = User::find($id);
|
||||
$user = $this->em->getRepository(User::class)->find($id);
|
||||
|
||||
if (!($user instanceof User))
|
||||
throw new \App\Exception(_('User not found!'));
|
||||
throw new \App\Exception(_('Record not found!'));
|
||||
|
||||
// Set new identity in Zend_Auth
|
||||
$this->auth->masqueradeAsUser($user);
|
||||
|
|
|
@ -64,13 +64,13 @@ class PlaylistsController extends BaseController
|
|||
|
||||
$this->_reloadStation();
|
||||
|
||||
$this->alert('<b>'._('Playlist updated.').'</b>', 'green');
|
||||
$this->alert('<b>'._('Record updated.').'</b>', 'green');
|
||||
|
||||
return $this->redirectFromHere(['action' => 'index', 'id' => NULL]);
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->title = ($this->hasParam('id')) ? _('Edit Playlist') : _('Add Playlist');
|
||||
$this->view->title = ($this->hasParam('id')) ? _('Edit Record') : _('Add Record');
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
|
|
|
@ -33,11 +33,7 @@
|
|||
- name: Create Locales
|
||||
become: true
|
||||
locale_gen: name="{{ item }}" state=present
|
||||
with_items:
|
||||
- es_ES.UTF-8
|
||||
- fr_FR.UTF-8
|
||||
- de_DE.UTF-8
|
||||
- ru_RU.UTF-8
|
||||
with_lines: "cd {{ www_base }}/app/locale/; for i in $(ls -d */); do echo ${i%%/}; done"
|
||||
|
||||
- name: Remove Old PHP Libraries
|
||||
become: true
|
||||
|
|
Loading…
Reference in New Issue