From c6cf05f8ec7658767a6d8fcdb35141c64c490426 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 6 Jan 2019 16:59:16 +0100 Subject: [PATCH] refactor: Move app name to a config variable See #205 --- classes/Config.php | 7 +++++++ config/config.example.yml | 3 +++ controllers/FrontController.php | 1 + templates/inc/head.tpl | 6 +++--- templates/inc/logo.tpl | 2 +- templates/index.tpl | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 40c0de5..2f337ea 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -112,6 +112,13 @@ class Config */ public $avconvVerbosity = 'error'; + /** + * App name + * + * @var string + */ + public $appName = 'AllTube Download'; + /** * YAML config file path. * diff --git a/config/config.example.yml b/config/config.example.yml index 743a0af..9d1c4f4 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -42,3 +42,6 @@ remux: false # MP3 bitrate when converting (in kbit/s) audioBitrate: 128 + +# App name +appName: AllTube Download diff --git a/controllers/FrontController.php b/controllers/FrontController.php index e0b2633..41e8020 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -162,6 +162,7 @@ class FrontController $response, 'extractors.tpl', [ + 'config' => $this->config, 'extractors' => $this->download->listExtractors(), 'class' => 'extractors', 'title' => _('Supported websites'), diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index 3524870..b4a5cf1 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -10,13 +10,13 @@ {/if} -AllTube Download{if isset($title)} - {$title|escape}{/if} +{$config->appName}{if isset($title)} - {$title|escape}{/if} - + - + diff --git a/templates/inc/logo.tpl b/templates/inc/logo.tpl index 311f294..0b3dade 100644 --- a/templates/inc/logo.tpl +++ b/templates/inc/logo.tpl @@ -1,4 +1,4 @@

-AllTube Download +{$config->appName}

diff --git a/templates/index.tpl b/templates/index.tpl index 99a0c44..d151acb 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -2,7 +2,7 @@ {include file='inc/header.tpl'}
+ alt="{$config->appName}" width="328" height="284">