]> git.mxchange.org Git - simple-upload.git/commitdiff
Some rewrites:
authorRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2016 15:02:24 +0000 (17:02 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2016 15:02:24 +0000 (17:02 +0200)
- declare each JavaScript variable separately
- target_ul is null when listing of files is deactivated

index.php

index 2cc58d0b1c177319dcdd8e013566fcdf53467893..72f6cb0bfbacc09fb9d5d666082cc50503244181 100644 (file)
--- a/index.php
+++ b/index.php
                                                if (!$file_private || $file_owner) {
                                                        echo "<li class=\"' . $class . '\">";
 
+                                                       // Create full-qualified URL and clean it a bit
                                                        $url = str_replace('/./', '/', sprintf('%s%s/%s', $settings['url'], $settings['uploaddir'], $filename));
 
                                                        echo "<a href=\"$url\" target=\"_blank\">$filename<span>$file_info</span></a>";
                <script type="text/javascript">
                <!--
                        var target_form  = document.getElementById('simpleupload-form');
-                       var target_ul    = document.getElementById('simpleupload-ul');
+                       var target_ul= document.getElementById('simpleupload-ul');
                        var target_input = document.getElementById('simpleupload-input');
+                       var settings_listfiles = <?=($settings['listfiles'] ? 'true' : 'false')?>;
 
                        target_form.addEventListener('dragover', function (event) {
                                event.preventDefault();
                        }, false);
 
                        function addFileLi (name, info) {
+                               if (settings_listfiles == false) {
+                                       return;
+                               }
                                target_form.style.display = 'none';
 
                                var new_li = document.createElement('li');