Update src/HTMLBuilder/Manager/FileManager.php
This commit is contained in:
parent
7cbaa89bae
commit
6b97f289be
|
@ -189,23 +189,27 @@ class FileManager implements ManagerInterface
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#'.$attachment_id.' #categoria").autocomplete({';
|
$("#'.$attachment_id.' #categoria").autocomplete({';
|
||||||
$first = true;
|
$n_categorie = 0;
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
if (!empty($category['category'])){
|
if (!empty($category['category'])){
|
||||||
if ($first)
|
if ($n_categorie==0){
|
||||||
$result .= '
|
$result .= '
|
||||||
source: [';
|
source: [';
|
||||||
|
}
|
||||||
|
|
||||||
$result .= '
|
$result .= '
|
||||||
"'.$category['category'].'",';
|
"'.$category['category'].'",';
|
||||||
|
|
||||||
if ($first)
|
$n_categorie++;
|
||||||
$result .= '
|
|
||||||
],';
|
|
||||||
|
|
||||||
$first = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($n_categorie>0){
|
||||||
|
$result .= '
|
||||||
|
],';
|
||||||
|
}else{
|
||||||
|
$result .= '
|
||||||
|
source:"[]",';
|
||||||
|
}
|
||||||
$result .= '
|
$result .= '
|
||||||
minLength: 0
|
minLength: 0
|
||||||
}).focus(function() {
|
}).focus(function() {
|
||||||
|
|
Loading…
Reference in New Issue