Fix minori

This commit is contained in:
Luca 2020-03-03 22:59:18 +01:00
parent a462faf606
commit 2b60df8ac5
2 changed files with 23 additions and 8 deletions

View File

@ -195,20 +195,26 @@ if (!$has_settings) {
<h3 class="panel-title">'.tr('Impostazioni di base').'</h3>
</div>
<div class="panel-body">
<div class="row">';
<div class="panel-body">';
$i = 0;
foreach ($settings as $setting => $required) {
if (empty(setting($setting))) {
if ($i%2==0 or $i==0)
echo ' <div class="row">';
echo '
<div class="col-md-6">
'.Settings::input($setting, $required).'
</div>';
$i++;
if ($i%2==0 or $i == sizeof($settings))
echo ' </div>';
}
}
echo ' </div>
</div>
</div>';
}

View File

@ -251,6 +251,16 @@ $(document).ready(function() {
});
});
function getFilenameAndExtension(pathfilename){
var filenameextension = pathfilename.replace(/^.*[\\\/]/, \'\');
var filename = filenameextension.substring(0, filenameextension.lastIndexOf(\'.\'));
var ext = filenameextension.split(\'.\').pop();
return [filename, ext];
}
// Autocompletamento nome
$("#'.$attachment_id.' #blob").change(function(){
var nome = $("#'.$attachment_id.' #nome_allegato");
@ -258,10 +268,9 @@ $(document).ready(function() {
if (!nome.val()) {
var fullPath = $(this).val();
var startIndex = Math.max(fullPath.lastIndexOf("\\\\"), fullPath.lastIndexOf("/")) + 1;
var filename = fullPath.substring(startIndex);
var filename = getFilenameAndExtension(fullPath);
nome.val(filename);
nome.val(filename[0]);
}
});