@ -44,13 +44,16 @@ include 'include/utils.php';
$subdir_path = '';
if (isset($_GET['fldr']) & & !empty($_GET['fldr'])) {
$subdir_path = rawurldecode(trim(strip_tags($_GET['fldr']),"/"));
}elseif(isset($_SESSION['RF']['fldr']) & & !empty($_SESSION['RF']['fldr'])){
$subdir_path = rawurldecode(trim(strip_tags($_SESSION['RF']['fldr']),"/"));
}
if (strpos($subdir_path,'../') === FALSE
& & strpos($subdir_path,'./') === FALSE
& & strpos($subdir_path,'..\\') === FALSE
& & strpos($subdir_path,'.\\') === FALSE)
{
$subdir = $subdir_path ."/";
$subdir = strip_tags($subdir_path) ."/";
$_SESSION['RF']['fldr'] = $subdir_path;
$_SESSION['RF']["filter"]='';
}
else { $subdir = ''; }
@ -143,7 +146,19 @@ if(!$ftp){
if (!is_dir($thumbs_path.$subdir))
{
create_folder(FALSE, $thumbs_path.$subdir);
create_folder(FALSE, $thumbs_path.$subdir,$ftp,$config);
}
}
$multiple=null;
if (isset($_GET['multiple'])){
if($_GET['multiple'] == 1){
$multiple = 1;
$config['multiple_selection'] = true;
$config['multiple_selection_action_button'] = true;
}elseif($_GET['multiple'] == 0){
$multiple = 0;
$config['multiple_selection'] = false;
$config['multiple_selection_action_button'] = false;
}
}
if (isset($_GET['callback']))
@ -253,22 +268,27 @@ if (isset($_GET['editor']))
$editor = strip_tags($_GET['editor']);
} else {
if($_GET['type']==0){
$editor=false ;
$editor=null ;
} else {
$editor='tinymce';
}
}
if (!isset($_GET['field_id'])) $_GET['field_id'] = '';
$field_id = isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : '';
$field_id = isset($_GET['field_id']) ? fix_get_params($_GET['field_id']) : null;
$type_param = fix_get_params($_GET['type']);
if ($type_param==1) $apply = 'apply_img';
elseif($type_param==2) $apply = 'apply_link';
elseif($type_param==0 & & $_GET['field_id']=='') $apply = 'apply_none';
elseif($type_param==3) $apply = 'apply_video';
else $apply = 'apply';
$apply = null;
if($multiple){
$apply = 'apply_multiple';
}
if ($type_param==1) $apply_type = 'apply_img';
elseif($type_param==2) $apply_type = 'apply_link';
elseif($type_param==0 & & !$field_id) $apply_type = 'apply_none';
elseif($type_param==3) $apply_type = 'apply_video';
else $apply_type = 'apply';
if(!$apply){
$apply = $apply_type;
}
$get_params = array(
'editor' => $editor,
@ -278,6 +298,7 @@ $get_params = array(
'crossdomain' => $crossdomain,
'extensions' => ($extensions) ? urlencode(json_encode($extensions)) : null ,
'field_id' => $field_id,
'multiple' => $multiple,
'relative_url' => $return_relative_url,
'akey' => (isset($_GET['akey']) & & $_GET['akey'] != '' ? $_GET['akey'] : 'key')
);
@ -334,7 +355,6 @@ $get_params = http_build_query($get_params);
< script >
var ext_img=new Array('<?php echo implode ( "','" , $ext_img ) ?> ');
var allowed_ext=new Array('<?php echo implode ( "','" , $ext ) ?> ');
var image_editor=<?php echo $aviary_active ? "true" : "false" ; ?> ;
if (image_editor) {
var featherEditor = new Aviary.Feather({
@ -408,11 +428,13 @@ $get_params = http_build_query($get_params);
< input type = "hidden" id = "view" value = " <?php echo $view ; ?> " />
< input type = "hidden" id = "subdir" value = " <?php echo $subdir ; ?> " />
< input type = "hidden" id = "field_id" value = " <?php echo $field_id ; ?> " />
< input type = "hidden" id = "multiple" value = " <?php echo $multiple ; ?> " />
< input type = "hidden" id = "type_param" value = " <?php echo $type_param ; ?> " />
< input type = "hidden" id = "upload_dir" value = " <?php echo $upload_dir ; ?> " />
< input type = "hidden" id = "cur_dir" value = " <?php echo $cur_dir ; ?> " />
< input type = "hidden" id = "cur_dir_thumb" value = " <?php echo $thumbs_path . $subdir ; ?> " />
< input type = "hidden" id = "insert_folder_name" value = " <?php echo trans ( 'Insert_Folder_Name' ); ?> " />
< input type = "hidden" id = "rename_existing_folder" value = " <?php echo trans ( 'Rename_existing_folder' ); ?> " />
< input type = "hidden" id = "new_folder" value = " <?php echo trans ( 'New_Folder' ); ?> " />
< input type = "hidden" id = "ok" value = " <?php echo trans ( 'OK' ); ?> " />
< input type = "hidden" id = "cancel" value = " <?php echo trans ( 'Cancel' ); ?> " />
@ -429,8 +451,8 @@ $get_params = http_build_query($get_params);
< input type = "hidden" id = "descending" value = " <?php echo $descending ? 1 : 0 ; ?> " />
< input type = "hidden" id = "current_url" value = " <?php echo str_replace ( array ( '&filter=' . $filter , '&sort_by=' . $sort_by , '&descending=' . intval ( $descending )), array ( '' ), $base_url . $_SERVER [ 'REQUEST_URI' ]); ?> " />
< input type = "hidden" id = "lang_show_url" value = " <?php echo trans ( 'Show_url' ); ?> " />
< input type = "hidden" id = "copy_cut_files_allowed" value = " <?php if ( $co py_cut_files ) echo 1 ; else echo 0 ; ?> " />
< input type = "hidden" id = "copy_cut_dirs_allowed" value = " <?php if ( $co py_cut_dirs ) echo 1 ; else echo 0 ; ?> " />
< input type = "hidden" id = "copy_cut_files_allowed" value = " <?php if ( $co nfig[ 'co py_cut_files' ] ) echo 1 ; else echo 0 ; ?> " />
< input type = "hidden" id = "copy_cut_dirs_allowed" value = " <?php if ( $co nfig[ 'co py_cut_dirs' ] ) echo 1 ; else echo 0 ; ?> " />
< input type = "hidden" id = "copy_cut_max_size" value = " <?php echo $copy_cut_max_size ; ?> " />
< input type = "hidden" id = "copy_cut_max_count" value = " <?php echo $copy_cut_max_count ; ?> " />
< input type = "hidden" id = "lang_copy" value = " <?php echo trans ( 'Copy' ); ?> " />
@ -652,7 +674,7 @@ foreach($files as $k=>$file){
'date'=>$date,
'size'=>$size,
'permissions' => $file['permissions'],
'extension'=>strtolower($file_ext)
'extension'=>fix_ strtolower($file_ext)
);
}else{
@ -673,7 +695,7 @@ foreach($files as $k=>$file){
'date'=>$date,
'size'=>$size,
'permissions' =>'',
'extension'=>strtolower($file_ext)
'extension'=>fix_ strtolower($file_ext)
);
if($show_folder_size){
$sorted[$k]['nfiles'] = $nfiles;
@ -760,10 +782,22 @@ $files=$sorted;
<?php if ( $create_folders ){ ?>
< button class = "tip btn new-folder" title = " <?php echo trans ( 'New_Folder' ) ?> " >< i class = "icon-plus" ></ i >< i class = "icon-folder-open" ></ i ></ button >
<?php } ?>
<?php if ( $co py_cut_files || $co py_cut_dirs ){ ?>
<?php if ( $co nfig[ 'co py_cut_files'] || $co nfig[ 'co py_cut_dirs' ] ){ ?>
< button class = "tip btn paste-here-btn" title = " <?php echo trans ( 'Paste_Here' ); ?> " >< i class = "rficon-clipboard-apply" ></ i ></ button >
< button class = "tip btn clear-clipboard-btn" title = " <?php echo trans ( 'Clear_Clipboard' ); ?> " >< i class = "rficon-clipboard-clear" ></ i ></ button >
<?php } ?>
< div id = "multiple-selection" style = "display:none;" >
<?php if ( $config [ 'multiple_selection' ]){ ?>
<?php if ( $config [ 'delete_files' ]){ ?>
< button class = "tip btn multiple-delete-btn" title = " <?php echo trans ( 'Erase' ); ?> " data-confirm = " <?php echo trans ( 'Confirm_del' ); ?> " >< i class = "icon-trash" ></ i ></ button >
<?php } ?>
< button class = "tip btn multiple-select-btn" title = " <?php echo trans ( 'Select_All' ); ?> " >< i class = "icon-check" ></ i ></ button >
< button class = "tip btn multiple-deselect-btn" title = " <?php echo trans ( 'Deselect_All' ); ?> " >< i class = "icon-ban-circle" ></ i ></ button >
<?php if ( $apply_type != "apply_none" && $config [ 'multiple_selection_action_button' ]){ ?>
< button class = "btn multiple-action-btn btn-inverse" data-function = " <?php echo $apply_type ; ?> " > <?php echo trans ( 'Select' ); ?> </ button >
<?php } ?>
<?php } ?>
< / div >
< / div >
< div class = "span2 half view-controller" >
< button class = "btn tip <?php if ( $view == 0 ) echo " btn-inverse" ; ?> " id = "view0" data-value = "0" title = " <?php echo trans ( 'View_boxes' ); ?> " >< i class = "icon-th <?php if ( $view == 0 ) echo "icon-white" ; ?> " ></ i ></ button >
@ -772,7 +806,7 @@ $files=$sorted;
< / div >
< div class = "span6 entire types" >
< span > <?php echo trans ( 'Filters' ); ?> :</ span >
<?php if ( $_GET [ 'type' ] != 1 && $_GET [ 'type' ] != 3 && $ show_filter_buttons ){ ?>
<?php if ( $_GET [ 'type' ] != 1 && $_GET [ 'type' ] != 3 && $ config[ ' show_filter_buttons' ] ){ ?>
<?php if ( count ( $ext_file ) > 0 or false ){ ?>
< input id = "select-type-1" name = "radio-sort" type = "radio" data-item = "ff-item-type-1" checked = "checked" class = "hide" / >
< label id = "ff-item-type-1" title = " <?php echo trans ( 'Files' ); ?> " for = "select-type-1" class = "tip btn ff-label-type-1" >< i class = "icon-file" ></ i ></ label >
@ -892,7 +926,7 @@ $files=$sorted;
foreach ($files as $file_array) {
$file=$file_array['file'];
if($file == '.' || ( substr($file, 0, 1) == '.' & & isset( $file_array[ 'extension' ] ) & & $file_array[ 'extension' ] == strtolower(trans( 'Type_dir' ) )) || (isset($file_array['extension']) & & $file_array['extension']!=strtolower(trans('Type_dir'))) || ($file == '..' & & $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' & & $n_files>$file_number_limit_js & & $file!=".." & & stripos($file,$filter)===false)){
if($file == '.' || ( substr($file, 0, 1) == '.' & & isset( $file_array[ 'extension' ] ) & & $file_array[ 'extension' ] == fix_ strtolower(trans( 'Type_dir' ) )) || (isset($file_array['extension']) & & $file_array['extension']!=fix_ strtolower(trans('Type_dir'))) || ($file == '..' & & $subdir == '') || in_array($file, $hidden_folders) || ($filter!='' & & $n_files>$file_number_limit_js & & $file!=".." & & stripos($file,$filter)===false)){
continue;
}
$new_name=fix_filename($file,$config);
@ -920,7 +954,7 @@ $files=$sorted;
}
?>
< li data-name = " <?php echo $file ?> " class = " <?php if ( $file == '..' ) echo 'back' ; else echo 'dir' ; ?> " <?php if (( $filter != '' && stripos ( $file , $filter ) === false )) echo ' style="display:none;"' ; ?> > <?php
< li data-name = " <?php echo $file ?> " class = " <?php if ( $file == '..' ) echo 'back' ; else echo 'dir' ; ?> <?php if ( ! $config [ 'multiple_selection' ]){ ?> no-selector <?php } ?> " <?php if (( $filter != '' && stripos ( $file , $filter ) === false )) echo ' style="display:none;"' ; ?> > <?php
$file_prevent_rename = false;
$file_prevent_delete = false;
if (isset($filePermissions[$file])) {
@ -958,14 +992,14 @@ $files=$sorted;
< input type = "hidden" class = "name" value = " <?php echo $file_array [ 'file_lcase' ]; ?> " />
< input type = "hidden" class = "date" value = " <?php echo $file_array [ 'date' ]; ?> " />
< input type = "hidden" class = "size" value = " <?php echo $file_array [ 'size' ]; ?> " />
< input type = "hidden" class = "extension" value = " <?php echo trans( 'Type_dir' );?> " />
< input type = "hidden" class = "extension" value = " <?php echo fix_strtolower( trans( 'Type_dir' ) );?> " />
< div class = "file-date" > <?php echo date ( trans ( 'Date_type' ), $file_array [ 'date' ]); ?> </ div >
<?php if ( $show_folder_size ){ ?>
< div class = "file-size" > <?php echo makeSize ( $file_array [ 'size' ]); ?> </ div >
< input type = "hidden" class = "nfiles" value = " <?php echo $file_array [ 'nfiles' ]; ?> " />
< input type = "hidden" class = "nfolders" value = " <?php echo $file_array [ 'nfolders' ]; ?> " />
<?php } ?>
< div class = 'file-extension' > <?php echo trans( 'Type_dir' );?> </ div >
< div class = 'file-extension' > <?php echo fix_strtolower( trans( 'Type_dir' ) );?> </ div >
< figcaption >
< 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 trans ( 'Rename' ) ?> " data-folder = "1" data-permissions = " <?php echo $file_array [ 'permissions' ]; ?> " data-path = " <?php echo $rfm_subfolder . $subdir . $file ; ?> " >
< i class = "icon-pencil <?php if ( ! $rename_folders || $file_prevent_rename ) echo 'icon-white' ; ?> " ></ i ></ a >
@ -984,7 +1018,7 @@ $files=$sorted;
foreach ($files as $nu=>$file_array) {
$file=$file_array['file'];
if($file == '.' || $file == '..' || $file_array['extension']==trans('Type_dir') || !in_array(fix_strtolower($file_array['extension']), $ext) || ($filter!='' & & $n_files>$file_number_limit_js & & stripos($file,$filter)===false))
if($file == '.' || $file == '..' || $file_array['extension']==fix_strtolower( trans('Type_dir')) || (!$config['ext_blacklist'] & & !in_array(fix_strtolower($file_array['extension']), $ext)) || ($config['ext_blacklist'] & & in_array(fix_strtolower($file_array['extension']), $config['ext_blacklist']) ) || ($filter!='' & & $n_files>$file_number_limit_js & & stripos($file,$filter)===false))
continue;
foreach ( $hidden_files as $hidden_file ) {
if ( fnmatch($hidden_file, $file, FNM_PATHNAME) ) {
@ -1089,7 +1123,7 @@ $files=$sorted;
}
if((!($_GET['type']==1 & & !$is_img) & & !(($_GET['type']==3 & & !$is_video) & & ($_GET['type']==3 & & !$is_audio))) & & $class_ext>0){
?>
< li class = "ff-item-type- <?php echo $class_ext ; ?> file " data-name = " <?php echo $file ; ?> " <?php if (( $filter != '' && stripos ( $file , $filter ) === false )) echo ' style="display:none;"' ; ?> > <?php
< li class = "ff-item-type- <?php echo $class_ext ; ?> file <?php if ( ! $config [ 'multiple_selection' ]){ ?> no-selector <?php } ?> " data-name = " <?php echo $file ; ?> " <?php if (( $filter != '' && stripos ( $file , $filter ) === false )) echo ' style="display:none;"' ; ?> > <?php
$file_prevent_rename = false;
$file_prevent_delete = false;
if (isset($filePermissions[$file])) {
@ -1103,11 +1137,25 @@ $files=$sorted;
< a href = "javascript:void('')" class = "link" data-file = " <?php echo $file ; ?> " data-function = " <?php echo $apply ; ?> " >
< div class = "img-precontainer" >
<?php if ( $is_icon_thumb ){ ?> < div class = "filetype" > <?php echo $file_array [ 'extension' ] ?> </ div > <?php } ?>
<?php if ( $config [ 'multiple_selection' ]){ ?> < div class = "selector" >
< label class = "cont" >
< input type = "checkbox" class = "selection" name = "selection[]" value = " <?php echo $file ; ?> " >
< span class = "checkmark" > < / span >
< / label >
< / div >
<?php } ?>
< div class = "img-container" >
< img class = " <?php echo $show_original ? "original" : "" ?><?php echo $is_icon_thumb ? " icon" : "" ?> " data-src = " <?php echo $src_thumb ; ?> " >
< / div >
< / div >
< div class = "img-precontainer-mini <?php if ( $is_img ) echo 'original-thumb' ?> " >
<?php if ( $config [ 'multiple_selection' ]){ ?> < div class = "selector" >
< label class = "cont" >
< input type = "checkbox" class = "selection" name = "selection[]" value = " <?php echo $file ; ?> " >
< span class = "checkmark" > < / span >
< / label >
< / div >
<?php } ?>
< div class = "filetype <?php echo $file_array [ 'extension' ] ?> <?php if ( in_array ( $file_array [ 'extension' ], $editable_text_file_exts )) echo 'edit-text-file-allowed' ?> <?php if ( ! $is_icon_thumb ){ echo "hide" ; } ?> " > <?php echo $file_array [ 'extension' ] ?> </ div >
< div class = "img-container-mini" >
<?php if ( $mini_src != "" ){ ?>
@ -1118,8 +1166,6 @@ $files=$sorted;
<?php if ( $is_icon_thumb ){ ?>
< div class = "cover" > < / div >
<?php } ?>
< / a >
< a href = "javascript:void('')" class = "link" data-file = " <?php echo $file ; ?> " data-function = " <?php echo $apply ; ?> " >
< div class = "box" >
< h4 class = " <?php if ( $ellipsis_title_after_first_row ){ echo "ellipsis" ; } ?> " >
<?php echo $filename ; ?> </ h4 >