Don't use variables when we can use a Config object directly

This commit is contained in:
Pierre Rudloff 2017-05-04 20:26:42 +02:00
parent ef5304e598
commit a681804126
3 changed files with 5 additions and 8 deletions

View file

@ -101,8 +101,7 @@ class FrontController
$response,
'index.tpl',
[
'convert' => $this->config->convert,
'uglyUrls' => $this->config->uglyUrls,
'config' => $this->config,
'class' => 'index',
'description' => 'Easily download videos from Youtube, Dailymotion, Vimeo and other websites.',
'domain' => $uri->getScheme().'://'.$uri->getAuthority(),
@ -247,8 +246,6 @@ class FrontController
'protocol' => $protocol,
'config' => $this->config,
'canonical' => $this->getCanonicalUrl($request),
'uglyUrls' => $this->config->uglyUrls,
'remux' => $this->config->remux,
]
);

View file

@ -12,11 +12,11 @@
<input class="URLinput" type="url" name="url" id="url"
required autofocus placeholder="http://example.com/video" />
</span>
{if $uglyUrls}
{if $config->uglyUrls}
<input type="hidden" name="page" value="video" />
{/if}
<input class="downloadBtn" type="submit" value="Download" /><br/>
{if $convert}
{if $config->convert}
<div class="mp3">
<p><input type="checkbox" id="audio" class="audio" name="audio">
<label for="audio"><span class="ui"></span>

View file

@ -24,7 +24,7 @@
<h3><label for="format">Available formats:</label></h3>
<form action="{path_for name="redirect"}">
<input type="hidden" name="url" value="{$video->webpage_url}" />
{if $uglyUrls}
{if $config->uglyUrls}
<input type="hidden" name="page" value="redirect" />
{/if}
<select name="format" id="format" class="formats monospace">
@ -34,7 +34,7 @@
Best ({$video->ext})
{/strip}
</option>
{if $remux}
{if $config->remux}
<option value="bestvideo+bestaudio">
Remux best video with best audio
</option>