Completed
Push — master ( 7b04d5...593857 )
by Richard
26s
created
htdocs/class/xoopseditor/tinymce4/external_plugins/filemanager/dialog.php 4 patches
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 
25 25
 if($subdir==""){
26 26
     if(!empty($_COOKIE['last_position'])
27
-	&& strpos($_COOKIE['last_position'],'.')===FALSE)
28
-	$subdir= trim($_COOKIE['last_position']);
27
+    && strpos($_COOKIE['last_position'],'.')===FALSE)
28
+    $subdir= trim($_COOKIE['last_position']);
29 29
 }
30 30
 
31 31
 if($subdir==="/"){
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 if(!file_exists($current_path . $rfm_subfolder.$subdir)){
48 48
     $subdir='';
49 49
     if(!file_exists($current_path . $rfm_subfolder.$subdir)){
50
-	$rfm_subfolder="";
50
+    $rfm_subfolder="";
51 51
     }
52 52
 }
53 53
     
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
     $i++;
71 71
     if($parent==="./") $parent="";
72 72
     if(file_exists($current_path.$parent."config.php")){
73
-	require_once($current_path.$parent."config.php");
74
-	$cycle=false;
73
+    require_once($current_path.$parent."config.php");
74
+    $cycle=false;
75 75
     }
76 76
     
77 77
     if($parent=="") $cycle=false;
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $language_file = 'lang/' .$path_parts['basename']. '.php';
117 117
     }
118 118
     else {
119
-    	echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
119
+        echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
120 120
     }
121 121
 }
122 122
 
@@ -154,20 +154,20 @@  discard block
 block discarded – undo
154 154
         <link href="css/style.css" rel="stylesheet" type="text/css" />
155 155
 	<link href="css/dropzone.min.css" type="text/css" rel="stylesheet" />
156 156
 	<?php
157
-	$sprite_lang_file = 'img/spritemap_'.$lang.'.png';
158
-	$sprite_lang_file2 = 'img/spritemap@2x_'.$lang.'.png';
157
+    $sprite_lang_file = 'img/spritemap_'.$lang.'.png';
158
+    $sprite_lang_file2 = 'img/spritemap@2x_'.$lang.'.png';
159 159
 	
160
-	if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
161
-		//fallback
162
-		$sprite_lang_file = 'img/spritemap_en_EN.png';
163
-		$sprite_lang_file2 = 'img/spritemap@2x_en_EN.png';
164
-		if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
165
-			// we are in deep ****
166
-			echo '<script>console.log("Error: Spritemap not found!");</script>';
167
-			// exit();
168
-		}
169
-	}
170
-	?>
160
+    if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
161
+        //fallback
162
+        $sprite_lang_file = 'img/spritemap_en_EN.png';
163
+        $sprite_lang_file2 = 'img/spritemap@2x_en_EN.png';
164
+        if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
165
+            // we are in deep ****
166
+            echo '<script>console.log("Error: Spritemap not found!");</script>';
167
+            // exit();
168
+        }
169
+    }
170
+    ?>
171 171
 	<style>
172 172
 		.dropzone .dz-default.dz-message,
173 173
 		.dropzone .dz-preview .dz-error-mark,
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 	<script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
220 220
 	<script type="text/javascript" src="js/jquery.queryloader2.min.js"></script>
221 221
 	<?php
222
-	if($aviary_active){
223
-	if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
222
+    if($aviary_active){
223
+    if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
224 224
 	    <script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
225 225
 	<?php }else{ ?>
226 226
 	    <script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
@@ -402,16 +402,16 @@  discard block
 block discarded – undo
402 402
     if($file===".") $current_folder=array('file'=>$file);
403 403
     elseif($file==="..") $prev_folder=array('file'=>$file);
404 404
     elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
405
-	$date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
406
-	$size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
407
-	$file_ext=lang_Type_dir;
408
-	$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
405
+    $date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
406
+    $size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
407
+    $file_ext=lang_Type_dir;
408
+    $sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
409 409
     }else{
410
-	$file_path=$current_path.$rfm_subfolder.$subdir.$file;
411
-	$date=filemtime($file_path);
412
-	$size=filesize($file_path);
413
-	$file_ext = substr(strrchr($file,'.'),1);
414
-	$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
410
+    $file_path=$current_path.$rfm_subfolder.$subdir.$file;
411
+    $date=filemtime($file_path);
412
+    $size=filesize($file_path);
413
+    $file_ext = substr(strrchr($file,'.'),1);
414
+    $sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
415 415
     }
416 416
 }
417 417
 
@@ -430,19 +430,19 @@  discard block
 block discarded – undo
430 430
 
431 431
 switch($sort_by){
432 432
     case 'name':
433
-	usort($sorted, 'filenameSort');
434
-	break;
433
+    usort($sorted, 'filenameSort');
434
+    break;
435 435
     case 'date':
436
-	usort($sorted, 'dateSort');
437
-	break;
436
+    usort($sorted, 'dateSort');
437
+    break;
438 438
     case 'size':
439
-	usort($sorted, 'sizeSort');
440
-	break;
439
+    usort($sorted, 'sizeSort');
440
+    break;
441 441
     case 'extension':
442
-	usort($sorted, 'extensionSort');
443
-	break;
442
+    usort($sorted, 'extensionSort');
443
+    break;
444 444
     default:
445
-	break;
445
+    break;
446 446
     
447 447
 }
448 448
 
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
     
518 518
     <div class="row-fluid">
519 519
 	<?php	
520
-	$link="dialog.php?".$get_params;
521
-	?>
520
+    $link="dialog.php?".$get_params;
521
+    ?>
522 522
 	<ul class="breadcrumb">	
523 523
 	<li class="pull-left"><a href="<?php echo $link?>/"><i class="icon-home"></i></a></li>
524 524
 	<li><span class="divider">/</span></li>
525 525
 	<?php
526
-	$bc=explode("/",$subdir);
527
-	$tmp_path='';
528
-	if(!empty($bc))
529
-	foreach($bc as $k=>$b){ 
530
-		$tmp_path.=$b."/";
531
-		if($k==count($bc)-2){
532
-	?> <li class="active"><?php echo $b?></li><?php
533
-		}elseif($b!=""){ ?>
526
+    $bc=explode("/",$subdir);
527
+    $tmp_path='';
528
+    if(!empty($bc))
529
+    foreach($bc as $k=>$b){ 
530
+        $tmp_path.=$b."/";
531
+        if($k==count($bc)-2){
532
+    ?> <li class="active"><?php echo $b?></li><?php
533
+        }elseif($b!=""){ ?>
534 534
 		<li><a href="<?php echo $link.$tmp_path?>"><?php echo $b?></a></li><li><span class="divider"><?php echo "/"; ?></span></li>
535 535
 	<?php }
536
-	}
537
-	?>
536
+    }
537
+    ?>
538 538
 	<li class="pull-right"><a class="btn-small" href="javascript:void('')" id="info"><i class="icon-question-sign"></i></a></li>
539 539
 	<li class="pull-right"><a id="refresh" class="btn-small" href="dialog.php?<?php echo $get_params.$subdir."&".uniqid() ?>"><i class="icon-refresh"></i></a></li>
540 540
 	
@@ -583,39 +583,39 @@  discard block
 block discarded – undo
583 583
 	    <ul class="grid cs-style-2 <?php echo "list-view".$view; ?>" id="main-item-container">
584 584
 		<?php
585 585
 		
586
-		$jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
587
-		foreach ($files as $file_array) {
588
-		    $file=$file_array['file'];
589
-			if($file === '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!==".." && strpos($file,$filter)===false))
590
-			    continue;
591
-			$new_name=fix_filename($file,$transliteration);
592
-			if($file!=='..' && $file!=$new_name){
593
-			    //rename
594
-			    rename_folder($current_path.$subdir.$new_name,$new_name,$transliteration);
595
-			    $file=$new_name;
596
-			}
597
-			//add in thumbs folder if not exist 
598
-			if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
599
-			$class_ext = 3;			
600
-			if($file==='..' && trim($subdir) != '' ){
601
-			    $src = explode("/",$subdir);
602
-			    unset($src[count($src)-2]);
603
-			    $src=implode("/",$src);
604
-			    if($src==='') $src="/";
605
-			}
606
-			elseif ($file!=='..') {
607
-			    $src = $subdir . $file."/";
608
-			}
586
+        $jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
587
+        foreach ($files as $file_array) {
588
+            $file=$file_array['file'];
589
+            if($file === '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!==".." && strpos($file,$filter)===false))
590
+                continue;
591
+            $new_name=fix_filename($file,$transliteration);
592
+            if($file!=='..' && $file!=$new_name){
593
+                //rename
594
+                rename_folder($current_path.$subdir.$new_name,$new_name,$transliteration);
595
+                $file=$new_name;
596
+            }
597
+            //add in thumbs folder if not exist 
598
+            if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
599
+            $class_ext = 3;			
600
+            if($file==='..' && trim($subdir) != '' ){
601
+                $src = explode("/",$subdir);
602
+                unset($src[count($src)-2]);
603
+                $src=implode("/",$src);
604
+                if($src==='') $src="/";
605
+            }
606
+            elseif ($file!=='..') {
607
+                $src = $subdir . $file."/";
608
+            }
609 609
 			
610
-			?>
610
+            ?>
611 611
 			    <li data-name="<?php echo $file ?>" <?php if($file==='..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
612
-			    $file_prevent_rename = false;
613
-			    $file_prevent_delete = false;
614
-			    if (isset($filePermissions[$file])) {
615
-				$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
616
-				$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
617
-			    }
618
-			    ?>	<figure data-name="<?php echo $file ?>" class="<?php if($file==="..") echo "back-"; ?>directory" data-type="<?php if($file!==".."){ echo "dir"; } ?>">
612
+                $file_prevent_rename = false;
613
+                $file_prevent_delete = false;
614
+                if (isset($filePermissions[$file])) {
615
+                $file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
616
+                $file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
617
+                }
618
+                ?>	<figure data-name="<?php echo $file ?>" class="<?php if($file==="..") echo "back-"; ?>directory" data-type="<?php if($file!==".."){ echo "dir"; } ?>">
619 619
 				    <a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
620 620
 				    <div class="img-precontainer">
621 621
 					<div class="img-container directory"><span></span>
@@ -657,116 +657,116 @@  discard block
 block discarded – undo
657 657
 			    </figure>
658 658
 			</li>
659 659
 			<?php
660
-		    }
660
+            }
661 661
 			
662 662
             $files_prevent_duplicate = array();
663
-		    foreach ($files as $nu=>$file_array) {		
664
-			$file=$file_array['file'];
663
+            foreach ($files as $nu=>$file_array) {		
664
+            $file=$file_array['file'];
665 665
 		    
666
-			    if($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
667
-				    continue;
666
+                if($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
667
+                    continue;
668 668
 			    
669
-			    $file_path=$current_path.$rfm_subfolder.$subdir.$file;
670
-			    //check if file have illegal caracter
669
+                $file_path=$current_path.$rfm_subfolder.$subdir.$file;
670
+                //check if file have illegal caracter
671 671
 			    
672
-			    $filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1));
672
+                $filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1));
673 673
 			    
674
-			    if($file!=fix_filename($file,$transliteration)){
675
-				$file1=fix_filename($file,$transliteration);
676
-				$file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
677
-				if(file_exists($file_path1)){
678
-				    $i = 1;
679
-				    $info=pathinfo($file1);
680
-				    while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
681
-					    $i++;
682
-				    }
683
-				    $file1=$info['filename'].".[".$i."].".$info['extension'];
684
-				    $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
685
-				}
674
+                if($file!=fix_filename($file,$transliteration)){
675
+                $file1=fix_filename($file,$transliteration);
676
+                $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
677
+                if(file_exists($file_path1)){
678
+                    $i = 1;
679
+                    $info=pathinfo($file1);
680
+                    while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
681
+                        $i++;
682
+                    }
683
+                    $file1=$info['filename'].".[".$i."].".$info['extension'];
684
+                    $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
685
+                }
686 686
 				
687
-				$filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1));
688
-				rename_file($file_path,fix_filename($filename,$transliteration),$transliteration);
689
-				$file=$file1;
690
-				$file_array['extension']=fix_filename($file_array['extension'],$transliteration);
691
-				$file_path=$file_path1;
692
-			    }
687
+                $filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1));
688
+                rename_file($file_path,fix_filename($filename,$transliteration),$transliteration);
689
+                $file=$file1;
690
+                $file_array['extension']=fix_filename($file_array['extension'],$transliteration);
691
+                $file_path=$file_path1;
692
+                }
693 693
 			    
694
-			    $is_img=false;
695
-			    $is_video=false;
696
-			    $is_audio=false;
697
-			    $show_original=false;
698
-			    $show_original_mini=false;
699
-			    $mini_src="";
700
-			    $src_thumb="";
701
-			    $extension_lower=fix_strtolower($file_array['extension']);
702
-			    if(in_array($extension_lower, $ext_img)){
703
-				$src = $base_url . $cur_dir . rawurlencode($file);
704
-				$mini_src = $src_thumb = $thumbs_path.$subdir. $file;
705
-				//add in thumbs folder if not exist
706
-				if(!file_exists($src_thumb)){
707
-				    try {
708
-					create_img_gd($file_path, $src_thumb, 122, 91);
709
-					new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
710
-				    } catch (Exception $e) {
711
-					$src_thumb=$mini_src="";
712
-				    }
713
-				}
714
-				$is_img=true;
715
-				//check if is smaller than thumb
716
-				list($img_width, $img_height, $img_type, $attr)=getimagesize($file_path);
717
-				if($img_width<122 && $img_height<91){ 
718
-					$src_thumb=$current_path.$rfm_subfolder.$subdir.$file;
719
-					$show_original=true;
720
-				}
694
+                $is_img=false;
695
+                $is_video=false;
696
+                $is_audio=false;
697
+                $show_original=false;
698
+                $show_original_mini=false;
699
+                $mini_src="";
700
+                $src_thumb="";
701
+                $extension_lower=fix_strtolower($file_array['extension']);
702
+                if(in_array($extension_lower, $ext_img)){
703
+                $src = $base_url . $cur_dir . rawurlencode($file);
704
+                $mini_src = $src_thumb = $thumbs_path.$subdir. $file;
705
+                //add in thumbs folder if not exist
706
+                if(!file_exists($src_thumb)){
707
+                    try {
708
+                    create_img_gd($file_path, $src_thumb, 122, 91);
709
+                    new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
710
+                    } catch (Exception $e) {
711
+                    $src_thumb=$mini_src="";
712
+                    }
713
+                }
714
+                $is_img=true;
715
+                //check if is smaller than thumb
716
+                list($img_width, $img_height, $img_type, $attr)=getimagesize($file_path);
717
+                if($img_width<122 && $img_height<91){ 
718
+                    $src_thumb=$current_path.$rfm_subfolder.$subdir.$file;
719
+                    $show_original=true;
720
+                }
721 721
 				
722
-				if($img_width<45 && $img_height<38){
723
-				    $mini_src=$current_path.$rfm_subfolder.$subdir.$file;
724
-				    $show_original_mini=true;
725
-				}
726
-			    }
722
+                if($img_width<45 && $img_height<38){
723
+                    $mini_src=$current_path.$rfm_subfolder.$subdir.$file;
724
+                    $show_original_mini=true;
725
+                }
726
+                }
727 727
 			    
728
-			    $is_icon_thumb=false;
729
-			    $is_icon_thumb_mini=false;
730
-			    $no_thumb=false;
731
-			    if($src_thumb==""){
732
-				$no_thumb=true;
733
-				if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
734
-					$src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
735
-				}else{
736
-					$src_thumb = "img/".$icon_theme."/default.jpg";
737
-				}
738
-				$is_icon_thumb=true;
739
-			    }
740
-			    if($mini_src==""){
741
-				$is_icon_thumb_mini=false;
742
-			    }
728
+                $is_icon_thumb=false;
729
+                $is_icon_thumb_mini=false;
730
+                $no_thumb=false;
731
+                if($src_thumb==""){
732
+                $no_thumb=true;
733
+                if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
734
+                    $src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
735
+                }else{
736
+                    $src_thumb = "img/".$icon_theme."/default.jpg";
737
+                }
738
+                $is_icon_thumb=true;
739
+                }
740
+                if($mini_src==""){
741
+                $is_icon_thumb_mini=false;
742
+                }
743 743
 			    
744
-			    $class_ext=0;
745
-			    if (in_array($extension_lower, $ext_video)) {
746
-				    $class_ext = 4;
747
-				    $is_video=true;
748
-			    }elseif (in_array($extension_lower, $ext_img)) {
749
-				    $class_ext = 2;
750
-			    }elseif (in_array($extension_lower, $ext_music)) {
751
-				    $class_ext = 5;
752
-				    $is_audio=true;
753
-			    }elseif (in_array($extension_lower, $ext_misc)) {
754
-				    $class_ext = 3;
755
-			    }else{
756
-				    $class_ext = 1;
757
-			    }
758
-			    if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
744
+                $class_ext=0;
745
+                if (in_array($extension_lower, $ext_video)) {
746
+                    $class_ext = 4;
747
+                    $is_video=true;
748
+                }elseif (in_array($extension_lower, $ext_img)) {
749
+                    $class_ext = 2;
750
+                }elseif (in_array($extension_lower, $ext_music)) {
751
+                    $class_ext = 5;
752
+                    $is_audio=true;
753
+                }elseif (in_array($extension_lower, $ext_misc)) {
754
+                    $class_ext = 3;
755
+                }else{
756
+                    $class_ext = 1;
757
+                }
758
+                if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
759 759
 ?>
760 760
 		    <li class="ff-item-type-<?php echo $class_ext; ?> file"  data-name="<?php echo $file; ?>"><?php
761
-		    $file_prevent_rename = false;
762
-		    $file_prevent_delete = false;
763
-		    if (isset($filePermissions[$file])) {
764
-			if (isset($filePermissions[$file]['prevent_duplicate']) && $filePermissions[$file]['prevent_duplicate']) {
765
-			    $files_prevent_duplicate[] = $file;
766
-			}
767
-			$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
768
-			$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
769
-		    }
761
+            $file_prevent_rename = false;
762
+            $file_prevent_delete = false;
763
+            if (isset($filePermissions[$file])) {
764
+            if (isset($filePermissions[$file]['prevent_duplicate']) && $filePermissions[$file]['prevent_duplicate']) {
765
+                $files_prevent_duplicate[] = $file;
766
+            }
767
+            $file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
768
+            $file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
769
+            }
770 770
             ?>		<figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
771 771
 				<a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
772 772
 				<div class="img-precontainer">
@@ -827,10 +827,10 @@  discard block
 block discarded – undo
827 827
 			</figure>			
828 828
 		</li>
829 829
 			<?php
830
-			}
831
-		    }
830
+            }
831
+            }
832 832
 		
833
-	?></div>
833
+    ?></div>
834 834
 	    </ul>
835 835
 	    <?php } ?>
836 836
 	</div>
Please login to merge, or discard this patch.
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -429,20 +429,20 @@
 block discarded – undo
429 429
 }
430 430
 
431 431
 switch($sort_by){
432
-    case 'name':
433
-	usort($sorted, 'filenameSort');
434
-	break;
435
-    case 'date':
436
-	usort($sorted, 'dateSort');
437
-	break;
438
-    case 'size':
439
-	usort($sorted, 'sizeSort');
440
-	break;
441
-    case 'extension':
442
-	usort($sorted, 'extensionSort');
443
-	break;
444
-    default:
445
-	break;
432
+        case 'name':
433
+	    usort($sorted, 'filenameSort');
434
+	    break;
435
+        case 'date':
436
+	    usort($sorted, 'dateSort');
437
+	    break;
438
+        case 'size':
439
+	    usort($sorted, 'sizeSort');
440
+	    break;
441
+        case 'extension':
442
+	    usort($sorted, 'extensionSort');
443
+	    break;
444
+        default:
445
+	    break;
446 446
     
447 447
 }
448 448
 
Please login to merge, or discard this patch.
Spacing   +247 added lines, -247 removed lines patch added patch discarded remove patch
@@ -1,119 +1,119 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3 3
 
4
-$_SESSION['RF']["verify"]= "RESPONSIVEfilemanager";
4
+$_SESSION['RF']["verify"] = "RESPONSIVEfilemanager";
5 5
 
6
-if(isset($_POST['submit'])){
6
+if (isset($_POST['submit'])) {
7 7
 
8 8
 include('upload.php');
9 9
 
10
-}else{
10
+} else {
11 11
 
12 12
 include('include/utils.php');
13 13
 
14 14
 if (isset($_GET['fldr'])
15 15
     && !empty($_GET['fldr'])
16
-    && strpos($_GET['fldr'],'../')===FALSE
17
-    && strpos($_GET['fldr'],'./')===FALSE)
18
-    $subdir = urldecode(trim(strip_tags($_GET['fldr']),"/") ."/");
16
+    && strpos($_GET['fldr'], '../') === FALSE
17
+    && strpos($_GET['fldr'], './') === FALSE)
18
+    $subdir = urldecode(trim(strip_tags($_GET['fldr']), "/")."/");
19 19
 else
20 20
     $subdir = '';
21 21
     
22 22
 //remember last position
23
-setcookie('last_position',$subdir,time() + (86400 * 7)); 
23
+setcookie('last_position', $subdir, time() + (86400 * 7)); 
24 24
 
25
-if($subdir==""){
26
-    if(!empty($_COOKIE['last_position'])
27
-	&& strpos($_COOKIE['last_position'],'.')===FALSE)
28
-	$subdir= trim($_COOKIE['last_position']);
25
+if ($subdir == "") {
26
+    if (!empty($_COOKIE['last_position'])
27
+	&& strpos($_COOKIE['last_position'], '.') === FALSE)
28
+	$subdir = trim($_COOKIE['last_position']);
29 29
 }
30 30
 
31
-if($subdir==="/"){
32
-    $subdir="";
31
+if ($subdir === "/") {
32
+    $subdir = "";
33 33
 }
34 34
 
35 35
 
36 36
 /***
37 37
  *SUB-DIR CODE
38 38
  ***/
39
-if(!isset($_SESSION['RF']["subfolder"])) $_SESSION['RF']["subfolder"]='';
39
+if (!isset($_SESSION['RF']["subfolder"])) $_SESSION['RF']["subfolder"] = '';
40 40
 $rfm_subfolder = '';
41
-if(!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"],'../')===FALSE
42
-   && strpos($_SESSION['RF']["subfolder"],'./')===FALSE && strpos($_SESSION['RF']["subfolder"],"/")!==0
43
-    && strpos($_SESSION['RF']["subfolder"],'.')===FALSE) $rfm_subfolder= $_SESSION['RF']['subfolder'];
41
+if (!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"], '../') === FALSE
42
+   && strpos($_SESSION['RF']["subfolder"], './') === FALSE && strpos($_SESSION['RF']["subfolder"], "/") !== 0
43
+    && strpos($_SESSION['RF']["subfolder"], '.') === FALSE) $rfm_subfolder = $_SESSION['RF']['subfolder'];
44 44
    
45
-if($rfm_subfolder!="" && $rfm_subfolder[strlen($rfm_subfolder)-1]!=="/") $rfm_subfolder.="/";
45
+if ($rfm_subfolder != "" && $rfm_subfolder[strlen($rfm_subfolder) - 1] !== "/") $rfm_subfolder .= "/";
46 46
    
47
-if(!file_exists($current_path . $rfm_subfolder.$subdir)){
48
-    $subdir='';
49
-    if(!file_exists($current_path . $rfm_subfolder.$subdir)){
50
-	$rfm_subfolder="";
47
+if (!file_exists($current_path.$rfm_subfolder.$subdir)) {
48
+    $subdir = '';
49
+    if (!file_exists($current_path.$rfm_subfolder.$subdir)) {
50
+	$rfm_subfolder = "";
51 51
     }
52 52
 }
53 53
     
54
-if(trim($rfm_subfolder)==""){
55
-    $cur_dir = $upload_dir . $subdir;
56
-    $cur_path = $current_path . $subdir;
54
+if (trim($rfm_subfolder) == "") {
55
+    $cur_dir = $upload_dir.$subdir;
56
+    $cur_path = $current_path.$subdir;
57 57
     $thumbs_path = $thumbs_base_path;
58
-    $parent=$subdir;
59
-}else{
60
-    $cur_dir = $upload_dir . $rfm_subfolder.$subdir;
61
-    $cur_path = $current_path . $rfm_subfolder.$subdir;
62
-    $thumbs_path = $thumbs_base_path. $rfm_subfolder;
63
-    $parent=$rfm_subfolder.$subdir;
58
+    $parent = $subdir;
59
+} else {
60
+    $cur_dir = $upload_dir.$rfm_subfolder.$subdir;
61
+    $cur_path = $current_path.$rfm_subfolder.$subdir;
62
+    $thumbs_path = $thumbs_base_path.$rfm_subfolder;
63
+    $parent = $rfm_subfolder.$subdir;
64 64
 }
65 65
 
66
-$cycle=true;
67
-$max_cycles=50;
68
-$i=0;
69
-while($cycle && $i<$max_cycles){
66
+$cycle = true;
67
+$max_cycles = 50;
68
+$i = 0;
69
+while ($cycle && $i < $max_cycles) {
70 70
     $i++;
71
-    if($parent==="./") $parent="";
72
-    if(file_exists($current_path.$parent."config.php")){
71
+    if ($parent === "./") $parent = "";
72
+    if (file_exists($current_path.$parent."config.php")) {
73 73
 	require_once($current_path.$parent."config.php");
74
-	$cycle=false;
74
+	$cycle = false;
75 75
     }
76 76
     
77
-    if($parent=="") $cycle=false;
78
-    else $parent=fix_dirname($parent)."/";
77
+    if ($parent == "") $cycle = false;
78
+    else $parent = fix_dirname($parent)."/";
79 79
 }
80 80
 
81
-if(!is_dir($thumbs_path.$subdir)){
81
+if (!is_dir($thumbs_path.$subdir)) {
82 82
     create_folder(false, $thumbs_path.$subdir);
83 83
 }
84 84
 
85
-if(isset($_GET['popup'])) $popup= strip_tags($_GET['popup']); else $popup=0;
85
+if (isset($_GET['popup'])) $popup = strip_tags($_GET['popup']); else $popup = 0;
86 86
 //Sanitize popup
87
-$popup=!!$popup;
87
+$popup = !!$popup;
88 88
 
89 89
 //view type
90
-if(!isset($_SESSION['RF']["view_type"])){ $view=$default_view; $_SESSION['RF']["view_type"] = $view; }
91
-if(isset($_GET['view'])){ $view=fix_get_params($_GET['view']); $_SESSION['RF']["view_type"] = $view; }
92
-$view=$_SESSION['RF']["view_type"];
90
+if (!isset($_SESSION['RF']["view_type"])) { $view = $default_view; $_SESSION['RF']["view_type"] = $view; }
91
+if (isset($_GET['view'])) { $view = fix_get_params($_GET['view']); $_SESSION['RF']["view_type"] = $view; }
92
+$view = $_SESSION['RF']["view_type"];
93 93
 
94
-if(isset($_GET["filter"])) $filter=fix_get_params($_GET["filter"]);
95
-else $filter='';
94
+if (isset($_GET["filter"])) $filter = fix_get_params($_GET["filter"]);
95
+else $filter = '';
96 96
 
97
-if(!isset($_SESSION['RF']['sort_by'])) $_SESSION['RF']['sort_by']='';
98
-if(isset($_GET["sort_by"])) $sort_by=$_SESSION['RF']['sort_by']=fix_get_params($_GET["sort_by"]);
99
-else $sort_by=$_SESSION['RF']['sort_by'];
97
+if (!isset($_SESSION['RF']['sort_by'])) $_SESSION['RF']['sort_by'] = '';
98
+if (isset($_GET["sort_by"])) $sort_by = $_SESSION['RF']['sort_by'] = fix_get_params($_GET["sort_by"]);
99
+else $sort_by = $_SESSION['RF']['sort_by'];
100 100
 
101
-if(!isset($_SESSION['RF']['descending'])) $_SESSION['RF']['descending']=false;
102
-if(isset($_GET["descending"])) $descending=$_SESSION['RF']['descending']=fix_get_params($_GET["descending"])==="true";
103
-else $descending=$_SESSION['RF']['descending'];
101
+if (!isset($_SESSION['RF']['descending'])) $_SESSION['RF']['descending'] = false;
102
+if (isset($_GET["descending"])) $descending = $_SESSION['RF']['descending'] = fix_get_params($_GET["descending"]) === "true";
103
+else $descending = $_SESSION['RF']['descending'];
104 104
 
105 105
 
106
-$lang=$default_language;
107
-if(isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang']!='') {
108
-    $lang=fix_get_params($_GET['lang']);
109
-    $lang=trim($lang);
106
+$lang = $default_language;
107
+if (isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang'] != '') {
108
+    $lang = fix_get_params($_GET['lang']);
109
+    $lang = trim($lang);
110 110
 }
111 111
 
112 112
 $language_file = 'lang/'.$default_language.'.php'; 
113
-if ($lang!=$default_language) {
113
+if ($lang != $default_language) {
114 114
     $path_parts = pathinfo($lang);
115
-    if(is_readable('lang/' .$path_parts['basename']. '.php')){ 
116
-        $language_file = 'lang/' .$path_parts['basename']. '.php';
115
+    if (is_readable('lang/'.$path_parts['basename'].'.php')) { 
116
+        $language_file = 'lang/'.$path_parts['basename'].'.php';
117 117
     }
118 118
     else {
119 119
     	echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 $_SESSION['RF']['language_file'] = $language_file;
125 125
 require_once $language_file;
126 126
 
127
-if(!isset($_GET['type'])) $_GET['type']=0;
128
-if(!isset($_GET['field_id'])) $_GET['field_id']='';
127
+if (!isset($_GET['type'])) $_GET['type'] = 0;
128
+if (!isset($_GET['field_id'])) $_GET['field_id'] = '';
129 129
 
130
-$field_id=isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
131
-$type_param=fix_get_params($_GET['type']);
130
+$field_id = isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
131
+$type_param = fix_get_params($_GET['type']);
132 132
 
133 133
 $get_params = http_build_query(array(
134 134
     'type'      => $type_param,
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
 	$sprite_lang_file = 'img/spritemap_'.$lang.'.png';
158 158
 	$sprite_lang_file2 = 'img/spritemap@2x_'.$lang.'.png';
159 159
 	
160
-	if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
160
+	if (!file_exists($sprite_lang_file) || !file_exists($sprite_lang_file2)) {
161 161
 		//fallback
162 162
 		$sprite_lang_file = 'img/spritemap_en_EN.png';
163 163
 		$sprite_lang_file2 = 'img/spritemap@2x_en_EN.png';
164
-		if ( ! file_exists($sprite_lang_file) || ! file_exists($sprite_lang_file2)){
164
+		if (!file_exists($sprite_lang_file) || !file_exists($sprite_lang_file2)) {
165 165
 			// we are in deep ****
166 166
 			echo '<script>console.log("Error: Spritemap not found!");</script>';
167 167
 			// exit();
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
 	<script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
220 220
 	<script type="text/javascript" src="js/jquery.queryloader2.min.js"></script>
221 221
 	<?php
222
-	if($aviary_active){
222
+	if ($aviary_active) {
223 223
 	if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
224 224
 	    <script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
225
-	<?php }else{ ?>
225
+	<?php } else { ?>
226 226
 	    <script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
227 227
 	<?php }} ?>
228 228
 	
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 	<script>
238 238
 	    var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
239 239
 	    var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
240
-	    var loading_bar=<?php echo $loading_bar?"true":"false"; ?>;
241
-	    var image_editor=<?php echo $aviary_active?"true":"false"; ?>;
240
+	    var loading_bar=<?php echo $loading_bar ? "true" : "false"; ?>;
241
+	    var image_editor=<?php echo $aviary_active ? "true" : "false"; ?>;
242 242
 	    //dropzone config
243 243
 	    Dropzone.options.myAwesomeDropzone = {
244
-		    dictInvalidFileType: "<?php echo lang_Error_extension;?>",
244
+		    dictInvalidFileType: "<?php echo lang_Error_extension; ?>",
245 245
 		    dictFileTooBig: "<?php echo lang_Error_Upload; ?>",
246 246
 		    dictResponseError: "SERVER ERROR",
247 247
 		    paramName: "file", // The name that will be used to transfer the file
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 					done();
255 255
 			    }
256 256
 			    else { 
257
-			    	done("<?php echo lang_Error_extension;?>"); 
257
+			    	done("<?php echo lang_Error_extension; ?>"); 
258 258
 				}
259 259
 		    }
260 260
 	    };
@@ -306,18 +306,18 @@  discard block
 block discarded – undo
306 306
 	<input type="hidden" id="cancel" value="<?php echo lang_Cancel; ?>" />
307 307
 	<input type="hidden" id="rename" value="<?php echo lang_Rename; ?>" />
308 308
 	<input type="hidden" id="lang_duplicate" value="<?php echo lang_Duplicate; ?>" />
309
-	<input type="hidden" id="duplicate" value="<?php if($duplicate_files) echo 1; else echo 0; ?>" />
309
+	<input type="hidden" id="duplicate" value="<?php if ($duplicate_files) echo 1; else echo 0; ?>" />
310 310
 	<input type="hidden" id="base_url" value="<?php echo $base_url?>"/>
311 311
 	<input type="hidden" id="base_url_true" value="<?php echo base_url(); ?>"/>
312 312
 	<input type="hidden" id="fldr_value" value="<?php echo $subdir; ?>"/>
313 313
 	<input type="hidden" id="sub_folder" value="<?php echo $rfm_subfolder; ?>"/>
314 314
 	<input type="hidden" id="file_number_limit_js" value="<?php echo $file_number_limit_js; ?>" />
315
-	<input type="hidden" id="descending" value="<?php echo $descending?"true":"false"; ?>" />
315
+	<input type="hidden" id="descending" value="<?php echo $descending ? "true" : "false"; ?>" />
316 316
 	<?php $protocol = 'http'; ?>
317
-	<input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter),array(''),$protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>" />
317
+	<input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter), array(''), $protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>" />
318 318
 	<input type="hidden" id="lang_show_url" value="<?php echo lang_Show_url; ?>" />
319
-	<input type="hidden" id="copy_cut_files_allowed" value="<?php if($copy_cut_files) echo 1; else echo 0; ?>" />
320
-	<input type="hidden" id="copy_cut_dirs_allowed" value="<?php if($copy_cut_dirs) echo 1; else echo 0; ?>" />
319
+	<input type="hidden" id="copy_cut_files_allowed" value="<?php if ($copy_cut_files) echo 1; else echo 0; ?>" />
320
+	<input type="hidden" id="copy_cut_dirs_allowed" value="<?php if ($copy_cut_dirs) echo 1; else echo 0; ?>" />
321 321
 	<input type="hidden" id="copy_cut_max_size" value="<?php echo $copy_cut_max_size; ?>" />
322 322
 	<input type="hidden" id="copy_cut_max_count" value="<?php echo $copy_cut_max_count; ?>" />
323 323
 	<input type="hidden" id="lang_copy" value="<?php echo lang_Copy; ?>" />
@@ -331,15 +331,15 @@  discard block
 block discarded – undo
331 331
 	<input type="hidden" id="lang_file_info" value="<?php echo fix_strtoupper(lang_File_info); ?>" />
332 332
 	<input type="hidden" id="lang_edit_image" value="<?php echo lang_Edit_image; ?>" />
333 333
 	<input type="hidden" id="lang_extract" value="<?php echo lang_Extract; ?>" />
334
-	<input type="hidden" id="transliteration" value="<?php echo $transliteration?"true":"false"; ?>" />
335
-<?php if($upload_files){ ?>
334
+	<input type="hidden" id="transliteration" value="<?php echo $transliteration ? "true" : "false"; ?>" />
335
+<?php if ($upload_files) { ?>
336 336
 <!-- uploader div start -->
337 337
 
338 338
 <div class="uploader">
339 339
     <center><button class="btn btn-inverse close-uploader"><i class="icon-backward icon-white"></i> <?php echo lang_Return_Files_List?></button></center>
340 340
 	<div class="space10"></div><div class="space10"></div>
341 341
 	<div class="tabbable upload-tabbable"> <!-- Only required for left/right tabs -->
342
-		<?php if($java_upload){ ?>
342
+		<?php if ($java_upload) { ?>
343 343
 	    <ul class="nav nav-tabs">
344 344
 			<li class="active"><a href="#tab1" data-toggle="tab"><?php echo lang_Upload_base; ?></a></li>
345 345
 			<li><a href="#tab2" id="uploader-btn" data-toggle="tab"><?php echo lang_Upload_java; ?></a></li>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 				</form>
365 365
 			</div>
366 366
 		    <div class="upload-help"><?php echo lang_Upload_base_help; ?></div>
367
-			<?php if($java_upload){ ?>
367
+			<?php if ($java_upload) { ?>
368 368
 			</div>
369 369
 			<div class="tab-pane" id="tab2">
370 370
 		    	<div id="iframe-container"></div>
@@ -385,50 +385,50 @@  discard block
 block discarded – undo
385 385
 $class_ext = '';
386 386
 $src = '';
387 387
 
388
-if ($_GET['type']==1) 	 $apply = 'apply_img';
389
-elseif($_GET['type']==2) $apply = 'apply_link';
390
-elseif($_GET['type']==0 && $_GET['field_id']=='') $apply = 'apply_none';
391
-elseif($_GET['type']==3) $apply = 'apply_video';
388
+if ($_GET['type'] == 1) 	 $apply = 'apply_img';
389
+elseif ($_GET['type'] == 2) $apply = 'apply_link';
390
+elseif ($_GET['type'] == 0 && $_GET['field_id'] == '') $apply = 'apply_none';
391
+elseif ($_GET['type'] == 3) $apply = 'apply_video';
392 392
 else $apply = 'apply';
393 393
 
394 394
 $files = scandir($current_path.$rfm_subfolder.$subdir);
395
-$n_files=count($files);
395
+$n_files = count($files);
396 396
 
397 397
 //php sorting
398
-$sorted=array();
399
-$current_folder=array();
400
-$prev_folder=array();
401
-foreach($files as $k=>$file){
402
-    if($file===".") $current_folder=array('file'=>$file);
403
-    elseif($file==="..") $prev_folder=array('file'=>$file);
404
-    elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
405
-	$date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
406
-	$size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
407
-	$file_ext=lang_Type_dir;
408
-	$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
409
-    }else{
410
-	$file_path=$current_path.$rfm_subfolder.$subdir.$file;
411
-	$date=filemtime($file_path);
412
-	$size=filesize($file_path);
413
-	$file_ext = substr(strrchr($file,'.'),1);
414
-	$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
398
+$sorted = array();
399
+$current_folder = array();
400
+$prev_folder = array();
401
+foreach ($files as $k=>$file) {
402
+    if ($file === ".") $current_folder = array('file'=>$file);
403
+    elseif ($file === "..") $prev_folder = array('file'=>$file);
404
+    elseif (is_dir($current_path.$rfm_subfolder.$subdir.$file)) {
405
+	$date = filemtime($current_path.$rfm_subfolder.$subdir.$file);
406
+	$size = foldersize($current_path.$rfm_subfolder.$subdir.$file);
407
+	$file_ext = lang_Type_dir;
408
+	$sorted[$k] = array('file'=>$file, 'date'=>$date, 'size'=>$size, 'extension'=>$file_ext);
409
+    } else {
410
+	$file_path = $current_path.$rfm_subfolder.$subdir.$file;
411
+	$date = filemtime($file_path);
412
+	$size = filesize($file_path);
413
+	$file_ext = substr(strrchr($file, '.'), 1);
414
+	$sorted[$k] = array('file'=>$file, 'date'=>$date, 'size'=>$size, 'extension'=>$file_ext);
415 415
     }
416 416
 }
417 417
 
418 418
 function filenameSort($x, $y) {
419
-    return $x['file'] <  $y['file'];
419
+    return $x['file'] < $y['file'];
420 420
 }
421 421
 function dateSort($x, $y) {
422
-    return $x['date'] <  $y['date'];
422
+    return $x['date'] < $y['date'];
423 423
 }
424 424
 function sizeSort($x, $y) {
425
-    return $x['size'] -  $y['size'];
425
+    return $x['size'] - $y['size'];
426 426
 }
427 427
 function extensionSort($x, $y) {
428
-    return $x['extension'] <  $y['extension'];
428
+    return $x['extension'] < $y['extension'];
429 429
 }
430 430
 
431
-switch($sort_by){
431
+switch ($sort_by) {
432 432
     case 'name':
433 433
 	usort($sorted, 'filenameSort');
434 434
 	break;
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
     
447 447
 }
448 448
 
449
-if($descending){
450
-    $sorted=array_reverse($sorted);
449
+if ($descending) {
450
+    $sorted = array_reverse($sorted);
451 451
 }
452 452
 
453
-$files=array_merge(array($prev_folder),array($current_folder),$sorted);
453
+$files = array_merge(array($prev_folder), array($current_folder), $sorted);
454 454
 ?>          
455 455
 <!-- header div start -->
456 456
 <div class="navbar navbar-fixed-top">
@@ -466,13 +466,13 @@  discard block
 block discarded – undo
466 466
 		<div class="filters">
467 467
 		    <div class="row-fluid">
468 468
 			<div class="span3 half"> 
469
-			    <?php if($upload_files){ ?>
469
+			    <?php if ($upload_files) { ?>
470 470
 						    <button class="tip btn upload-btn" title="<?php echo  lang_Upload_file; ?>"><i class="icon-plus"></i><i class="icon-file"></i></button> 
471 471
 			    <?php } ?>
472
-			    <?php if($create_folders){ ?>
472
+			    <?php if ($create_folders) { ?>
473 473
 						    <button class="tip btn new-folder" title="<?php echo  lang_New_Folder?>"><i class="icon-plus"></i><i class="icon-folder-open"></i></button> 
474 474
 			    <?php } ?>
475
-			    <?php if($copy_cut_files || $copy_cut_dirs){ ?>
475
+			    <?php if ($copy_cut_files || $copy_cut_dirs) { ?>
476 476
 				    <button class="tip btn paste-here-btn" title="<?php echo lang_Paste_Here; ?>"><i class="rficon-clipboard-apply"></i></button> 
477 477
 				    <button class="tip btn clear-clipboard-btn" title="<?php echo lang_Clear_Clipboard; ?>"><i class="rficon-clipboard-clear"></i></button> 
478 478
 				<?php } ?>
@@ -480,13 +480,13 @@  discard block
 block discarded – undo
480 480
 			<div class="span3 half view-controller">
481 481
 
482 482
 				<span><?php echo lang_View; ?>:</span>
483
-			    <button class="btn tip<?php if($view==0) echo " btn-inverse"; ?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if($view==0) echo "icon-white"; ?>"></i></button>
484
-			    <button class="btn tip<?php if($view==1) echo " btn-inverse"; ?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if($view==1) echo "icon-white"; ?>"></i></button>
485
-			    <button class="btn tip<?php if($view==2) echo " btn-inverse"; ?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if($view==2) echo "icon-white"; ?>"></i></button>
483
+			    <button class="btn tip<?php if ($view == 0) echo " btn-inverse"; ?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if ($view == 0) echo "icon-white"; ?>"></i></button>
484
+			    <button class="btn tip<?php if ($view == 1) echo " btn-inverse"; ?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if ($view == 1) echo "icon-white"; ?>"></i></button>
485
+			    <button class="btn tip<?php if ($view == 2) echo " btn-inverse"; ?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if ($view == 2) echo "icon-white"; ?>"></i></button>
486 486
 			</div>
487 487
 			<div class="span6 half types"> 
488 488
 				<span><?php echo lang_Filters; ?>:</span>
489
-			    <?php if($_GET['type']!=1 && $_GET['type']!=3){ ?>
489
+			    <?php if ($_GET['type'] != 1 && $_GET['type'] != 3) { ?>
490 490
 			    <input id="select-type-1" name="radio-sort" type="radio" data-item="ff-item-type-1" checked="checked"  class="hide"  />
491 491
 			    <label id="ff-item-type-1" title="<?php echo lang_Files; ?>" for="select-type-1" class="tip btn ff-label-type-1"><i class="icon-file"></i></label>
492 492
 			    <input id="select-type-2" name="radio-sort" type="radio" data-item="ff-item-type-2" class="hide"  />
@@ -498,10 +498,10 @@  discard block
 block discarded – undo
498 498
 			    <input id="select-type-5" name="radio-sort" type="radio" data-item="ff-item-type-5" class="hide"  />
499 499
 			    <label id="ff-item-type-5" title="<?php echo lang_Music; ?>" for="select-type-5" class="tip btn ff-label-type-5"><i class="icon-music"></i></label>
500 500
 			    <?php } ?>
501
-			    <input accesskey="f" type="text" class="filter-input <?php echo (($_GET['type']!=1 && $_GET['type']!=3) ? '' : 'filter-input-notype'); ?>" id="filter-input" name="filter" placeholder="<?php echo fix_strtolower(lang_Text_filter); ?>..." value="<?php echo $filter; ?>"/><?php if($n_files>$file_number_limit_js){ ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php } ?>
501
+			    <input accesskey="f" type="text" class="filter-input <?php echo (($_GET['type'] != 1 && $_GET['type'] != 3) ? '' : 'filter-input-notype'); ?>" id="filter-input" name="filter" placeholder="<?php echo fix_strtolower(lang_Text_filter); ?>..." value="<?php echo $filter; ?>"/><?php if ($n_files > $file_number_limit_js) { ?><label id="filter" class="btn"><i class="icon-play"></i></label><?php } ?>
502 502
 			    
503 503
 			    <input id="select-type-all" name="radio-sort" type="radio" data-item="ff-item-type-all" class="hide"  />
504
-			     <label id="ff-item-type-all" title="<?php echo lang_All; ?>" <?php if($_GET['type']==1 || $_GET['type']==3){ ?>style="visibility: hidden;" <?php } ?> data-item="ff-item-type-all" for="select-type-all" style="margin-rigth:0px;" class="tip btn btn-inverse ff-label-type-all"><i class="icon-align-justify icon-white"></i></label>
504
+			     <label id="ff-item-type-all" title="<?php echo lang_All; ?>" <?php if ($_GET['type'] == 1 || $_GET['type'] == 3) { ?>style="visibility: hidden;" <?php } ?> data-item="ff-item-type-all" for="select-type-all" style="margin-rigth:0px;" class="tip btn btn-inverse ff-label-type-all"><i class="icon-align-justify icon-white"></i></label>
505 505
 			    
506 506
 			</div>
507 507
 		    </div>
@@ -517,20 +517,20 @@  discard block
 block discarded – undo
517 517
     
518 518
     <div class="row-fluid">
519 519
 	<?php	
520
-	$link="dialog.php?".$get_params;
520
+	$link = "dialog.php?".$get_params;
521 521
 	?>
522 522
 	<ul class="breadcrumb">	
523 523
 	<li class="pull-left"><a href="<?php echo $link?>/"><i class="icon-home"></i></a></li>
524 524
 	<li><span class="divider">/</span></li>
525 525
 	<?php
526
-	$bc=explode("/",$subdir);
527
-	$tmp_path='';
528
-	if(!empty($bc))
529
-	foreach($bc as $k=>$b){ 
530
-		$tmp_path.=$b."/";
531
-		if($k==count($bc)-2){
526
+	$bc = explode("/", $subdir);
527
+	$tmp_path = '';
528
+	if (!empty($bc))
529
+	foreach ($bc as $k=>$b) { 
530
+		$tmp_path .= $b."/";
531
+		if ($k == count($bc) - 2) {
532 532
 	?> <li class="active"><?php echo $b?></li><?php
533
-		}elseif($b!=""){ ?>
533
+		}elseif ($b != "") { ?>
534 534
 		<li><a href="<?php echo $link.$tmp_path?>"><?php echo $b?></a></li><li><span class="divider"><?php echo "/"; ?></span></li>
535 535
 	<?php }
536 536
 	}
@@ -546,10 +546,10 @@  discard block
 block discarded – undo
546 546
 		</a>
547 547
 		<ul class="dropdown-menu pull-left sorting">
548 548
 		    <li><center><strong><?php echo lang_Sorting ?></strong></center></li>
549
-		<li><a class="sorter sort-name <?php if($sort_by==="name"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></li>
550
-		<li><a class="sorter sort-date <?php if($sort_by==="date"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></li>
551
-		<li><a class="sorter sort-size <?php if($sort_by==="size"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></li>
552
-		<li><a class="sorter sort-extension <?php if($sort_by==="extension"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></li>
549
+		<li><a class="sorter sort-name <?php if ($sort_by === "name") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></li>
550
+		<li><a class="sorter sort-date <?php if ($sort_by === "date") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></li>
551
+		<li><a class="sorter sort-size <?php if ($sort_by === "size") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></li>
552
+		<li><a class="sorter sort-extension <?php if ($sort_by === "extension") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></li>
553 553
 		</ul>
554 554
 	      </div>
555 555
 	</li>
@@ -558,22 +558,22 @@  discard block
 block discarded – undo
558 558
     <!-- breadcrumb div end -->
559 559
     <div class="row-fluid ff-container">
560 560
 	<div class="span12">	    
561
-	    <?php if(@opendir($current_path.$rfm_subfolder.$subdir)===FALSE){ ?>
561
+	    <?php if (@opendir($current_path.$rfm_subfolder.$subdir) === FALSE) { ?>
562 562
 	    <br/>
563 563
 	    <div class="alert alert-error">There is an error! The upload folder there isn't. Check your config.php file. </div> 
564
-	    <?php }else{ ?>
564
+	    <?php } else { ?>
565 565
 	    <h4 id="help"><?php echo lang_Swipe_help; ?></h4>
566
-	    <?php if(isset($folder_message)){ ?>
566
+	    <?php if (isset($folder_message)) { ?>
567 567
 		<div class="alert alert-block"><?php echo $folder_message; ?></div>
568 568
 	    <?php } ?>
569
-	    <?php if($show_sorting_bar){ ?>
569
+	    <?php if ($show_sorting_bar) { ?>
570 570
 	    <!-- sorter -->
571 571
 	    <div class="sorter-container <?php echo "list-view".$view; ?>">
572
-		<div class="file-name"><a class="sorter sort-name <?php if($sort_by==="name"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></div>
573
-		<div class="file-date"><a class="sorter sort-date <?php if($sort_by==="date"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></div>
574
-		<div class="file-size"><a class="sorter sort-size <?php if($sort_by==="size"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></div>
572
+		<div class="file-name"><a class="sorter sort-name <?php if ($sort_by === "name") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="name"><?php echo lang_Filename; ?></a></div>
573
+		<div class="file-date"><a class="sorter sort-date <?php if ($sort_by === "date") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="date"><?php echo lang_Date; ?></a></div>
574
+		<div class="file-size"><a class="sorter sort-size <?php if ($sort_by === "size") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="size"><?php echo lang_Size; ?></a></div>
575 575
 		<div class='img-dimension'><?php echo lang_Dimension; ?></div>
576
-		<div class='file-extension'><a class="sorter sort-extension <?php if($sort_by==="extension"){ echo ($descending)?"descending":"ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></div>
576
+		<div class='file-extension'><a class="sorter sort-extension <?php if ($sort_by === "extension") { echo ($descending) ? "descending" : "ascending"; } ?>" href="javascript:void('')" data-sort="extension"><?php echo lang_Type; ?></a></div>
577 577
 		<div class='file-operations'><?php echo lang_Operations; ?></div>
578 578
 	    </div>
579 579
 	    <?php } ?>
@@ -583,74 +583,74 @@  discard block
 block discarded – undo
583 583
 	    <ul class="grid cs-style-2 <?php echo "list-view".$view; ?>" id="main-item-container">
584 584
 		<?php
585 585
 		
586
-		$jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
586
+		$jplayer_ext = array("mp4", "flv", "webmv", "webma", "webm", "m4a", "m4v", "ogv", "oga", "mp3", "midi", "mid", "ogg", "wav");
587 587
 		foreach ($files as $file_array) {
588
-		    $file=$file_array['file'];
589
-			if($file === '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!==".." && strpos($file,$filter)===false))
588
+		    $file = $file_array['file'];
589
+			if ($file === '.' || (isset($file_array['extension']) && $file_array['extension'] != lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter != '' && $file !== ".." && strpos($file, $filter) === false))
590 590
 			    continue;
591
-			$new_name=fix_filename($file,$transliteration);
592
-			if($file!=='..' && $file!=$new_name){
591
+			$new_name = fix_filename($file, $transliteration);
592
+			if ($file !== '..' && $file != $new_name) {
593 593
 			    //rename
594
-			    rename_folder($current_path.$subdir.$new_name,$new_name,$transliteration);
595
-			    $file=$new_name;
594
+			    rename_folder($current_path.$subdir.$new_name, $new_name, $transliteration);
595
+			    $file = $new_name;
596 596
 			}
597 597
 			//add in thumbs folder if not exist 
598
-			if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
598
+			if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false, $thumbs_path.$subdir.$file);
599 599
 			$class_ext = 3;			
600
-			if($file==='..' && trim($subdir) != '' ){
601
-			    $src = explode("/",$subdir);
602
-			    unset($src[count($src)-2]);
603
-			    $src=implode("/",$src);
604
-			    if($src==='') $src="/";
600
+			if ($file === '..' && trim($subdir) != '') {
601
+			    $src = explode("/", $subdir);
602
+			    unset($src[count($src) - 2]);
603
+			    $src = implode("/", $src);
604
+			    if ($src === '') $src = "/";
605 605
 			}
606
-			elseif ($file!=='..') {
607
-			    $src = $subdir . $file."/";
606
+			elseif ($file !== '..') {
607
+			    $src = $subdir.$file."/";
608 608
 			}
609 609
 			
610 610
 			?>
611
-			    <li data-name="<?php echo $file ?>" <?php if($file==='..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
611
+			    <li data-name="<?php echo $file ?>" <?php if ($file === '..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
612 612
 			    $file_prevent_rename = false;
613 613
 			    $file_prevent_delete = false;
614 614
 			    if (isset($filePermissions[$file])) {
615 615
 				$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
616 616
 				$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
617 617
 			    }
618
-			    ?>	<figure data-name="<?php echo $file ?>" class="<?php if($file==="..") echo "back-"; ?>directory" data-type="<?php if($file!==".."){ echo "dir"; } ?>">
618
+			    ?>	<figure data-name="<?php echo $file ?>" class="<?php if ($file === "..") echo "back-"; ?>directory" data-type="<?php if ($file !== "..") { echo "dir"; } ?>">
619 619
 				    <a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
620 620
 				    <div class="img-precontainer">
621 621
 					<div class="img-container directory"><span></span>
622
-					<img class="directory-img"  src="img/<?php echo $icon_theme; ?>/folder<?php if($file===".."){ echo "_back"; }?>.jpg" alt="folder" />
622
+					<img class="directory-img"  src="img/<?php echo $icon_theme; ?>/folder<?php if ($file === "..") { echo "_back"; }?>.jpg" alt="folder" />
623 623
 					</div>
624 624
 				    </div>
625 625
 				    <div class="img-precontainer-mini directory">
626 626
 					<div class="img-container-mini">
627 627
 					    <span></span>
628
-					    <img class="directory-img"  src="img/<?php echo $icon_theme; ?>/folder<?php if($file===".."){ echo "_back"; }?>.png" alt="folder" />
628
+					    <img class="directory-img"  src="img/<?php echo $icon_theme; ?>/folder<?php if ($file === "..") { echo "_back"; }?>.png" alt="folder" />
629 629
 					</div>
630 630
 				    </div>
631
-			<?php if($file===".."){ ?>
631
+			<?php if ($file === "..") { ?>
632 632
 				    <div class="box no-effect">
633 633
 					<h4><?php echo lang_Back ?></h4>
634 634
 				    </div>
635 635
 				    </a>
636 636
 				    
637
-			<?php }else{ ?>
637
+			<?php } else { ?>
638 638
 				    </a>
639 639
 				    <div class="box">
640
-					<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>"><?php echo $file; ?></a></h4>
640
+					<h4 class="<?php if ($ellipsis_title_after_first_row) { echo "ellipsis"; } ?>"><a class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>"><?php echo $file; ?></a></h4>
641 641
 				    </div>
642 642
 				    <input type="hidden" class="name" value=""/>
643 643
 				    <input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
644
-				    <input type="hidden" class="size" value="<?php echo $file_array['size'];  ?>"/>
644
+				    <input type="hidden" class="size" value="<?php echo $file_array['size']; ?>"/>
645 645
 				    <input type="hidden" class="extension" value="<?php echo lang_Type_dir; ?>"/>
646
-				    <div class="file-date"><?php echo date(lang_Date_type,$file_array['date'])?></div>
647
-				    <?php if($show_folder_size){ ?><div class="file-size"><?php echo makeSize($file_array['size'])?></div><?php } ?>
646
+				    <div class="file-date"><?php echo date(lang_Date_type, $file_array['date'])?></div>
647
+				    <?php if ($show_folder_size) { ?><div class="file-size"><?php echo makeSize($file_array['size'])?></div><?php } ?>
648 648
 				    <div class='file-extension'><?php echo lang_Type_dir; ?></div>
649 649
 				    <figcaption>
650
-					    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
651
-					    <i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
652
-					    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders && !$file_prevent_delete) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>"  data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
653
-					    <i class="icon-trash <?php if(!$delete_folders || $file_prevent_delete) echo 'icon-white'; ?>"></i>
650
+					    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if ($rename_folders && !$file_prevent_rename) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
651
+					    <i class="icon-pencil <?php if (!$rename_folders || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
652
+					    <a href="javascript:void('')" class="tip-left erase-button <?php if ($delete_folders && !$file_prevent_delete) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>"  data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
653
+					    <i class="icon-trash <?php if (!$delete_folders || $file_prevent_delete) echo 'icon-white'; ?>"></i>
654 654
 					    </a>
655 655
 				    </figcaption>
656 656
 			<?php } ?>
@@ -661,101 +661,101 @@  discard block
 block discarded – undo
661 661
 			
662 662
             $files_prevent_duplicate = array();
663 663
 		    foreach ($files as $nu=>$file_array) {		
664
-			$file=$file_array['file'];
664
+			$file = $file_array['file'];
665 665
 		    
666
-			    if($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
666
+			    if ($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter != '' && strpos($file, $filter) === false))
667 667
 				    continue;
668 668
 			    
669
-			    $file_path=$current_path.$rfm_subfolder.$subdir.$file;
669
+			    $file_path = $current_path.$rfm_subfolder.$subdir.$file;
670 670
 			    //check if file have illegal caracter
671 671
 			    
672
-			    $filename=substr($file, 0, '-' . (strlen($file_array['extension']) + 1));
672
+			    $filename = substr($file, 0, '-'.(strlen($file_array['extension']) + 1));
673 673
 			    
674
-			    if($file!=fix_filename($file,$transliteration)){
675
-				$file1=fix_filename($file,$transliteration);
676
-				$file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
677
-				if(file_exists($file_path1)){
674
+			    if ($file != fix_filename($file, $transliteration)) {
675
+				$file1 = fix_filename($file, $transliteration);
676
+				$file_path1 = ($current_path.$rfm_subfolder.$subdir.$file1);
677
+				if (file_exists($file_path1)) {
678 678
 				    $i = 1;
679
-				    $info=pathinfo($file1);
680
-				    while(file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
679
+				    $info = pathinfo($file1);
680
+				    while (file_exists($current_path.$rfm_subfolder.$subdir.$info['filename'].".[".$i."].".$info['extension'])) {
681 681
 					    $i++;
682 682
 				    }
683
-				    $file1=$info['filename'].".[".$i."].".$info['extension'];
684
-				    $file_path1=($current_path.$rfm_subfolder.$subdir.$file1);
683
+				    $file1 = $info['filename'].".[".$i."].".$info['extension'];
684
+				    $file_path1 = ($current_path.$rfm_subfolder.$subdir.$file1);
685 685
 				}
686 686
 				
687
-				$filename=substr($file1, 0, '-' . (strlen($file_array['extension']) + 1));
688
-				rename_file($file_path,fix_filename($filename,$transliteration),$transliteration);
689
-				$file=$file1;
690
-				$file_array['extension']=fix_filename($file_array['extension'],$transliteration);
691
-				$file_path=$file_path1;
687
+				$filename = substr($file1, 0, '-'.(strlen($file_array['extension']) + 1));
688
+				rename_file($file_path, fix_filename($filename, $transliteration), $transliteration);
689
+				$file = $file1;
690
+				$file_array['extension'] = fix_filename($file_array['extension'], $transliteration);
691
+				$file_path = $file_path1;
692 692
 			    }
693 693
 			    
694
-			    $is_img=false;
695
-			    $is_video=false;
696
-			    $is_audio=false;
697
-			    $show_original=false;
698
-			    $show_original_mini=false;
699
-			    $mini_src="";
700
-			    $src_thumb="";
701
-			    $extension_lower=fix_strtolower($file_array['extension']);
702
-			    if(in_array($extension_lower, $ext_img)){
703
-				$src = $base_url . $cur_dir . rawurlencode($file);
704
-				$mini_src = $src_thumb = $thumbs_path.$subdir. $file;
694
+			    $is_img = false;
695
+			    $is_video = false;
696
+			    $is_audio = false;
697
+			    $show_original = false;
698
+			    $show_original_mini = false;
699
+			    $mini_src = "";
700
+			    $src_thumb = "";
701
+			    $extension_lower = fix_strtolower($file_array['extension']);
702
+			    if (in_array($extension_lower, $ext_img)) {
703
+				$src = $base_url.$cur_dir.rawurlencode($file);
704
+				$mini_src = $src_thumb = $thumbs_path.$subdir.$file;
705 705
 				//add in thumbs folder if not exist
706
-				if(!file_exists($src_thumb)){
706
+				if (!file_exists($src_thumb)) {
707 707
 				    try {
708 708
 					create_img_gd($file_path, $src_thumb, 122, 91);
709
-					new_thumbnails_creation($current_path.$rfm_subfolder.$subdir,$file_path,$file,$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
709
+					new_thumbnails_creation($current_path.$rfm_subfolder.$subdir, $file_path, $file, $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height);
710 710
 				    } catch (Exception $e) {
711
-					$src_thumb=$mini_src="";
711
+					$src_thumb = $mini_src = "";
712 712
 				    }
713 713
 				}
714
-				$is_img=true;
714
+				$is_img = true;
715 715
 				//check if is smaller than thumb
716
-				list($img_width, $img_height, $img_type, $attr)=getimagesize($file_path);
717
-				if($img_width<122 && $img_height<91){ 
718
-					$src_thumb=$current_path.$rfm_subfolder.$subdir.$file;
719
-					$show_original=true;
716
+				list($img_width, $img_height, $img_type, $attr) = getimagesize($file_path);
717
+				if ($img_width < 122 && $img_height < 91) { 
718
+					$src_thumb = $current_path.$rfm_subfolder.$subdir.$file;
719
+					$show_original = true;
720 720
 				}
721 721
 				
722
-				if($img_width<45 && $img_height<38){
723
-				    $mini_src=$current_path.$rfm_subfolder.$subdir.$file;
724
-				    $show_original_mini=true;
722
+				if ($img_width < 45 && $img_height < 38) {
723
+				    $mini_src = $current_path.$rfm_subfolder.$subdir.$file;
724
+				    $show_original_mini = true;
725 725
 				}
726 726
 			    }
727 727
 			    
728
-			    $is_icon_thumb=false;
729
-			    $is_icon_thumb_mini=false;
730
-			    $no_thumb=false;
731
-			    if($src_thumb==""){
732
-				$no_thumb=true;
733
-				if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
734
-					$src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
735
-				}else{
728
+			    $is_icon_thumb = false;
729
+			    $is_icon_thumb_mini = false;
730
+			    $no_thumb = false;
731
+			    if ($src_thumb == "") {
732
+				$no_thumb = true;
733
+				if (file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")) {
734
+					$src_thumb = 'img/'.$icon_theme.'/'.$extension_lower.".jpg";
735
+				} else {
736 736
 					$src_thumb = "img/".$icon_theme."/default.jpg";
737 737
 				}
738
-				$is_icon_thumb=true;
738
+				$is_icon_thumb = true;
739 739
 			    }
740
-			    if($mini_src==""){
741
-				$is_icon_thumb_mini=false;
740
+			    if ($mini_src == "") {
741
+				$is_icon_thumb_mini = false;
742 742
 			    }
743 743
 			    
744
-			    $class_ext=0;
744
+			    $class_ext = 0;
745 745
 			    if (in_array($extension_lower, $ext_video)) {
746 746
 				    $class_ext = 4;
747
-				    $is_video=true;
747
+				    $is_video = true;
748 748
 			    }elseif (in_array($extension_lower, $ext_img)) {
749 749
 				    $class_ext = 2;
750 750
 			    }elseif (in_array($extension_lower, $ext_music)) {
751 751
 				    $class_ext = 5;
752
-				    $is_audio=true;
752
+				    $is_audio = true;
753 753
 			    }elseif (in_array($extension_lower, $ext_misc)) {
754 754
 				    $class_ext = 3;
755
-			    }else{
755
+			    } else {
756 756
 				    $class_ext = 1;
757 757
 			    }
758
-			    if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
758
+			    if ((!($_GET['type'] == 1 && !$is_img) && !(($_GET['type'] == 3 && !$is_video) && ($_GET['type'] == 3 && !$is_audio))) && $class_ext > 0) {
759 759
 ?>
760 760
 		    <li class="ff-item-type-<?php echo $class_ext; ?> file"  data-name="<?php echo $file; ?>"><?php
761 761
 		    $file_prevent_rename = false;
@@ -767,39 +767,39 @@  discard block
 block discarded – undo
767 767
 			$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
768 768
 			$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
769 769
 		    }
770
-            ?>		<figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
770
+            ?>		<figure data-name="<?php echo $file ?>" data-type="<?php if ($is_img) { echo "img"; } else { echo "file"; } ?>">
771 771
 				<a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
772 772
 				<div class="img-precontainer">
773
-				    <?php if($is_icon_thumb){ ?><div class="filetype"><?php echo $extension_lower ?></div><?php } ?>
773
+				    <?php if ($is_icon_thumb) { ?><div class="filetype"><?php echo $extension_lower ?></div><?php } ?>
774 774
 				    <div class="img-container">
775 775
 					    <span></span>
776
-					    <img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo $src_thumb; ?>">
776
+					    <img alt="<?php echo $filename." thumbnails"; ?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo $src_thumb; ?>">
777 777
 				    </div>
778 778
 				</div>
779
-				<div class="img-precontainer-mini <?php if($is_img) echo 'original-thumb' ?>">
780
-				    <div class="filetype <?php echo $extension_lower ?> <?php if(!$is_icon_thumb){ echo "hide"; }?>"><?php echo $extension_lower ?></div>
779
+				<div class="img-precontainer-mini <?php if ($is_img) echo 'original-thumb' ?>">
780
+				    <div class="filetype <?php echo $extension_lower ?> <?php if (!$is_icon_thumb) { echo "hide"; }?>"><?php echo $extension_lower ?></div>
781 781
 				    <div class="img-container-mini">
782 782
 					<span></span>
783
-					<?php if($mini_src!=""){ ?>
784
-					<img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original_mini ? "original" : "" ?> <?php echo $is_icon_thumb_mini ? "icon" : "" ?>" src="<?php echo $mini_src; ?>">
783
+					<?php if ($mini_src != "") { ?>
784
+					<img alt="<?php echo $filename." thumbnails"; ?>" class="<?php echo $show_original_mini ? "original" : "" ?> <?php echo $is_icon_thumb_mini ? "icon" : "" ?>" src="<?php echo $mini_src; ?>">
785 785
 					<?php } ?>
786 786
 				    </div>
787 787
 				</div>
788
-				<?php if($is_icon_thumb){ ?>
788
+				<?php if ($is_icon_thumb) { ?>
789 789
 				<div class="cover"></div>
790 790
 				<?php } ?>
791 791
 				</a>	
792 792
 				<div class="box">				
793
-				<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
793
+				<h4 class="<?php if ($ellipsis_title_after_first_row) { echo "ellipsis"; } ?>"><a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
794 794
 				<?php echo $filename; ?></a> </h4>
795 795
 				</div>
796 796
 				<input type="hidden" class="date" value="<?php echo $file_array['date']; ?>"/>
797 797
 				<input type="hidden" class="size" value="<?php echo $file_array['size'] ?>"/>
798 798
 				<input type="hidden" class="extension" value="<?php echo $extension_lower; ?>"/>
799 799
 				<input type="hidden" class="name" value=""/>
800
-				<div class="file-date"><?php echo date(lang_Date_type,$file_array['date'])?></div>
800
+				<div class="file-date"><?php echo date(lang_Date_type, $file_array['date'])?></div>
801 801
 				<div class="file-size"><?php echo makeSize($file_array['size'])?></div>
802
-				<div class='img-dimension'><?php if($is_img){ echo $img_width."x".$img_height; } ?></div>
802
+				<div class='img-dimension'><?php if ($is_img) { echo $img_width."x".$img_height; } ?></div>
803 803
 				<div class='file-extension'><?php echo $extension_lower; ?></div>
804 804
 				<figcaption>
805 805
 				    <form action="force_download.php" method="post" class="download-form" id="form<?php echo $nu; ?>">
@@ -807,20 +807,20 @@  discard block
 block discarded – undo
807 807
 					<input type="hidden" class="name_download" name="name" value="<?php echo $file?>"/>
808 808
 					
809 809
 				    <a title="<?php echo lang_Download?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo $nu; ?>').submit();"><i class="icon-download"></i></a>
810
-				    <?php if($is_img && $src_thumb!=""){ ?>
811
-				    <a class="tip-right preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
812
-				    <?php }elseif(($is_video || $is_audio) && in_array($extension_lower,$jplayer_ext)){ ?>
813
-				    <a class="tip-right modalAV <?php if($is_audio){ echo "audio"; }else{ echo "video"; } ?>"
814
-					title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file;; ?>"
810
+				    <?php if ($is_img && $src_thumb != "") { ?>
811
+				    <a class="tip-right preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src; ?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
812
+				    <?php }elseif (($is_video || $is_audio) && in_array($extension_lower, $jplayer_ext)) { ?>
813
+				    <a class="tip-right modalAV <?php if ($is_audio) { echo "audio"; } else { echo "video"; } ?>"
814
+					title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file; ; ?>"
815 815
 					href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
816
-				    <?php }else{ ?>
816
+				    <?php } else { ?>
817 817
 				    <a class="preview disabled"><i class="icon-eye-open icon-white"></i></a>
818 818
 				    <?php } ?>
819
-				    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_files && !$file_prevent_rename) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
820
- 				    <i class="icon-pencil <?php if(!$rename_files || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
819
+				    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if ($rename_files && !$file_prevent_rename) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
820
+ 				    <i class="icon-pencil <?php if (!$rename_files || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
821 821
 
822
-				    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files && !$file_prevent_delete) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
823
- 				    <i class="icon-trash <?php if(!$delete_files || $file_prevent_delete) echo 'icon-white'; ?>"></i>
822
+				    <a href="javascript:void('')" class="tip-left erase-button <?php if ($delete_files && !$file_prevent_delete) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
823
+ 				    <i class="icon-trash <?php if (!$delete_files || $file_prevent_delete) echo 'icon-white'; ?>"></i>
824 824
 				    </a>
825 825
 				    </form>
826 826
 				</figcaption>
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
     var files_prevent_duplicate = new Array();
841 841
     <?php
842 842
     foreach ($files_prevent_duplicate as $key => $value): ?>
843
-        files_prevent_duplicate[<?php echo $key;?>] = '<?php echo $value; ?>';
843
+        files_prevent_duplicate[<?php echo $key; ?>] = '<?php echo $value; ?>';
844 844
     <?php endforeach; ?>
845 845
 </script>
846 846
 
Please login to merge, or discard this patch.
Braces   +192 added lines, -77 removed lines patch added patch discarded remove patch
@@ -7,26 +7,28 @@  discard block
 block discarded – undo
7 7
 
8 8
 include('upload.php');
9 9
 
10
-}else{
10
+} else{
11 11
 
12 12
 include('include/utils.php');
13 13
 
14 14
 if (isset($_GET['fldr'])
15 15
     && !empty($_GET['fldr'])
16 16
     && strpos($_GET['fldr'],'../')===FALSE
17
-    && strpos($_GET['fldr'],'./')===FALSE)
17
+    && strpos($_GET['fldr'],'./')===FALSE) {
18 18
     $subdir = urldecode(trim(strip_tags($_GET['fldr']),"/") ."/");
19
-else
19
+} else {
20 20
     $subdir = '';
21
+}
21 22
     
22 23
 //remember last position
23 24
 setcookie('last_position',$subdir,time() + (86400 * 7)); 
24 25
 
25 26
 if($subdir==""){
26 27
     if(!empty($_COOKIE['last_position'])
27
-	&& strpos($_COOKIE['last_position'],'.')===FALSE)
28
-	$subdir= trim($_COOKIE['last_position']);
29
-}
28
+	&& strpos($_COOKIE['last_position'],'.')===FALSE) {
29
+    	$subdir= trim($_COOKIE['last_position']);
30
+    }
31
+    }
30 32
 
31 33
 if($subdir==="/"){
32 34
     $subdir="";
@@ -36,13 +38,19 @@  discard block
 block discarded – undo
36 38
 /***
37 39
  *SUB-DIR CODE
38 40
  ***/
39
-if(!isset($_SESSION['RF']["subfolder"])) $_SESSION['RF']["subfolder"]='';
41
+if(!isset($_SESSION['RF']["subfolder"])) {
42
+    $_SESSION['RF']["subfolder"]='';
43
+}
40 44
 $rfm_subfolder = '';
41 45
 if(!empty($_SESSION['RF']["subfolder"]) && strpos($_SESSION['RF']["subfolder"],'../')===FALSE
42 46
    && strpos($_SESSION['RF']["subfolder"],'./')===FALSE && strpos($_SESSION['RF']["subfolder"],"/")!==0
43
-    && strpos($_SESSION['RF']["subfolder"],'.')===FALSE) $rfm_subfolder= $_SESSION['RF']['subfolder'];
47
+    && strpos($_SESSION['RF']["subfolder"],'.')===FALSE) {
48
+    $rfm_subfolder= $_SESSION['RF']['subfolder'];
49
+}
44 50
    
45
-if($rfm_subfolder!="" && $rfm_subfolder[strlen($rfm_subfolder)-1]!=="/") $rfm_subfolder.="/";
51
+if($rfm_subfolder!="" && $rfm_subfolder[strlen($rfm_subfolder)-1]!=="/") {
52
+    $rfm_subfolder.="/";
53
+}
46 54
    
47 55
 if(!file_exists($current_path . $rfm_subfolder.$subdir)){
48 56
     $subdir='';
@@ -56,7 +64,7 @@  discard block
 block discarded – undo
56 64
     $cur_path = $current_path . $subdir;
57 65
     $thumbs_path = $thumbs_base_path;
58 66
     $parent=$subdir;
59
-}else{
67
+} else{
60 68
     $cur_dir = $upload_dir . $rfm_subfolder.$subdir;
61 69
     $cur_path = $current_path . $rfm_subfolder.$subdir;
62 70
     $thumbs_path = $thumbs_base_path. $rfm_subfolder;
@@ -68,21 +76,30 @@  discard block
 block discarded – undo
68 76
 $i=0;
69 77
 while($cycle && $i<$max_cycles){
70 78
     $i++;
71
-    if($parent==="./") $parent="";
79
+    if($parent==="./") {
80
+        $parent="";
81
+    }
72 82
     if(file_exists($current_path.$parent."config.php")){
73 83
 	require_once($current_path.$parent."config.php");
74 84
 	$cycle=false;
75 85
     }
76 86
     
77
-    if($parent=="") $cycle=false;
78
-    else $parent=fix_dirname($parent)."/";
79
-}
87
+    if($parent=="") {
88
+        $cycle=false;
89
+    } else {
90
+        $parent=fix_dirname($parent)."/";
91
+    }
92
+    }
80 93
 
81 94
 if(!is_dir($thumbs_path.$subdir)){
82 95
     create_folder(false, $thumbs_path.$subdir);
83 96
 }
84 97
 
85
-if(isset($_GET['popup'])) $popup= strip_tags($_GET['popup']); else $popup=0;
98
+if(isset($_GET['popup'])) {
99
+    $popup= strip_tags($_GET['popup']);
100
+} else {
101
+    $popup=0;
102
+}
86 103
 //Sanitize popup
87 104
 $popup=!!$popup;
88 105
 
@@ -91,16 +108,29 @@  discard block
 block discarded – undo
91 108
 if(isset($_GET['view'])){ $view=fix_get_params($_GET['view']); $_SESSION['RF']["view_type"] = $view; }
92 109
 $view=$_SESSION['RF']["view_type"];
93 110
 
94
-if(isset($_GET["filter"])) $filter=fix_get_params($_GET["filter"]);
95
-else $filter='';
111
+if(isset($_GET["filter"])) {
112
+    $filter=fix_get_params($_GET["filter"]);
113
+} else {
114
+    $filter='';
115
+}
96 116
 
97
-if(!isset($_SESSION['RF']['sort_by'])) $_SESSION['RF']['sort_by']='';
98
-if(isset($_GET["sort_by"])) $sort_by=$_SESSION['RF']['sort_by']=fix_get_params($_GET["sort_by"]);
99
-else $sort_by=$_SESSION['RF']['sort_by'];
117
+if(!isset($_SESSION['RF']['sort_by'])) {
118
+    $_SESSION['RF']['sort_by']='';
119
+}
120
+if(isset($_GET["sort_by"])) {
121
+    $sort_by=$_SESSION['RF']['sort_by']=fix_get_params($_GET["sort_by"]);
122
+} else {
123
+    $sort_by=$_SESSION['RF']['sort_by'];
124
+}
100 125
 
101
-if(!isset($_SESSION['RF']['descending'])) $_SESSION['RF']['descending']=false;
102
-if(isset($_GET["descending"])) $descending=$_SESSION['RF']['descending']=fix_get_params($_GET["descending"])==="true";
103
-else $descending=$_SESSION['RF']['descending'];
126
+if(!isset($_SESSION['RF']['descending'])) {
127
+    $_SESSION['RF']['descending']=false;
128
+}
129
+if(isset($_GET["descending"])) {
130
+    $descending=$_SESSION['RF']['descending']=fix_get_params($_GET["descending"])==="true";
131
+} else {
132
+    $descending=$_SESSION['RF']['descending'];
133
+}
104 134
 
105 135
 
106 136
 $lang=$default_language;
@@ -114,8 +144,7 @@  discard block
 block discarded – undo
114 144
     $path_parts = pathinfo($lang);
115 145
     if(is_readable('lang/' .$path_parts['basename']. '.php')){ 
116 146
         $language_file = 'lang/' .$path_parts['basename']. '.php';
117
-    }
118
-    else {
147
+    } else {
119 148
     	echo "<script>console.log('The ".$lang." language file is not readable! Falling back...');</script>";
120 149
     }
121 150
 }
@@ -124,8 +153,12 @@  discard block
 block discarded – undo
124 153
 $_SESSION['RF']['language_file'] = $language_file;
125 154
 require_once $language_file;
126 155
 
127
-if(!isset($_GET['type'])) $_GET['type']=0;
128
-if(!isset($_GET['field_id'])) $_GET['field_id']='';
156
+if(!isset($_GET['type'])) {
157
+    $_GET['type']=0;
158
+}
159
+if(!isset($_GET['field_id'])) {
160
+    $_GET['field_id']='';
161
+}
129 162
 
130 163
 $field_id=isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
131 164
 $type_param=fix_get_params($_GET['type']);
@@ -222,7 +255,7 @@  discard block
 block discarded – undo
222 255
 	if($aviary_active){
223 256
 	if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
224 257
 	    <script type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>
225
-	<?php }else{ ?>
258
+	<?php } else{ ?>
226 259
 	    <script type="text/javascript" src="http://feather.aviary.com/js/feather.js "></script>
227 260
 	<?php }} ?>
228 261
 	
@@ -306,7 +339,12 @@  discard block
 block discarded – undo
306 339
 	<input type="hidden" id="cancel" value="<?php echo lang_Cancel; ?>" />
307 340
 	<input type="hidden" id="rename" value="<?php echo lang_Rename; ?>" />
308 341
 	<input type="hidden" id="lang_duplicate" value="<?php echo lang_Duplicate; ?>" />
309
-	<input type="hidden" id="duplicate" value="<?php if($duplicate_files) echo 1; else echo 0; ?>" />
342
+	<input type="hidden" id="duplicate" value="<?php if($duplicate_files) {
343
+    echo 1;
344
+} else {
345
+    echo 0;
346
+}
347
+?>" />
310 348
 	<input type="hidden" id="base_url" value="<?php echo $base_url?>"/>
311 349
 	<input type="hidden" id="base_url_true" value="<?php echo base_url(); ?>"/>
312 350
 	<input type="hidden" id="fldr_value" value="<?php echo $subdir; ?>"/>
@@ -316,8 +354,18 @@  discard block
 block discarded – undo
316 354
 	<?php $protocol = 'http'; ?>
317 355
 	<input type="hidden" id="current_url" value="<?php echo str_replace(array('&filter='.$filter),array(''),$protocol."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>" />
318 356
 	<input type="hidden" id="lang_show_url" value="<?php echo lang_Show_url; ?>" />
319
-	<input type="hidden" id="copy_cut_files_allowed" value="<?php if($copy_cut_files) echo 1; else echo 0; ?>" />
320
-	<input type="hidden" id="copy_cut_dirs_allowed" value="<?php if($copy_cut_dirs) echo 1; else echo 0; ?>" />
357
+	<input type="hidden" id="copy_cut_files_allowed" value="<?php if($copy_cut_files) {
358
+    echo 1;
359
+} else {
360
+    echo 0;
361
+}
362
+?>" />
363
+	<input type="hidden" id="copy_cut_dirs_allowed" value="<?php if($copy_cut_dirs) {
364
+    echo 1;
365
+} else {
366
+    echo 0;
367
+}
368
+?>" />
321 369
 	<input type="hidden" id="copy_cut_max_size" value="<?php echo $copy_cut_max_size; ?>" />
322 370
 	<input type="hidden" id="copy_cut_max_count" value="<?php echo $copy_cut_max_count; ?>" />
323 371
 	<input type="hidden" id="lang_copy" value="<?php echo lang_Copy; ?>" />
@@ -385,11 +433,17 @@  discard block
 block discarded – undo
385 433
 $class_ext = '';
386 434
 $src = '';
387 435
 
388
-if ($_GET['type']==1) 	 $apply = 'apply_img';
389
-elseif($_GET['type']==2) $apply = 'apply_link';
390
-elseif($_GET['type']==0 && $_GET['field_id']=='') $apply = 'apply_none';
391
-elseif($_GET['type']==3) $apply = 'apply_video';
392
-else $apply = 'apply';
436
+if ($_GET['type']==1) {
437
+    $apply = 'apply_img';
438
+} elseif($_GET['type']==2) {
439
+    $apply = 'apply_link';
440
+} elseif($_GET['type']==0 && $_GET['field_id']=='') {
441
+    $apply = 'apply_none';
442
+} elseif($_GET['type']==3) {
443
+    $apply = 'apply_video';
444
+} else {
445
+    $apply = 'apply';
446
+}
393 447
 
394 448
 $files = scandir($current_path.$rfm_subfolder.$subdir);
395 449
 $n_files=count($files);
@@ -399,14 +453,16 @@  discard block
 block discarded – undo
399 453
 $current_folder=array();
400 454
 $prev_folder=array();
401 455
 foreach($files as $k=>$file){
402
-    if($file===".") $current_folder=array('file'=>$file);
403
-    elseif($file==="..") $prev_folder=array('file'=>$file);
404
-    elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
456
+    if($file===".") {
457
+        $current_folder=array('file'=>$file);
458
+    } elseif($file==="..") {
459
+        $prev_folder=array('file'=>$file);
460
+    } elseif(is_dir($current_path.$rfm_subfolder.$subdir.$file)){
405 461
 	$date=filemtime($current_path.$rfm_subfolder.$subdir. $file);
406 462
 	$size=foldersize($current_path.$rfm_subfolder.$subdir. $file);
407 463
 	$file_ext=lang_Type_dir;
408 464
 	$sorted[$k]=array('file'=>$file,'date'=>$date,'size'=>$size,'extension'=>$file_ext);
409
-    }else{
465
+    } else{
410 466
 	$file_path=$current_path.$rfm_subfolder.$subdir.$file;
411 467
 	$date=filemtime($file_path);
412 468
 	$size=filesize($file_path);
@@ -480,9 +536,27 @@  discard block
 block discarded – undo
480 536
 			<div class="span3 half view-controller">
481 537
 
482 538
 				<span><?php echo lang_View; ?>:</span>
483
-			    <button class="btn tip<?php if($view==0) echo " btn-inverse"; ?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if($view==0) echo "icon-white"; ?>"></i></button>
484
-			    <button class="btn tip<?php if($view==1) echo " btn-inverse"; ?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if($view==1) echo "icon-white"; ?>"></i></button>
485
-			    <button class="btn tip<?php if($view==2) echo " btn-inverse"; ?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if($view==2) echo "icon-white"; ?>"></i></button>
539
+			    <button class="btn tip<?php if($view==0) {
540
+    echo " btn-inverse";
541
+}
542
+?>" id="view0" data-value="0" title="<?php echo lang_View_boxes; ?>"><i class="icon-th <?php if($view==0) {
543
+    echo "icon-white";
544
+}
545
+?>"></i></button>
546
+			    <button class="btn tip<?php if($view==1) {
547
+    echo " btn-inverse";
548
+}
549
+?>" id="view1" data-value="1" title="<?php echo lang_View_list; ?>"><i class="icon-align-justify <?php if($view==1) {
550
+    echo "icon-white";
551
+}
552
+?>"></i></button>
553
+			    <button class="btn tip<?php if($view==2) {
554
+    echo " btn-inverse";
555
+}
556
+?>" id="view2" data-value="2" title="<?php echo lang_View_columns_list; ?>"><i class="icon-fire <?php if($view==2) {
557
+    echo "icon-white";
558
+}
559
+?>"></i></button>
486 560
 			</div>
487 561
 			<div class="span6 half types"> 
488 562
 				<span><?php echo lang_Filters; ?>:</span>
@@ -525,12 +599,13 @@  discard block
 block discarded – undo
525 599
 	<?php
526 600
 	$bc=explode("/",$subdir);
527 601
 	$tmp_path='';
528
-	if(!empty($bc))
529
-	foreach($bc as $k=>$b){ 
602
+	if(!empty($bc)) {
603
+		foreach($bc as $k=>$b){ 
530 604
 		$tmp_path.=$b."/";
605
+	}
531 606
 		if($k==count($bc)-2){
532 607
 	?> <li class="active"><?php echo $b?></li><?php
533
-		}elseif($b!=""){ ?>
608
+		} elseif($b!=""){ ?>
534 609
 		<li><a href="<?php echo $link.$tmp_path?>"><?php echo $b?></a></li><li><span class="divider"><?php echo "/"; ?></span></li>
535 610
 	<?php }
536 611
 	}
@@ -561,7 +636,7 @@  discard block
 block discarded – undo
561 636
 	    <?php if(@opendir($current_path.$rfm_subfolder.$subdir)===FALSE){ ?>
562 637
 	    <br/>
563 638
 	    <div class="alert alert-error">There is an error! The upload folder there isn't. Check your config.php file. </div> 
564
-	    <?php }else{ ?>
639
+	    <?php } else{ ?>
565 640
 	    <h4 id="help"><?php echo lang_Swipe_help; ?></h4>
566 641
 	    <?php if(isset($folder_message)){ ?>
567 642
 		<div class="alert alert-block"><?php echo $folder_message; ?></div>
@@ -586,8 +661,9 @@  discard block
 block discarded – undo
586 661
 		$jplayer_ext=array("mp4","flv","webmv","webma","webm","m4a","m4v","ogv","oga","mp3","midi","mid","ogg","wav");
587 662
 		foreach ($files as $file_array) {
588 663
 		    $file=$file_array['file'];
589
-			if($file === '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!==".." && strpos($file,$filter)===false))
590
-			    continue;
664
+			if($file === '.' || (isset($file_array['extension']) && $file_array['extension']!=lang_Type_dir) || ($file === '..' && $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' && $file!==".." && strpos($file,$filter)===false)) {
665
+						    continue;
666
+			}
591 667
 			$new_name=fix_filename($file,$transliteration);
592 668
 			if($file!=='..' && $file!=$new_name){
593 669
 			    //rename
@@ -595,27 +671,38 @@  discard block
 block discarded – undo
595 671
 			    $file=$new_name;
596 672
 			}
597 673
 			//add in thumbs folder if not exist 
598
-			if (!file_exists($thumbs_path.$subdir.$file)) create_folder(false,$thumbs_path.$subdir.$file);
674
+			if (!file_exists($thumbs_path.$subdir.$file)) {
675
+			    create_folder(false,$thumbs_path.$subdir.$file);
676
+			}
599 677
 			$class_ext = 3;			
600 678
 			if($file==='..' && trim($subdir) != '' ){
601 679
 			    $src = explode("/",$subdir);
602 680
 			    unset($src[count($src)-2]);
603 681
 			    $src=implode("/",$src);
604
-			    if($src==='') $src="/";
605
-			}
606
-			elseif ($file!=='..') {
682
+			    if($src==='') {
683
+			        $src="/";
684
+			    }
685
+			} elseif ($file!=='..') {
607 686
 			    $src = $subdir . $file."/";
608 687
 			}
609 688
 			
610 689
 			?>
611
-			    <li data-name="<?php echo $file ?>" <?php if($file==='..') echo 'class="back"'; else echo 'class="dir"'; ?>><?php
690
+			    <li data-name="<?php echo $file ?>" <?php if($file==='..') {
691
+    echo 'class="back"';
692
+} else {
693
+    echo 'class="dir"';
694
+}
695
+?>><?php
612 696
 			    $file_prevent_rename = false;
613 697
 			    $file_prevent_delete = false;
614 698
 			    if (isset($filePermissions[$file])) {
615 699
 				$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
616 700
 				$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
617 701
 			    }
618
-			    ?>	<figure data-name="<?php echo $file ?>" class="<?php if($file==="..") echo "back-"; ?>directory" data-type="<?php if($file!==".."){ echo "dir"; } ?>">
702
+			    ?>	<figure data-name="<?php echo $file ?>" class="<?php if($file==="..") {
703
+			        echo "back-";
704
+			    }
705
+			    ?>directory" data-type="<?php if($file!==".."){ echo "dir"; } ?>">
619 706
 				    <a class="folder-link" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>">
620 707
 				    <div class="img-precontainer">
621 708
 					<div class="img-container directory"><span></span>
@@ -634,7 +721,7 @@  discard block
 block discarded – undo
634 721
 				    </div>
635 722
 				    </a>
636 723
 				    
637
-			<?php }else{ ?>
724
+			<?php } else{ ?>
638 725
 				    </a>
639 726
 				    <div class="box">
640 727
 					<h4 class="<?php if($ellipsis_title_after_first_row){ echo "ellipsis"; } ?>"><a class="folder-link" data-file="<?php echo $file ?>" href="dialog.php?<?php echo $get_params.rawurlencode($src)."&".uniqid() ?>"><?php echo $file; ?></a></h4>
@@ -647,10 +734,22 @@  discard block
 block discarded – undo
647 734
 				    <?php if($show_folder_size){ ?><div class="file-size"><?php echo makeSize($file_array['size'])?></div><?php } ?>
648 735
 				    <div class='file-extension'><?php echo lang_Type_dir; ?></div>
649 736
 				    <figcaption>
650
-					    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) echo "rename-folder"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
651
-					    <i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
652
-					    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders && !$file_prevent_delete) echo "delete-folder"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>"  data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
653
-					    <i class="icon-trash <?php if(!$delete_folders || $file_prevent_delete) echo 'icon-white'; ?>"></i>
737
+					    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_folders && !$file_prevent_rename) {
738
+    echo "rename-folder";
739
+}
740
+?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir.$file; ?>">
741
+					    <i class="icon-pencil <?php if(!$rename_folders || $file_prevent_rename) {
742
+    echo 'icon-white';
743
+}
744
+?>"></i></a>
745
+					    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_folders && !$file_prevent_delete) {
746
+    echo "delete-folder";
747
+}
748
+?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_Folder_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>"  data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
749
+					    <i class="icon-trash <?php if(!$delete_folders || $file_prevent_delete) {
750
+    echo 'icon-white';
751
+}
752
+?>"></i>
654 753
 					    </a>
655 754
 				    </figcaption>
656 755
 			<?php } ?>
@@ -663,8 +762,9 @@  discard block
 block discarded – undo
663 762
 		    foreach ($files as $nu=>$file_array) {		
664 763
 			$file=$file_array['file'];
665 764
 		    
666
-			    if($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false))
667
-				    continue;
765
+			    if($file === '.' || $file === '..' || is_dir($current_path.$rfm_subfolder.$subdir.$file) || in_array($file, $hidden_files) || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' && strpos($file,$filter)===false)) {
766
+			    				    continue;
767
+			    }
668 768
 			    
669 769
 			    $file_path=$current_path.$rfm_subfolder.$subdir.$file;
670 770
 			    //check if file have illegal caracter
@@ -732,7 +832,7 @@  discard block
 block discarded – undo
732 832
 				$no_thumb=true;
733 833
 				if(file_exists('img/'.$icon_theme.'/'.$extension_lower.".jpg")){
734 834
 					$src_thumb ='img/'.$icon_theme.'/'.$extension_lower.".jpg";
735
-				}else{
835
+				} else{
736 836
 					$src_thumb = "img/".$icon_theme."/default.jpg";
737 837
 				}
738 838
 				$is_icon_thumb=true;
@@ -745,14 +845,14 @@  discard block
 block discarded – undo
745 845
 			    if (in_array($extension_lower, $ext_video)) {
746 846
 				    $class_ext = 4;
747 847
 				    $is_video=true;
748
-			    }elseif (in_array($extension_lower, $ext_img)) {
848
+			    } elseif (in_array($extension_lower, $ext_img)) {
749 849
 				    $class_ext = 2;
750
-			    }elseif (in_array($extension_lower, $ext_music)) {
850
+			    } elseif (in_array($extension_lower, $ext_music)) {
751 851
 				    $class_ext = 5;
752 852
 				    $is_audio=true;
753
-			    }elseif (in_array($extension_lower, $ext_misc)) {
853
+			    } elseif (in_array($extension_lower, $ext_misc)) {
754 854
 				    $class_ext = 3;
755
-			    }else{
855
+			    } else{
756 856
 				    $class_ext = 1;
757 857
 			    }
758 858
 			    if((!($_GET['type']==1 && !$is_img) && !(($_GET['type']==3 && !$is_video) && ($_GET['type']==3 && !$is_audio))) && $class_ext>0){
@@ -767,7 +867,7 @@  discard block
 block discarded – undo
767 867
 			$file_prevent_rename = isset($filePermissions[$file]['prevent_rename']) && $filePermissions[$file]['prevent_rename'];
768 868
 			$file_prevent_delete = isset($filePermissions[$file]['prevent_delete']) && $filePermissions[$file]['prevent_delete'];
769 869
 		    }
770
-            ?>		<figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; }else{ echo "file"; } ?>">
870
+            ?>		<figure data-name="<?php echo $file ?>" data-type="<?php if($is_img){ echo "img"; } else{ echo "file"; } ?>">
771 871
 				<a href="javascript:void('')" class="link" data-file="<?php echo $file; ?>" data-field_id="<?php echo $field_id; ?>" data-function="<?php echo $apply; ?>">
772 872
 				<div class="img-precontainer">
773 873
 				    <?php if($is_icon_thumb){ ?><div class="filetype"><?php echo $extension_lower ?></div><?php } ?>
@@ -776,8 +876,11 @@  discard block
 block discarded – undo
776 876
 					    <img alt="<?php echo $filename." thumbnails";?>" class="<?php echo $show_original ? "original" : "" ?> <?php echo $is_icon_thumb ? "icon" : "" ?>" src="<?php echo $src_thumb; ?>">
777 877
 				    </div>
778 878
 				</div>
779
-				<div class="img-precontainer-mini <?php if($is_img) echo 'original-thumb' ?>">
780
-				    <div class="filetype <?php echo $extension_lower ?> <?php if(!$is_icon_thumb){ echo "hide"; }?>"><?php echo $extension_lower ?></div>
879
+				<div class="img-precontainer-mini <?php if($is_img) {
880
+    echo 'original-thumb' ?>">
881
+				    <div class="filetype <?php echo $extension_lower ?> <?php if(!$is_icon_thumb){ echo "hide";
882
+}
883
+}?>"><?php echo $extension_lower ?></div>
781 884
 				    <div class="img-container-mini">
782 885
 					<span></span>
783 886
 					<?php if($mini_src!=""){ ?>
@@ -809,18 +912,30 @@  discard block
 block discarded – undo
809 912
 				    <a title="<?php echo lang_Download?>" class="tip-right" href="javascript:void('')" onclick="$('#form<?php echo $nu; ?>').submit();"><i class="icon-download"></i></a>
810 913
 				    <?php if($is_img && $src_thumb!=""){ ?>
811 914
 				    <a class="tip-right preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
812
-				    <?php }elseif(($is_video || $is_audio) && in_array($extension_lower,$jplayer_ext)){ ?>
813
-				    <a class="tip-right modalAV <?php if($is_audio){ echo "audio"; }else{ echo "video"; } ?>"
915
+				    <?php } elseif(($is_video || $is_audio) && in_array($extension_lower,$jplayer_ext)){ ?>
916
+				    <a class="tip-right modalAV <?php if($is_audio){ echo "audio"; } else{ echo "video"; } ?>"
814 917
 					title="<?php echo lang_Preview?>" data-url="ajax_calls.php?action=media_preview&title=<?php echo $filename; ?>&file=<?php echo $current_path.$rfm_subfolder.$subdir.$file;; ?>"
815 918
 					href="javascript:void('');" ><i class=" icon-eye-open"></i></a>
816
-				    <?php }else{ ?>
919
+				    <?php } else{ ?>
817 920
 				    <a class="preview disabled"><i class="icon-eye-open icon-white"></i></a>
818 921
 				    <?php } ?>
819
-				    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_files && !$file_prevent_rename) echo "rename-file"; ?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
820
- 				    <i class="icon-pencil <?php if(!$rename_files || $file_prevent_rename) echo 'icon-white'; ?>"></i></a>
922
+				    <a href="javascript:void('')" class="tip-left edit-button rename-file-paths <?php if($rename_files && !$file_prevent_rename) {
923
+    echo "rename-file";
924
+}
925
+?>" title="<?php echo lang_Rename?>" data-path="<?php echo $rfm_subfolder.$subdir .$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
926
+ 				    <i class="icon-pencil <?php if(!$rename_files || $file_prevent_rename) {
927
+    echo 'icon-white';
928
+}
929
+?>"></i></a>
821 930
 
822
-				    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files && !$file_prevent_delete) echo "delete-file"; ?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
823
- 				    <i class="icon-trash <?php if(!$delete_files || $file_prevent_delete) echo 'icon-white'; ?>"></i>
931
+				    <a href="javascript:void('')" class="tip-left erase-button <?php if($delete_files && !$file_prevent_delete) {
932
+    echo "delete-file";
933
+}
934
+?>" title="<?php echo lang_Erase?>" data-confirm="<?php echo lang_Confirm_del; ?>" data-path="<?php echo $rfm_subfolder.$subdir.$file; ?>" data-thumb="<?php echo $thumbs_path.$subdir .$file; ?>">
935
+ 				    <i class="icon-trash <?php if(!$delete_files || $file_prevent_delete) {
936
+    echo 'icon-white';
937
+}
938
+?>"></i>
824 939
 				    </a>
825 940
 				    </form>
826 941
 				</figcaption>
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/config/config.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 $chemin_scheme =  $chemin_array["scheme"]; // http
15 15
 $chemin_host =  $chemin_array["host"]; // www.example.com  or // localhost
16 16
 //  $chemin_path =  $chemin_array["path"]; // /myweb1
17
-  if (!isset($chemin_array['path']))
17
+    if (!isset($chemin_array['path']))
18 18
     {
19
-      $chemin_path = '';
19
+        $chemin_path = '';
20 20
     }
21
-  else
21
+    else
22 22
     {
23
-      $chemin_path =  $chemin_array["path"];
23
+        $chemin_path =  $chemin_array["path"];
24 24
     }
25 25
 // XOOPS
26 26
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 // SERVER OVERRIDE
75 75
 if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){
76
-	$MaxSizeUpload = (int)(ini_get('post_max_size'));
76
+    $MaxSizeUpload = (int)(ini_get('post_max_size'));
77 77
 }
78 78
 
79 79
 $default_language 	= "en_EN"; //default language file name
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
     $usergroups = $GLOBALS['xoopsUser']->getGroups();
141 141
     $result_upload = array_intersect($usergroups, $allowed_groups_upload);
142 142
         if ($result_upload || $result_upload!=null) {
143
-           $upload_files = TRUE;
143
+            $upload_files = TRUE;
144 144
         }
145
-  $result_createfolder = array_intersect($usergroups, $allowed_groups_createfolder);
146
-       if ($result_createfolder || $result_createfolder!=null) {
147
-          $create_folders = TRUE;
145
+    $result_createfolder = array_intersect($usergroups, $allowed_groups_createfolder);
146
+        if ($result_createfolder || $result_createfolder!=null) {
147
+            $create_folders = TRUE;
148 148
         }
149 149
 }
150 150
 // XOOPS
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // XOOPS
3 3
 $current_path = __DIR__;
4
-if ( DIRECTORY_SEPARATOR !== "/" ) {
5
-    $current_path = str_replace( DIRECTORY_SEPARATOR, "/", $current_path);
4
+if (DIRECTORY_SEPARATOR !== "/") {
5
+    $current_path = str_replace(DIRECTORY_SEPARATOR, "/", $current_path);
6 6
 }
7 7
 $xoops_root_path = substr($current_path, 0, strpos(strtolower($current_path), "/class/xoopseditor/tinymce4/"));
8
-include_once $xoops_root_path . "/mainfile.php";
8
+include_once $xoops_root_path."/mainfile.php";
9 9
 
10 10
 $xoops = \Xoops::getInstance();
11 11
 $xoops->logger()->quiet();
12 12
 
13
-$chemin_array=parse_url(\XoopsBaseConfig::get('url'));
14
-$chemin_scheme =  $chemin_array["scheme"]; // http
15
-$chemin_host =  $chemin_array["host"]; // www.example.com  or // localhost
13
+$chemin_array = parse_url(\XoopsBaseConfig::get('url'));
14
+$chemin_scheme = $chemin_array["scheme"]; // http
15
+$chemin_host = $chemin_array["host"]; // www.example.com  or // localhost
16 16
 //  $chemin_path =  $chemin_array["path"]; // /myweb1
17 17
   if (!isset($chemin_array['path']))
18 18
     {
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     }
21 21
   else
22 22
     {
23
-      $chemin_path =  $chemin_array["path"];
23
+      $chemin_path = $chemin_array["path"];
24 24
     }
25 25
 // XOOPS
26 26
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 //XOOPS
30 30
 //session_start();
31
-if(!isset($_SESSION))
31
+if (!isset($_SESSION))
32 32
 {
33 33
 session_start();
34 34
 }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 //    |   |   |   |   |- plugin.min.js
55 55
 
56 56
 //$base_url="http://www.site.com";  // base url (only domain) of site (without final /). If you prefer relative urls leave empty
57
-$base_url=$chemin_scheme."://".$chemin_host;
57
+$base_url = $chemin_scheme."://".$chemin_host;
58 58
 
59 59
 //$upload_dir = '/source/'; // path from base_url to base of upload folder (with start and final /)
60 60
 
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 $MaxSizeUpload = 100; //Mb
73 73
 
74 74
 // SERVER OVERRIDE
75
-if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){
75
+if ((int)(ini_get('post_max_size')) < $MaxSizeUpload) {
76 76
 	$MaxSizeUpload = (int)(ini_get('post_max_size'));
77 77
 }
78 78
 
79 79
 $default_language 	= "en_EN"; //default language file name
80
-$icon_theme 		= "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
80
+$icon_theme = "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
81 81
 $show_folder_size 	= TRUE; //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
82 82
 $show_sorting_bar 	= TRUE; //Show or not show sorting feature in filemanager
83
-$loading_bar 		= TRUE; //Show or not show loading bar
84
-$transliteration 	= FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
83
+$loading_bar = TRUE; //Show or not show loading bar
84
+$transliteration = FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
85 85
 
86 86
 //*******************************************
87 87
 //Images limit and resizing configuration
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 $rename_folders	 = FALSE;
127 127
 $duplicate_files = FALSE;
128 128
 $copy_cut_files	 = FALSE; // for copy/cut files
129
-$copy_cut_dirs	 = FALSE; // for copy/cut directories
129
+$copy_cut_dirs = FALSE; // for copy/cut directories
130 130
 
131 131
 // XOOPS
132 132
 global $xoopsUser;
@@ -139,43 +139,43 @@  discard block
 block discarded – undo
139 139
 if ($xoopsUser) {
140 140
     $usergroups = $GLOBALS['xoopsUser']->getGroups();
141 141
     $result_upload = array_intersect($usergroups, $allowed_groups_upload);
142
-        if ($result_upload || $result_upload!=null) {
142
+        if ($result_upload || $result_upload != null) {
143 143
            $upload_files = TRUE;
144 144
         }
145 145
   $result_createfolder = array_intersect($usergroups, $allowed_groups_createfolder);
146
-       if ($result_createfolder || $result_createfolder!=null) {
146
+       if ($result_createfolder || $result_createfolder != null) {
147 147
           $create_folders = TRUE;
148 148
         }
149 149
 }
150 150
 // XOOPS
151 151
 // defines size limit for paste in MB / operation
152 152
 // set 'FALSE' for no limit
153
-$copy_cut_max_size	 = 100;
153
+$copy_cut_max_size = 100;
154 154
 // defines file count limit for paste / operation
155 155
 // set 'FALSE' for no limit
156
-$copy_cut_max_count	 = 200;
156
+$copy_cut_max_count = 200;
157 157
 //IF any of these limits reached, operation won't start and generate warning
158 158
 
159 159
 //**********************
160 160
 //Allowed extensions (lowercase insert)
161 161
 //**********************
162 162
 $ext_img = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'); //Images
163
-$ext_file = array('doc', 'docx','rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv','html','xhtml','psd','sql','log','fla','xml','ade','adp','mdb','accdb','ppt','pptx','odt','ots','ott','odb','odg','otp','otg','odf','ods','odp','css','ai'); //Files
164
-$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg','wma',"flv","webm"); //Video
165
-$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio
166
-$ext_misc = array('zip', 'rar','gz','tar','iso','dmg'); //Archives
163
+$ext_file = array('doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai'); //Files
164
+$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm"); //Video
165
+$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav'); //Audio
166
+$ext_misc = array('zip', 'rar', 'gz', 'tar', 'iso', 'dmg'); //Archives
167 167
 
168
-$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video,$ext_music); //allowed extensions
168
+$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video, $ext_music); //allowed extensions
169 169
 
170 170
 
171 171
 /******************
172 172
  * AVIARY config
173 173
 *******************/
174 174
 $aviary_active 	= TRUE;
175
-$aviary_key 	= "dvh8qudbp6yx2bnp";
176
-$aviary_secret	= "m6xaym5q42rpw433";
175
+$aviary_key = "dvh8qudbp6yx2bnp";
176
+$aviary_secret = "m6xaym5q42rpw433";
177 177
 $aviary_version	= 3;
178
-$aviary_language= 'en';
178
+$aviary_language = 'en';
179 179
 
180 180
 
181 181
 //The filter and sorter are managed through both javascript and php scripts because if you have a lot of
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 // path_from_filemanager/test/test1/
214 214
 // PS if there isn't write permission in your destination folder you must set it
215 215
 $fixed_image_creation                   = FALSE; //activate or not the creation of one or more image resized with fixed path from filemanager folder
216
-$fixed_path_from_filemanager            = array('../test/','../test1/'); //fixed path of the image folder from the current position on upload folder
217
-$fixed_image_creation_name_to_prepend   = array('','test_'); //name to prepend on filename
218
-$fixed_image_creation_to_append         = array('_test',''); //name to appendon filename
219
-$fixed_image_creation_width             = array(300,400); //width of image (you can leave empty if you set height)
220
-$fixed_image_creation_height            = array(200,''); //height of image (you can leave empty if you set width)
216
+$fixed_path_from_filemanager            = array('../test/', '../test1/'); //fixed path of the image folder from the current position on upload folder
217
+$fixed_image_creation_name_to_prepend   = array('', 'test_'); //name to prepend on filename
218
+$fixed_image_creation_to_append         = array('_test', ''); //name to appendon filename
219
+$fixed_image_creation_width             = array(300, 400); //width of image (you can leave empty if you set height)
220
+$fixed_image_creation_height            = array(200, ''); //height of image (you can leave empty if you set width)
221 221
 
222 222
 
223 223
 // New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode)
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 // just simply add a value in the array
226 226
 // The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here
227 227
 $relative_image_creation                = FALSE; //activate or not the creation of one or more image resized with relative path from upload folder
228
-$relative_path_from_current_pos         = array('thumb/','thumb/'); //relative path of the image folder from the current position on upload folder
229
-$relative_image_creation_name_to_prepend= array('','test_'); //name to prepend on filename
230
-$relative_image_creation_name_to_append = array('_test',''); //name to append on filename
231
-$relative_image_creation_width          = array(300,400); //width of image (you can leave empty if you set height)
232
-$relative_image_creation_height         = array(200,''); //height of image (you can leave empty if you set width)
228
+$relative_path_from_current_pos         = array('thumb/', 'thumb/'); //relative path of the image folder from the current position on upload folder
229
+$relative_image_creation_name_to_prepend = array('', 'test_'); //name to prepend on filename
230
+$relative_image_creation_name_to_append = array('_test', ''); //name to append on filename
231
+$relative_image_creation_width          = array(300, 400); //width of image (you can leave empty if you set height)
232
+$relative_image_creation_height         = array(200, ''); //height of image (you can leave empty if you set width)
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
   if (!isset($chemin_array['path']))
18 18
     {
19 19
       $chemin_path = '';
20
-    }
21
-  else
20
+    } else
22 21
     {
23 22
       $chemin_path =  $chemin_array["path"];
24 23
     }
Please login to merge, or discard this patch.
xoopseditor/tinymce4/external_plugins/filemanager/config/config.ref.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 
34 34
 // SERVER OVERRIDE
35 35
 if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){
36
-	$MaxSizeUpload = (int)(ini_get('post_max_size'));
36
+    $MaxSizeUpload = (int)(ini_get('post_max_size'));
37 37
 }
38 38
 
39 39
 $default_language 	= "en_EN"; //default language file name
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 //    |   |   |   |- responsivefilemanager
20 20
 //    |   |   |   |   |- plugin.min.js
21 21
 
22
-$base_url ="http://".$_SERVER['HTTP_HOST'];  // DON'T TOUCH (base url (only domain) of site (without final /)).
22
+$base_url = "http://".$_SERVER['HTTP_HOST']; // DON'T TOUCH (base url (only domain) of site (without final /)).
23 23
 $upload_dir = '/source/'; // path from base_url to base of upload folder (with start and final /)
24 24
 $current_path = '../source/'; // relative path from filemanager folder to upload folder (with final /)
25 25
 //thumbs folder can't put inside upload folder
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 $MaxSizeUpload = 100; //Mb
33 33
 
34 34
 // SERVER OVERRIDE
35
-if ((int)(ini_get('post_max_size')) < $MaxSizeUpload){
35
+if ((int)(ini_get('post_max_size')) < $MaxSizeUpload) {
36 36
 	$MaxSizeUpload = (int)(ini_get('post_max_size'));
37 37
 }
38 38
 
39 39
 $default_language 	= "en_EN"; //default language file name
40
-$icon_theme 		= "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
40
+$icon_theme = "ico"; //ico or ico_dark you can cusatomize just putting a folder inside filemanager/img
41 41
 $show_folder_size 	= TRUE; //Show or not show folder size in list view feature in filemanager (is possible, if there is a large folder, to greatly increase the calculations)
42 42
 $show_sorting_bar 	= TRUE; //Show or not show sorting feature in filemanager
43
-$loading_bar 		= TRUE; //Show or not show loading bar
44
-$transliteration 	= FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
43
+$loading_bar = TRUE; //Show or not show loading bar
44
+$transliteration = FALSE; //active or deactive the transliteration (mean convert all strange characters in A..Za..z0..9 characters)
45 45
 
46 46
 //*******************************************
47 47
 //Images limit and resizing configuration
@@ -86,36 +86,36 @@  discard block
 block discarded – undo
86 86
 $rename_folders	 = TRUE;
87 87
 $duplicate_files = TRUE;
88 88
 $copy_cut_files	 = TRUE; // for copy/cut files
89
-$copy_cut_dirs	 = TRUE; // for copy/cut directories
89
+$copy_cut_dirs = TRUE; // for copy/cut directories
90 90
 
91 91
 
92 92
 // defines size limit for paste in MB / operation
93 93
 // set 'FALSE' for no limit
94
-$copy_cut_max_size	 = 100;
94
+$copy_cut_max_size = 100;
95 95
 // defines file count limit for paste / operation
96 96
 // set 'FALSE' for no limit
97
-$copy_cut_max_count	 = 200;
97
+$copy_cut_max_count = 200;
98 98
 //IF any of these limits reached, operation won't start and generate warning
99 99
 
100 100
 //**********************
101 101
 //Allowed extensions (lowercase insert)
102 102
 //**********************
103 103
 $ext_img = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'); //Images
104
-$ext_file = array('doc', 'docx','rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv','html','xhtml','psd','sql','log','fla','xml','ade','adp','mdb','accdb','ppt','pptx','odt','ots','ott','odb','odg','otp','otg','odf','ods','odp','css','ai'); //Files
105
-$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg','wma',"flv","webm"); //Video 
106
-$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid','ogg','wav'); //Audio
107
-$ext_misc = array('zip', 'rar','gz','tar','iso','dmg'); //Archives
104
+$ext_file = array('doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai'); //Files
105
+$ext_video = array('mov', 'mpeg', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm"); //Video 
106
+$ext_music = array('mp3', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav'); //Audio
107
+$ext_misc = array('zip', 'rar', 'gz', 'tar', 'iso', 'dmg'); //Archives
108 108
 
109
-$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video,$ext_music); //allowed extensions
109
+$ext = array_merge($ext_img, $ext_file, $ext_misc, $ext_video, $ext_music); //allowed extensions
110 110
 
111 111
 /******************
112 112
  * AVIARY config
113 113
 *******************/
114 114
 $aviary_active 	= TRUE;
115
-$aviary_key 	= "dvh8qudbp6yx2bnp";
116
-$aviary_secret	= "m6xaym5q42rpw433";
115
+$aviary_key = "dvh8qudbp6yx2bnp";
116
+$aviary_secret = "m6xaym5q42rpw433";
117 117
 $aviary_version	= 3;
118
-$aviary_language= 'en';
118
+$aviary_language = 'en';
119 119
 
120 120
 
121 121
 //The filter and sorter are managed through both javascript and php scripts because if you have a lot of
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 // path_from_filemanager/test/test1/
151 151
 // PS if there isn't write permission in your destination folder you must set it
152 152
 $fixed_image_creation                   = FALSE; //activate or not the creation of one or more image resized with fixed path from filemanager folder
153
-$fixed_path_from_filemanager            = array('../test/','../test1/'); //fixed path of the image folder from the current position on upload folder
154
-$fixed_image_creation_name_to_prepend   = array('','test_'); //name to prepend on filename
155
-$fixed_image_creation_to_append         = array('_test',''); //name to appendon filename
156
-$fixed_image_creation_width             = array(300,400); //width of image (you can leave empty if you set height)
157
-$fixed_image_creation_height            = array(200,''); //height of image (you can leave empty if you set width)
153
+$fixed_path_from_filemanager            = array('../test/', '../test1/'); //fixed path of the image folder from the current position on upload folder
154
+$fixed_image_creation_name_to_prepend   = array('', 'test_'); //name to prepend on filename
155
+$fixed_image_creation_to_append         = array('_test', ''); //name to appendon filename
156
+$fixed_image_creation_width             = array(300, 400); //width of image (you can leave empty if you set height)
157
+$fixed_image_creation_height            = array(200, ''); //height of image (you can leave empty if you set width)
158 158
 
159 159
 
160 160
 // New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode)
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
 // just simply add a value in the array
163 163
 // The image creation path is always relative so if i'm inside source/test/test1 and I upload an image, the path start from here
164 164
 $relative_image_creation                = FALSE; //activate or not the creation of one or more image resized with relative path from upload folder
165
-$relative_path_from_current_pos         = array('thumb/','thumb/'); //relative path of the image folder from the current position on upload folder
166
-$relative_image_creation_name_to_prepend= array('','test_'); //name to prepend on filename
167
-$relative_image_creation_name_to_append = array('_test',''); //name to append on filename
168
-$relative_image_creation_width          = array(300,400); //width of image (you can leave empty if you set height)
169
-$relative_image_creation_height         = array(200,''); //height of image (you can leave empty if you set width)
165
+$relative_path_from_current_pos         = array('thumb/', 'thumb/'); //relative path of the image folder from the current position on upload folder
166
+$relative_image_creation_name_to_prepend = array('', 'test_'); //name to prepend on filename
167
+$relative_image_creation_name_to_append = array('_test', ''); //name to append on filename
168
+$relative_image_creation_width          = array(300, 400); //width of image (you can leave empty if you set height)
169
+$relative_image_creation_height         = array(200, ''); //height of image (you can leave empty if you set width)
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/force_download.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,28 +1,28 @@
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
3
+if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
4 4
 include('include/utils.php');
5 5
 
6
-if(strpos($_POST['path'],'/')===0
7
-    || strpos($_POST['path'],'../')!==FALSE
8
-    || strpos($_POST['path'],'./')===0)
6
+if (strpos($_POST['path'], '/') === 0
7
+    || strpos($_POST['path'], '../') !== FALSE
8
+    || strpos($_POST['path'], './') === 0)
9 9
     die('wrong path');
10 10
 
11
-if(strpos($_POST['name'],'/')!==FALSE)
11
+if (strpos($_POST['name'], '/') !== FALSE)
12 12
     die('wrong path');
13 13
 
14
-$path=$current_path.$_POST['path'];
15
-$name=$_POST['name'];
14
+$path = $current_path.$_POST['path'];
15
+$name = $_POST['name'];
16 16
 
17
-$info=pathinfo($name);
18
-if(!in_array(fix_strtolower($info['extension']), $ext)){
17
+$info = pathinfo($name);
18
+if (!in_array(fix_strtolower($info['extension']), $ext)) {
19 19
     die('wrong extension');
20 20
 }
21 21
 
22 22
 header('Pragma: private');
23 23
 header('Cache-control: private, must-revalidate');
24 24
 header("Content-Type: application/octet-stream");
25
-header("Content-Length: " .(string)(filesize($path.$name)) );
25
+header("Content-Length: ".(string)(filesize($path.$name)));
26 26
 header('Content-Disposition: attachment; filename="'.($name).'"');
27 27
 readfile($path.$name);
28 28
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,15 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
3
+if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") {
4
+    die('forbiden');
5
+}
4 6
 include('include/utils.php');
5 7
 
6 8
 if(strpos($_POST['path'],'/')===0
7 9
     || strpos($_POST['path'],'../')!==FALSE
8
-    || strpos($_POST['path'],'./')===0)
10
+    || strpos($_POST['path'],'./')===0) {
9 11
     die('wrong path');
12
+}
10 13
 
11
-if(strpos($_POST['name'],'/')!==FALSE)
14
+if(strpos($_POST['name'],'/')!==FALSE) {
12 15
     die('wrong path');
16
+}
13 17
 
14 18
 $path=$current_path.$_POST['path'];
15 19
 $name=$_POST['name'];
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/external_plugins/filemanager/execute.php 3 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
     
40 40
     if (file_exists($path."config.php"))
41 41
     {
42
-	   require_once($path."config.php");
43
-	   $cycle = FALSE;
42
+        require_once($path."config.php");
43
+        $cycle = FALSE;
44 44
     }
45 45
     $path = fix_dirname($path)."/";
46 46
     $cycle = FALSE;
@@ -69,54 +69,54 @@  discard block
 block discarded – undo
69 69
                 unlink($path);
70 70
                 if (file_exists($path_thumb)) unlink($path_thumb);
71 71
 		    
72
-        		$info=pathinfo($path);
73
-        		if ($relative_image_creation){
74
-        		    foreach($relative_path_from_current_pos as $k=>$path)
72
+                $info=pathinfo($path);
73
+                if ($relative_image_creation){
74
+                    foreach($relative_path_from_current_pos as $k=>$path)
75 75
                     {
76 76
                         if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/";
77 77
 
78
-            			if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
78
+                        if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
79 79
                         {
80
-            			    unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']);
81
-            			}
82
-        		    }
83
-        		}
80
+                            unlink($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']);
81
+                        }
82
+                    }
83
+                }
84 84
         		
85
-        		if ($fixed_image_creation)
85
+                if ($fixed_image_creation)
86 86
                 {
87
-        		    foreach($fixed_path_from_filemanager as $k=>$path)
87
+                    foreach($fixed_path_from_filemanager as $k=>$path)
88 88
                     {
89
-            			if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/";
89
+                        if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/";
90 90
 
91
-            			$base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
92
-            			if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
91
+                        $base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
92
+                        if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
93 93
                         {
94
-            			    unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
95
-            			}
96
-        		    }
97
-        		}
94
+                            unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
95
+                        }
96
+                    }
97
+                }
98 98
             }
99 99
             break;
100 100
         case 'delete_folder':
101 101
             if ($delete_folders){
102
-        		if (is_dir($path_thumb))
102
+                if (is_dir($path_thumb))
103 103
                 {
104
-        		    deleteDir($path_thumb);
104
+                    deleteDir($path_thumb);
105 105
                 }
106 106
 
107
-        		if (is_dir($path))
107
+                if (is_dir($path))
108 108
                 {
109
-        		    deleteDir($path);	
110
-        		    if ($fixed_image_creation)
109
+                    deleteDir($path);	
110
+                    if ($fixed_image_creation)
111 111
                     {
112
-            			foreach($fixed_path_from_filemanager as $k=>$paths){
113
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
112
+                        foreach($fixed_path_from_filemanager as $k=>$paths){
113
+                            if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
114 114
 
115
-            			    $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
116
-            			    if (is_dir($base_dir)) deleteDir($base_dir);
117
-            			}
118
-        		    }
119
-        		}
115
+                            $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
116
+                            if (is_dir($base_dir)) deleteDir($base_dir);
117
+                        }
118
+                    }
119
+                }
120 120
             }
121 121
             break;
122 122
         case 'create_folder':
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
                     if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder);
135 135
 
136 136
                     rename_folder($path_thumb,$name,$transliteration);
137
-        		    if ($fixed_image_creation){
138
-            			foreach($fixed_path_from_filemanager as $k=>$paths){
139
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
137
+                    if ($fixed_image_creation){
138
+                        foreach($fixed_path_from_filemanager as $k=>$paths){
139
+                            if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
140 140
             			    
141 141
                             $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
142
-            			    rename_folder($base_dir,$name,$transliteration);
143
-            			}
144
-		           }
142
+                            rename_folder($base_dir,$name,$transliteration);
143
+                        }
144
+                    }
145 145
                 }
146 146
                 else {
147 147
                     die(lang_Empty_name);
@@ -157,28 +157,28 @@  discard block
 block discarded – undo
157 157
 
158 158
                     rename_file($path_thumb,$name,$transliteration);
159 159
 
160
-        		    if ($fixed_image_creation)
160
+                    if ($fixed_image_creation)
161 161
                     {
162 162
                         $info=pathinfo($path);
163 163
 
164
-            			foreach($fixed_path_from_filemanager as $k=>$paths)
164
+                        foreach($fixed_path_from_filemanager as $k=>$paths)
165 165
                         {
166
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
166
+                            if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
167 167
 
168
-            			    $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
169
-            			    if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
168
+                            $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
169
+                            if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
170 170
                             {
171
-            				    rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration);
172
-            			    }
173
-            			}
174
-        		    }
171
+                                rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration);
172
+                            }
173
+                        }
174
+                    }
175 175
                 }
176 176
                 else {
177 177
                     die(lang_Empty_name);
178 178
                 }
179 179
             }
180 180
             break;
181
-	   case 'duplicate_file':
181
+        case 'duplicate_file':
182 182
             if ($duplicate_files)
183 183
             {
184 184
                 $name = fix_filename($name,$transliteration);
@@ -191,18 +191,18 @@  discard block
 block discarded – undo
191 191
                     if ($fixed_image_creation)
192 192
                     {
193 193
                         $info=pathinfo($path);
194
-            			foreach($fixed_path_from_filemanager as $k=>$paths)
194
+                        foreach($fixed_path_from_filemanager as $k=>$paths)
195 195
                         {
196
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/";
196
+                            if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/";
197 197
 
198
-            			    $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
198
+                            $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
199 199
 
200
-            			    if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
200
+                            if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
201 201
                             {
202
-            				duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
203
-            			    }
204
-            			}
205
-        		    }
202
+                            duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
203
+                            }
204
+                        }
205
+                    }
206 206
                 }
207 207
                 else
208 208
                 {
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -4,24 +4,24 @@  discard block
 block discarded – undo
4 4
 include('include/utils.php');
5 5
 
6 6
 
7
-$thumb_pos  = strpos($_POST['path_thumb'], $thumbs_base_path);
7
+$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path);
8 8
 
9
-if ($thumb_pos !=0
10
-    || strpos($_POST['path_thumb'],'../',strlen($thumbs_base_path)+$thumb_pos)!==FALSE
11
-    || strpos($_POST['path'],'/')===0
12
-    || strpos($_POST['path'],'../')!==FALSE
13
-    || strpos($_POST['path'],'./')===0)
9
+if ($thumb_pos != 0
10
+    || strpos($_POST['path_thumb'], '../', strlen($thumbs_base_path) + $thumb_pos) !== FALSE
11
+    || strpos($_POST['path'], '/') === 0
12
+    || strpos($_POST['path'], '../') !== FALSE
13
+    || strpos($_POST['path'], './') === 0)
14 14
 {
15 15
     die('wrong path');
16 16
 }
17 17
 
18 18
 $language_file = 'lang/en_EN.php'; 
19
-if (isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang']!='')
19
+if (isset($_GET['lang']) && $_GET['lang'] !== 'undefined' && $_GET['lang'] != '')
20 20
 {
21 21
     $path_parts = pathinfo($_GET['lang']);
22
-    if (is_readable('lang/' .$path_parts['basename']. '.php'))
22
+    if (is_readable('lang/'.$path_parts['basename'].'.php'))
23 23
     { 
24
-        $language_file = 'lang/' .$path_parts['basename']. '.php';
24
+        $language_file = 'lang/'.$path_parts['basename'].'.php';
25 25
     }
26 26
 }
27 27
 
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 $cycle = TRUE;
33 33
 $max_cycles = 50;
34 34
 $i = 0;
35
-while($cycle && $i<$max_cycles)
35
+while ($cycle && $i < $max_cycles)
36 36
 {
37 37
     $i++;
38
-    if ($path == $base)  $cycle=FALSE;
38
+    if ($path == $base)  $cycle = FALSE;
39 39
     
40 40
     if (file_exists($path."config.php"))
41 41
     {
@@ -51,29 +51,29 @@  discard block
 block discarded – undo
51 51
 if (isset($_POST['name']))
52 52
 {
53 53
     $name = $_POST['name'];
54
-    if (strpos($name,'../') !== FALSE) die('wrong name');
54
+    if (strpos($name, '../') !== FALSE) die('wrong name');
55 55
 }
56 56
 
57 57
 $info = pathinfo($path);
58
-if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']==='delete_folder') && !in_array(strtolower($info['extension']), $ext))
58
+if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action'] === 'delete_folder') && !in_array(strtolower($info['extension']), $ext))
59 59
 {
60 60
     die('wrong extension');
61 61
 }
62 62
     
63 63
 if (isset($_GET['action']))
64 64
 {
65
-    switch($_GET['action'])
65
+    switch ($_GET['action'])
66 66
     {
67 67
         case 'delete_file':
68
-            if ($delete_files){
68
+            if ($delete_files) {
69 69
                 unlink($path);
70 70
                 if (file_exists($path_thumb)) unlink($path_thumb);
71 71
 		    
72
-        		$info=pathinfo($path);
73
-        		if ($relative_image_creation){
74
-        		    foreach($relative_path_from_current_pos as $k=>$path)
72
+        		$info = pathinfo($path);
73
+        		if ($relative_image_creation) {
74
+        		    foreach ($relative_path_from_current_pos as $k=>$path)
75 75
                     {
76
-                        if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/";
76
+                        if ($path != "" && $path[strlen($path) - 1] !== "/") $path .= "/";
77 77
 
78 78
             			if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
79 79
                         {
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
         		
85 85
         		if ($fixed_image_creation)
86 86
                 {
87
-        		    foreach($fixed_path_from_filemanager as $k=>$path)
87
+        		    foreach ($fixed_path_from_filemanager as $k=>$path)
88 88
                     {
89
-            			if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/";
89
+            			if ($path != "" && $path[strlen($path) - 1] !== "/") $path .= "/";
90 90
 
91
-            			$base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
91
+            			$base_dir = $path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
92 92
             			if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
93 93
                         {
94 94
             			    unlink($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             }
99 99
             break;
100 100
         case 'delete_folder':
101
-            if ($delete_folders){
101
+            if ($delete_folders) {
102 102
         		if (is_dir($path_thumb))
103 103
                 {
104 104
         		    deleteDir($path_thumb);
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
         		    deleteDir($path);	
110 110
         		    if ($fixed_image_creation)
111 111
                     {
112
-            			foreach($fixed_path_from_filemanager as $k=>$paths){
113
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
112
+            			foreach ($fixed_path_from_filemanager as $k=>$paths) {
113
+            			    if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/";
114 114
 
115
-            			    $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
115
+            			    $base_dir = $paths.substr_replace($path, '', 0, strlen($current_path));
116 116
             			    if (is_dir($base_dir)) deleteDir($base_dir);
117 117
             			}
118 118
         		    }
@@ -122,24 +122,24 @@  discard block
 block discarded – undo
122 122
         case 'create_folder':
123 123
             if ($create_folders)
124 124
             {
125
-                create_folder(fix_path($path,$transliteration),fix_path($path_thumb,$transliteration));
125
+                create_folder(fix_path($path, $transliteration), fix_path($path_thumb, $transliteration));
126 126
             }
127 127
             break;
128 128
         case 'rename_folder':
129
-            if ($rename_folders){
130
-                $name=fix_filename($name,$transliteration);
131
-                $name=str_replace('.','',$name);
129
+            if ($rename_folders) {
130
+                $name = fix_filename($name, $transliteration);
131
+                $name = str_replace('.', '', $name);
132 132
 		
133
-                if (!empty($name)){
134
-                    if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder);
133
+                if (!empty($name)) {
134
+                    if (!rename_folder($path, $name, $transliteration)) die(lang_Rename_existing_folder);
135 135
 
136
-                    rename_folder($path_thumb,$name,$transliteration);
137
-        		    if ($fixed_image_creation){
138
-            			foreach($fixed_path_from_filemanager as $k=>$paths){
139
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
136
+                    rename_folder($path_thumb, $name, $transliteration);
137
+        		    if ($fixed_image_creation) {
138
+            			foreach ($fixed_path_from_filemanager as $k=>$paths) {
139
+            			    if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/";
140 140
             			    
141
-                            $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
142
-            			    rename_folder($base_dir,$name,$transliteration);
141
+                            $base_dir = $paths.substr_replace($path, '', 0, strlen($current_path));
142
+            			    rename_folder($base_dir, $name, $transliteration);
143 143
             			}
144 144
 		           }
145 145
                 }
@@ -149,26 +149,26 @@  discard block
 block discarded – undo
149 149
             }
150 150
             break;
151 151
         case 'rename_file':
152
-            if ($rename_files){
153
-                $name=fix_filename($name,$transliteration);
152
+            if ($rename_files) {
153
+                $name = fix_filename($name, $transliteration);
154 154
                 if (!empty($name))
155 155
                 {
156
-                    if (!rename_file($path,$name,$transliteration)) die(lang_Rename_existing_file);
156
+                    if (!rename_file($path, $name, $transliteration)) die(lang_Rename_existing_file);
157 157
 
158
-                    rename_file($path_thumb,$name,$transliteration);
158
+                    rename_file($path_thumb, $name, $transliteration);
159 159
 
160 160
         		    if ($fixed_image_creation)
161 161
                     {
162
-                        $info=pathinfo($path);
162
+                        $info = pathinfo($path);
163 163
 
164
-            			foreach($fixed_path_from_filemanager as $k=>$paths)
164
+            			foreach ($fixed_path_from_filemanager as $k=>$paths)
165 165
                         {
166
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
166
+            			    if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/";
167 167
 
168 168
             			    $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
169 169
             			    if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
170 170
                             {
171
-            				    rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k],$transliteration);
171
+            				    rename_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k], $transliteration);
172 172
             			    }
173 173
             			}
174 174
         		    }
@@ -181,25 +181,25 @@  discard block
 block discarded – undo
181 181
 	   case 'duplicate_file':
182 182
             if ($duplicate_files)
183 183
             {
184
-                $name = fix_filename($name,$transliteration);
184
+                $name = fix_filename($name, $transliteration);
185 185
                 if (!empty($name))
186 186
                 {
187
-                    if (!duplicate_file($path,$name)) die(lang_Rename_existing_file);
187
+                    if (!duplicate_file($path, $name)) die(lang_Rename_existing_file);
188 188
                     
189
-                    duplicate_file($path_thumb,$name);
189
+                    duplicate_file($path_thumb, $name);
190 190
         		    
191 191
                     if ($fixed_image_creation)
192 192
                     {
193
-                        $info=pathinfo($path);
194
-            			foreach($fixed_path_from_filemanager as $k=>$paths)
193
+                        $info = pathinfo($path);
194
+            			foreach ($fixed_path_from_filemanager as $k=>$paths)
195 195
                         {
196
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/";
196
+            			    if ($paths != "" && $paths[strlen($paths) - 1] !== "/") $paths .= "/";
197 197
 
198
-            			    $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
198
+            			    $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
199 199
 
200 200
             			    if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
201 201
                             {
202
-            				duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'],$fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
202
+            				duplicate_file($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension'], $fixed_image_creation_name_to_prepend[$k].$name.$fixed_image_creation_to_append[$k]);
203 203
             			    }
204 204
             			}
205 205
         		    }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             }
212 212
             break;
213 213
         case 'paste_clipboard':
214
-            if ( ! isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'], $_SESSION['RF']['clipboard']['path_thumb']) 
214
+            if (!isset($_SESSION['RF']['clipboard_action'], $_SESSION['RF']['clipboard']['path'], $_SESSION['RF']['clipboard']['path_thumb']) 
215 215
                 || $_SESSION['RF']['clipboard_action'] == '' 
216 216
                 || $_SESSION['RF']['clipboard']['path'] == ''
217 217
                 || $_SESSION['RF']['clipboard']['path_thumb'] == '')
@@ -230,22 +230,22 @@  discard block
 block discarded – undo
230 230
             }
231 231
 
232 232
             // user wants to paste folder to it's own sub folder.. baaaah.
233
-            if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE){
233
+            if (is_dir($data['path']) && strpos($path, $data['path']) !== FALSE) {
234 234
                 die();
235 235
             } 
236 236
 
237 237
             // something terribly gone wrong
238
-            if ($action !== 'copy' && $action !== 'cut'){
238
+            if ($action !== 'copy' && $action !== 'cut') {
239 239
                 die('no action');
240 240
             }
241 241
 
242 242
             // check for writability
243
-            if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE){
243
+            if (is_really_writable($path) === FALSE || is_really_writable($path_thumb) === FALSE) {
244 244
                 die($path.'--'.$path_thumb.'--'.lang_Dir_No_Write);
245 245
             }
246 246
 
247 247
             // check if server disables copy or rename
248
-            if (is_function_callable(($action === 'copy' ? 'copy' : 'rename')) === FALSE){
248
+            if (is_function_callable(($action === 'copy' ? 'copy' : 'rename')) === FALSE) {
249 249
                 die(sprintf(lang_Function_Disabled, ($action === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut))));
250 250
             }
251 251
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 rrename($data['path_thumb'], $path_thumb);
261 261
 
262 262
                 // cleanup
263
-                if (is_dir($data['path']) === TRUE){
263
+                if (is_dir($data['path']) === TRUE) {
264 264
                     rrename_after_cleaner($data['path']);
265 265
                     rrename_after_cleaner($data['path_thumb']);
266 266
                 }
Please login to merge, or discard this patch.
Braces   +47 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3
-if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
3
+if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") {
4
+    die('forbiden');
5
+}
4 6
 include('include/utils.php');
5 7
 
6 8
 
@@ -35,7 +37,9 @@  discard block
 block discarded – undo
35 37
 while($cycle && $i<$max_cycles)
36 38
 {
37 39
     $i++;
38
-    if ($path == $base)  $cycle=FALSE;
40
+    if ($path == $base) {
41
+        $cycle=FALSE;
42
+    }
39 43
     
40 44
     if (file_exists($path."config.php"))
41 45
     {
@@ -51,8 +55,10 @@  discard block
 block discarded – undo
51 55
 if (isset($_POST['name']))
52 56
 {
53 57
     $name = $_POST['name'];
54
-    if (strpos($name,'../') !== FALSE) die('wrong name');
55
-}
58
+    if (strpos($name,'../') !== FALSE) {
59
+        die('wrong name');
60
+    }
61
+    }
56 62
 
57 63
 $info = pathinfo($path);
58 64
 if (isset($info['extension']) && !(isset($_GET['action']) && $_GET['action']==='delete_folder') && !in_array(strtolower($info['extension']), $ext))
@@ -67,13 +73,17 @@  discard block
 block discarded – undo
67 73
         case 'delete_file':
68 74
             if ($delete_files){
69 75
                 unlink($path);
70
-                if (file_exists($path_thumb)) unlink($path_thumb);
76
+                if (file_exists($path_thumb)) {
77
+                    unlink($path_thumb);
78
+                }
71 79
 		    
72 80
         		$info=pathinfo($path);
73 81
         		if ($relative_image_creation){
74 82
         		    foreach($relative_path_from_current_pos as $k=>$path)
75 83
                     {
76
-                        if ($path!="" && $path[strlen($path)-1]!=="/") $path.="/";
84
+                        if ($path!="" && $path[strlen($path)-1]!=="/") {
85
+                            $path.="/";
86
+                        }
77 87
 
78 88
             			if (file_exists($info['dirname']."/".$path.$relative_image_creation_name_to_prepend[$k].$info['filename'].$relative_image_creation_name_to_append[$k].".".$info['extension']))
79 89
                         {
@@ -86,7 +96,9 @@  discard block
 block discarded – undo
86 96
                 {
87 97
         		    foreach($fixed_path_from_filemanager as $k=>$path)
88 98
                     {
89
-            			if ($path!="" && $path[strlen($path)-1] !== "/") $path.="/";
99
+            			if ($path!="" && $path[strlen($path)-1] !== "/") {
100
+            			    $path.="/";
101
+            			}
90 102
 
91 103
             			$base_dir=$path.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
92 104
             			if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
@@ -110,10 +122,14 @@  discard block
 block discarded – undo
110 122
         		    if ($fixed_image_creation)
111 123
                     {
112 124
             			foreach($fixed_path_from_filemanager as $k=>$paths){
113
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
125
+            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") {
126
+            			        $paths.="/";
127
+            			    }
114 128
 
115 129
             			    $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
116
-            			    if (is_dir($base_dir)) deleteDir($base_dir);
130
+            			    if (is_dir($base_dir)) {
131
+            			        deleteDir($base_dir);
132
+            			    }
117 133
             			}
118 134
         		    }
119 135
         		}
@@ -131,19 +147,22 @@  discard block
 block discarded – undo
131 147
                 $name=str_replace('.','',$name);
132 148
 		
133 149
                 if (!empty($name)){
134
-                    if (!rename_folder($path,$name,$transliteration)) die(lang_Rename_existing_folder);
150
+                    if (!rename_folder($path,$name,$transliteration)) {
151
+                        die(lang_Rename_existing_folder);
152
+                    }
135 153
 
136 154
                     rename_folder($path_thumb,$name,$transliteration);
137 155
         		    if ($fixed_image_creation){
138 156
             			foreach($fixed_path_from_filemanager as $k=>$paths){
139
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
157
+            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") {
158
+            			        $paths.="/";
159
+            			    }
140 160
             			    
141 161
                             $base_dir=$paths.substr_replace($path, '', 0, strlen($current_path));
142 162
             			    rename_folder($base_dir,$name,$transliteration);
143 163
             			}
144 164
 		           }
145
-                }
146
-                else {
165
+                } else {
147 166
                     die(lang_Empty_name);
148 167
                 }
149 168
             }
@@ -153,7 +172,9 @@  discard block
 block discarded – undo
153 172
                 $name=fix_filename($name,$transliteration);
154 173
                 if (!empty($name))
155 174
                 {
156
-                    if (!rename_file($path,$name,$transliteration)) die(lang_Rename_existing_file);
175
+                    if (!rename_file($path,$name,$transliteration)) {
176
+                        die(lang_Rename_existing_file);
177
+                    }
157 178
 
158 179
                     rename_file($path_thumb,$name,$transliteration);
159 180
 
@@ -163,7 +184,9 @@  discard block
 block discarded – undo
163 184
 
164 185
             			foreach($fixed_path_from_filemanager as $k=>$paths)
165 186
                         {
166
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.="/";
187
+            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") {
188
+            			        $paths.="/";
189
+            			    }
167 190
 
168 191
             			    $base_dir = $paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
169 192
             			    if (file_exists($base_dir.$fixed_image_creation_name_to_prepend[$k].$info['filename'].$fixed_image_creation_to_append[$k].".".$info['extension']))
@@ -172,8 +195,7 @@  discard block
 block discarded – undo
172 195
             			    }
173 196
             			}
174 197
         		    }
175
-                }
176
-                else {
198
+                } else {
177 199
                     die(lang_Empty_name);
178 200
                 }
179 201
             }
@@ -184,7 +206,9 @@  discard block
 block discarded – undo
184 206
                 $name = fix_filename($name,$transliteration);
185 207
                 if (!empty($name))
186 208
                 {
187
-                    if (!duplicate_file($path,$name)) die(lang_Rename_existing_file);
209
+                    if (!duplicate_file($path,$name)) {
210
+                        die(lang_Rename_existing_file);
211
+                    }
188 212
                     
189 213
                     duplicate_file($path_thumb,$name);
190 214
         		    
@@ -193,7 +217,9 @@  discard block
 block discarded – undo
193 217
                         $info=pathinfo($path);
194 218
             			foreach($fixed_path_from_filemanager as $k=>$paths)
195 219
                         {
196
-            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") $paths.= "/";
220
+            			    if ($paths!="" && $paths[strlen($paths)-1] !== "/") {
221
+            			        $paths.= "/";
222
+            			    }
197 223
 
198 224
             			    $base_dir=$paths.substr_replace($info['dirname']."/", '', 0, strlen($current_path));
199 225
 
@@ -203,8 +229,7 @@  discard block
 block discarded – undo
203 229
             			    }
204 230
             			}
205 231
         		    }
206
-                }
207
-                else
232
+                } else
208 233
                 {
209 234
                     die(lang_Empty_name);
210 235
                 }
@@ -253,8 +278,7 @@  discard block
 block discarded – undo
253 278
             {
254 279
                 rcopy($data['path'], $path);
255 280
                 rcopy($data['path_thumb'], $path_thumb);
256
-            }
257
-            elseif ($action === 'cut')
281
+            } elseif ($action === 'cut')
258 282
             {
259 283
                 rrename($data['path'], $path);
260 284
                 rrename($data['path_thumb'], $path_thumb);
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/editor_registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license             GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Taiwen Jiang <[email protected]>
 * @version         $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $
 */

return $config = array(
        "name"      =>  "tinymce4",
        "class"     =>  "XoopsFormTinymce4",
        "file"      =>  \XoopsBaseConfig::get('root-path') . "/class/xoopseditor/tinymce4/formtinymce.php",
        "title"     =>  _XOOPS_EDITOR_TINYMCE4,
        "order"     =>  5,
        "nohtml"    =>  0
    );
2 1
\ No newline at end of file
2
+<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license             GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Taiwen Jiang <[email protected]>
 * @version         $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $
 */

return $config = array("name"      =>  "tinymce4", "class"     =>  "XoopsFormTinymce4", "file"      =>  \XoopsBaseConfig::get('root-path')."/class/xoopseditor/tinymce4/formtinymce.php", "title"     =>  _XOOPS_EDITOR_TINYMCE4, "order"     =>  5, "nohtml"    =>  0);
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsimagemanager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
  */
16 16
 
17 17
 // check categories readability by group
18
-$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS );
19
-$imgcat_handler =& xoops_getHandler('imagecategory');
18
+$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS);
19
+$imgcat_handler = & xoops_getHandler('imagecategory');
20 20
 if (count($imgcat_handler->getList($groups, 'imgcat_read', 1)) == 0) {
21 21
     return false;
22 22
 }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsmlcontent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $
 */

// Xlanguage
if ( $GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG") ) {
    return true;
}

// Easiest Multi-Language Hack (EMLH)
if ( defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES') ) {
    return true;
}

return false;
2 1
\ No newline at end of file
2
+<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $
 */

// Xlanguage
if ($GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG")) {
    return true; }

// Easiest Multi-Language Hack (EMLH)
if (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) {
    return true; }

return false;
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsemotions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php
/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $
 */

include_once \XoopsBaseConfig::get('root-path') . "/modules/system/constants.php";
// Add your code here to check acces by groups
return true;
2 1
\ No newline at end of file
2
+<?php
/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $
 */

include_once \XoopsBaseConfig::get('root-path')."/modules/system/constants.php"; // Add your code here to check acces by groups
return true;
3 3
\ No newline at end of file
Please login to merge, or discard this patch.