fixed bugs introduced in last version

This commit is contained in:
huangjx
2022-02-21 22:12:04 +08:00
parent 40e9d93f61
commit 7cd9a05a72
6 changed files with 25 additions and 16 deletions

View File

@@ -1,17 +1,22 @@
<?php
extract($_);
$permission_error = sprintf("aria2 is installed but not executable.Please execute command sudo chmod 755 %s", $aria2_bin);
if ($youtube_installed && !$youtube_executable) {
$ytb_error = sprintf("youtube-dl is installed but not executable.Please execute command sudo chmod 755 %s", $youtube_bin);
} else if (!$youtube_installed && !$youtube_executable) {
$ytb_error = "youtube-dl is not installed!";
$errors = [];
if ($aria2_installed && !$aria2_executable) {
array_push($errors, sprintf("aria2 is installed but not executable.Please execute command sudo chmod 755 %s", $aria2_bin));
}
if ($youtube_installed && !$youtube_executable) {
array_push($errors, sprintf("youtube-dl is installed but not executable.Please execute command sudo chmod 755 %s", $youtube_bin));
} else if (!$youtube_installed) {
array_push($errors, "youtube-dl is not installed!");
}
?>
<div id="app-navigation">
<?php if ($ncd_hide_errors): ?>
<?php if (isset($ytb_error)): ?>
<div data-error-message="<?php print $l->t($ytb_error);?>"></div>
<?php endif;?>
<?php if (!$ncd_hide_errors): ?>
<?php foreach ($errors as $error): ?>
<div data-error-message="<?php print $l->t($error);?>"></div>
<?php endforeach;?>
<?php endif;?>
<div class="app-navigation-new" id="search-download" data-inputbox="form-input-wrapper">
@@ -27,7 +32,7 @@ if ($youtube_installed && !$youtube_executable) {
</button>
</button>
<?php elseif ($aria2_installed && !$aria2_executable): ?>
<button type="button" class="icon-power notinstalled" data-error-message="<?php print $l->t($permission_error);?>">
<button type="button" class="icon-power notinstalled" >
<?php print $l->t("aria2c is installed but not executable");?>
</button>
<?php else: ?>

View File

@@ -1,6 +1,7 @@
<?php
extract($_);
$checked = '';
$checkbox = $ncd_hide_errors ? "true" : "false";
if ($ncd_hide_errors) {
$checked = "checked";
}
@@ -16,7 +17,7 @@ if ($ncd_hide_errors) {
<div id="app-settings-content">
<ul id="ncdownloader-settings-collapsible-container">
<li class="ncdownloader-settings-item" data-tippy-content="check this to show or suppress errors">
<input class="checkbox" type="checkbox" value="<?php print($ncd_hide_errors);?>" <?php print($checked);?> id="ncd-hide-errors"><label for="ncd-hide-errors"><?php p($l->t('Hide Errors'));?></label>
<input class="checkbox" type="checkbox" value="<?php print($checkbox);?>" <?php print($checked);?> id="ncd-hide-errors"><label for="ncd-hide-errors"><?php p($l->t('Hide Errors'));?></label>
</li>
<li class="ncdownloader-settings-item">
<a href="<?php p($l->t($settings_url));?>" title="<?php p($l->t('Personal Settings'));?>" >