Display popup if there's a CAComment and installing from card

This commit is contained in:
Squidly271 2021-11-25 06:21:57 -05:00
parent 7c95edba34
commit 0d59b02484
5 changed files with 26 additions and 5 deletions

Binary file not shown.

View File

@ -1867,8 +1867,27 @@ function setFavourite(button) {
}); });
} }
function popupInstallXML(xml,type) { function popupInstallXML(xml,type,comment="") {
saveState(); saveState();
if ( $.trim(comment) ) {
swal({
title: "<?tr("Attention")?>",
text: comment,
allowOutsideClick: false,
showConfirmButton: true,
showCancelButton: false,
confirmButtonText: "<?tr("OK")?>",
animation: false,
type: "warning",
html: true
}, function (isConfirm) {
installXML(xml,type);
});
} else {
installXML(xml,type);
}
}
function installXML(xml,type) {
post({action:'createXML',xml:xml,type:type},function(result){ post({action:'createXML',xml:xml,type:type},function(result){
if ( result.status == "ok" ) { if ( result.status == "ok" ) {
if (type == "second") { if (type == "second") {

View File

@ -1,8 +1,8 @@
66bc45d20e2656cfe6f3c9073018c7a7 ./Apps.page cfab760a899abbd8d622abb32f82e13c ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page 83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page 7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page
1b49ec9797713ce869ea0c1066a109f2 ./default.cfg 1b49ec9797713ce869ea0c1066a109f2 ./default.cfg
1a1e757b2bc919d470c547ea7b0d9f2b ./include/exec.php 5e1c5d9820ab5df5a8d3f88c06c873d7 ./include/exec.php
07eaff6c4650cdaea1088442c996700e ./include/helpers.php 07eaff6c4650cdaea1088442c996700e ./include/helpers.php
95709ae0ed53e2889a93849a69b37892 ./include/paths.php 95709ae0ed53e2889a93849a69b37892 ./include/paths.php
410c0166bae560754e231486050621f6 ./javascript/libraries.js 410c0166bae560754e231486050621f6 ./javascript/libraries.js
@ -22,4 +22,4 @@ e3dc9ed23036a09d69d5cd5c3111751e ./scripts/showStatistics.php
2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php 2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php
c03b8822e6a2f63f864e59b2383a51db ./skins/Narrow/css.php c03b8822e6a2f63f864e59b2383a51db ./skins/Narrow/css.php
cfa1511913f794c8c5980460dfcdf049 ./skins/Narrow/skin.html cfa1511913f794c8c5980460dfcdf049 ./skins/Narrow/skin.html
c58d10a28541fb3d75f98da8db03d5ae ./skins/Narrow/skin.php dfaafbb04cd8ac2b4a3bedd57a16083e ./skins/Narrow/skin.php

View File

@ -251,6 +251,8 @@ function DownloadApplicationFeed() {
$o['SortName'] = str_replace("-"," ",$o['Name']); $o['SortName'] = str_replace("-"," ",$o['Name']);
$o['SortName'] = preg_replace('/\s+/',' ',$o['SortName']); $o['SortName'] = preg_replace('/\s+/',' ',$o['SortName']);
$o['random'] = rand(); $o['random'] = rand();
if ( $o['CAComment'] ) $o['CAComment'] = tr($o['CAComment']);
$des = $o['OriginalOverview'] ?: $o['Overview']; $des = $o['OriginalOverview'] ?: $o['Overview'];
$des = $o['Language'] ? $o['Description'] : $des; $des = $o['Language'] ? $o['Description'] : $des;

View File

@ -148,7 +148,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
$actionsContext[] = array("divider"=>true); $actionsContext[] = array("divider"=>true);
} }
} }
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>"Install","action"=>"popupInstallXML('".addslashes($template['Path'])."','default');"); $actionsContext[] = array("icon"=>"ca_fa-install","text"=>"Install","action"=>"popupInstallXML('".addslashes($template['Path'])."','default','".str_replace(" ","&#32",htmlspecialchars($template['CAComment']))."');");
} else { } else {
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>"Install","action"=>"displayTags('{$template['ID']}');"); $actionsContext[] = array("icon"=>"ca_fa-install","text"=>"Install","action"=>"displayTags('{$template['ID']}');");
} }