diff options
author | Phie <phie@phie.ovh> | 2019-12-22 00:40:51 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-12-22 00:40:51 +0300 |
commit | 7a95dd782f7adae6bb22f67671a84d78238e013e (patch) | |
tree | 8fa55010b6e69be24c30f110d38fc7acbd9b2001 | |
parent | e96514dac7f6abe0f7e7231535bba3eb16f31365 (diff) |
fix media list
-rw-r--r-- | lib/Misc/NoteUtils.php | 12 | ||||
m--------- | templates/CarnetElectron | 0 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/Misc/NoteUtils.php b/lib/Misc/NoteUtils.php index fc03209..c137052 100644 --- a/lib/Misc/NoteUtils.php +++ b/lib/Misc/NoteUtils.php @@ -21,14 +21,12 @@ class NoteUtils{ $meta['media'] = array(); $meta['previews'] = array(); - $i=0; try{ foreach($node->get('data')->getDirectoryListing() as $in){ if(substr($in->getName(), 0, strlen("preview")) === "preview"){ - $meta['previews'][$i] = "./note/getmedia?note=".$path."&media=data/".$in->getName(); - $i++; + array_push($meta['previews'],"./note/getmedia?note=".$path."&media=data/".$in->getName()); } else { - $meta['media'][$i] = "./note/getmedia?note=".$path."&media=data/".$in->getName(); + array_push($meta['media'], "./note/getmedia?note=".$path."&media=data/".$in->getName()); } } @@ -59,14 +57,12 @@ class NoteUtils{ $meta['media'] = array(); $meta['previews'] = array(); - $i=0; try{ foreach($zipFile->getListFiles() as $f){ if(substr($f, 0, strlen("data/preview")) === "data/preview"){ - $meta['previews'][$i] = "./note/getmedia?note=".$path."&media=".$f; - $i++; + array_push($meta['previews'],"./note/getmedia?note=".$path."&media=".$f); } else if(substr($f, 0, strlen("data/")) === "data/") { - $meta['media'][$i] = "./note/getmedia?note=".$path."&media=".$f; + array_push($meta['media'],"./note/getmedia?note=".$path."&media=".$f); } } diff --git a/templates/CarnetElectron b/templates/CarnetElectron -Subproject 957902aad045fa726a1ce7e633f8e4dbdc29e40 +Subproject ff5b746ac62cd7772bba6fe79b5768eb647ae9c |