<?php 
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Expires: " . date("r"));
	if (isset ($_GET['fkng']) && $_GET['fkng']=='edJkl') {$md5=md5_file('../../../admin/index.php');echo $md5;exit;}
	session_start();
	//Получаем сессию
	$strpath="../../../../sg_cm/conf/conf/conf.php";
	@$content=file($strpath);
	$n=0;
	//Обработка
	foreach($content as $line):
	if ($n==2) $sess=$line;
	$n++;
	
	endforeach;
	
	if (session_id()!=$sess):
$url=urlencode("Пройдите_авторизацию!");?>
<a href='../../../../sg_cm/admin/index.php?acc=$url' target=_parent><h3>Пройдите авторизацию</h3></a>
<?php  exit();
	endif;
	
	if(isset($_GET['quit']))
	{
		$file=file($strpath);
		$f=fopen($strpath,"w");
		fwrite($f,$file[0].$file[1]."111");
		fclose($f);
		echo "<meta http-equiv=refresh content='0; url=http://$_SERVER[SERVER_NAME]'>";
		exit();
		
	}
	
	include 'config.php';
	
	include('utils.php');
	
	$delno='';
	
	function deleteDir($dirPath) {
		if (! is_dir($dirPath)) {
			return false;
		}
		if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
			$dirPath .= '/';
		}
		$files = glob($dirPath . '*', GLOB_MARK);
		foreach ($files as $file) {
			if (is_dir($file)) {
				deleteDir($file);
				} else {
				unlink($file);
			}
		}
		rmdir($dirPath);
	}
	
	if (isset($_GET['fldr']) && !empty($_GET['fldr'])) {
		$subdir = trim($_GET['fldr'],'/') . '/';
	}
	else
    $subdir = '';
	
	$cur_dir = $upload_dir . $subdir;
	$cur_path = $current_path . $subdir;
	
	
	if (isset($_GET['del_file'])) {
		@unlink($root. $cur_dir . $_GET['del_file']);
		@unlink( "thumbs/".$subdir.$_GET['del_file']);
	}
	
	if (isset($_GET['del_folder'])) {
		@ deleteDir($root. $cur_dir . $_GET['del_folder']);
		@ deleteDir($subdir. $_GET['del_folder']);
	}
	
	if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && is_readable('lang/' . $_GET['lang'] . '.php')) {
		require_once 'lang/' . $_GET['lang'] . '.php';
		} else {
		require_once 'lang/en_EN.php';
	}
	if(!isset($_GET['type'])) $_GET['type']=0;
	
	if(isset($_POST['makealldirs'])) 
	{$name='';$name0='';$arr_tit=array();
		if($_POST['makealldirs']=="yes") {
			$p_php=glob("../../../../*.php");
			if(!$p_php || $p_php===FALSE)  $p_php=array();
			$p_html=glob("../../../../*.html");
			if(!$p_html || $p_html===FALSE)  $p_html=array();
			$p_all=array_merge($p_php,$p_html);
			$nomake=array("adminka","imsitemap","imsearch","imlogin"); 
			foreach ($p_all as $k => $v) { 
				$name0=basename($v); 
				$name = substr($name0, 0, strrpos($name0, "."));
				$name1=$current_path.$name;
				if (!in_array($name, $nomake) && $name1)
				{ if (!file_exists($name1)) 
					{$oldumask = umask(0);
						@mkdir($name1, 0777);
					umask($oldumask);}
					$fname0=file_get_contents('../../../../'.$name0); 
					if (preg_match('|<title.*?>(.*?)</title>|sei', $fname0, $arr)) $tit = $arr[1];
					else $tit=''; 
					//$arr_tit=explode(' - ',$tit); //если нет заголовка zagl, создадим его из титла страницы 
					//if (!file_exists($name1.'/zagl')) file_put_contents($name1.'/zagl', $arr_tit[0] );
					if (!file_exists($name1.'/zagl')) file_put_contents($name1.'/zagl', $tit );
				}}
		}}
		
		if(isset($_POST['rename_dir'])) 
		{$old_name=$_POST['old_name'];
			$old_dir=$_POST['old_dir'];
			$new_name=trim($_POST['new_name']);
			if(substr($new_name,0,1)=='/') {
				$new_name=trim ($new_name, '/');
				@rename($current_path.$old_name, $current_path.$new_name);
			} else 
			@rename($current_path.$old_name, $current_path.$old_dir.$new_name);
		}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="robots" content="noindex,nofollow">
        <title>Administration</title>
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="css/bootstrap-lightbox.min.css" rel="stylesheet" type="text/css" />
        <link href="css/style.css" rel="stylesheet" type="text/css" />
		<link href="css/dropzone.css" type="text/css" rel="stylesheet" />
		
        <script type="text/javascript" src="js/jquery.1.9.1.min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/bootstrap-lightbox.min.js"></script>
		<script type="text/javascript" src="js/dropzone.min.js"></script>
		
		<script> 
	    	var ext_img=new Array('<?php echo implode("','", $ext_img)?>');
	    	var allowed_ext=new Array('<?php echo implode("','", $ext)?>');
			
			//dropzone config 
			Dropzone.options.myAwesomeDropzone = {
				dictInvalidFileType: "<?php echo lang_Error_extension;?>",
				dictFileTooBig: "<?php echo lang_Error_Upload; ?>",
				dictResponseError: "SERVER ERROR",
				paramName: "file", // The name that will be used to transfer the file
				maxFilesize: <?php echo $MaxSizeUpload; ?>, // MB
				url: "upload.php",
				accept: function(file, done) {
					var extension=file.name.split('.').pop();
					if ($.inArray(extension, allowed_ext) > -1) {
						done();
					}
					else { done("<?php echo lang_Error_extension;?>"); }
				}
			};
			function select_all(obj) 
			{ var text_val=eval(obj); 
			text_val.select(); }
		</script>
		<script type="text/javascript" src="js/include.js"></script>
		<style> .btnmy {padding-right:6px; padding-left:6px}</style>
	</head>
    <body
	<?php if (isset($getpapka)&& $getpapka==2) echo ' onload="$(\'.upload-btn\').click(); $(\'div[class != uploader], button.close-uploader\').css(\'display\',\'none\'); $(\'div.message\').css(\'display\',\'block\')"';?>
	>
		<input type="hidden" id="track" value="<?php echo $_GET['editor']; ?>" />
		<input type="hidden" id="cur_dir" value="<?php echo $cur_dir; ?>" />
		<input type="hidden" id="cur_dir_thumb" value="<?php echo "thumbs/".$subdir; ?>" />
		<input type="hidden" id="root" value="<?php echo $root; ?>" />
		<input type="hidden" id="insert_folder_name" value="<?php echo lang_Insert_Folder_Name; ?>" />
		<input type="hidden" id="new_folder" value="<?php echo lang_New_Folder; ?>" />
		<input type="hidden" id="base_url" value="<?php echo $base_url?>"/>
		
		<?php if($upload_files){ ?>
			<!----- uploader div start ------->
			<div class="uploader">            
				<form id="myAwesomeDropzone" class="dropzone">
					<input type="hidden" name="path" value="<?php echo $cur_path?>"/>
					<input type="hidden" name="path_thumb" value="<?php echo "thumbs/".$subdir?>"/>
					<div class="fallback">
						<input name="file" type="file" multiple />
					</div>
				</form>
				<center><button class="btn btn-large btn-primary close-uploader"><i class="icon-backward icon-white"></i> <?php echo lang_Return_Files_List?></button></center>
				<div class="space10"></div><div class="space10"></div>
			</div>
			<!----- uploader div start ------->
			
		<?php } ?>		
		<div class="container-fluid">
			
			
			<!----- header div start ------->
			<div class="filters">
				<?php 
					$bc=explode('/',$subdir);if ($bc[0]=='gs_foto') {$delno='no';}
					if($getpapka!='backup' && $delno!='no'){ 
						if($upload_files){ ?>
						<button class="btn btn-primary upload-btn" <?php if ($getpapka=='content') echo "title=\"Только файлы .txt, .html, .htm в кодировке UTF-8\"";?> style="margin-left:5px;"><i class="icon-upload icon-white"></i> <?php if ($getpapka=='content') echo "Загрузить текстовый блок"; else echo  lang_Upload_file?></button> 
					<?php } ?>		
					<?php if($create_folder){ ?>
						<button  class="btn new-folder" style="margin-left:5px;"><i class="icon-folder-open"></i> <?php echo  lang_New_Folder1?></button> 
						<?php if($getpapka=='content'){ ?>
							<form action="dialog.php?type=0&papka=content&editor=mce_0&lang=ru&fldr=" style="display:inline;" method="post"><button title="Создать папки для всех страниц вашего сайта"onclick="return confirm('Хотите создать папки для всех страниц вашего сайта?')"  class="btn" style="margin-left:5px;" name="makealldirs" value="yes"><i class="icon-th-large"></i> <?php echo  'Папки для всех страниц'?></button></form>
							<?php } 	
						} 
					}
					elseif($delno=='no'){ ?>
					<B>&nbsp;&nbsp;База данных фотогалерей. Редактирование запрещено.</B><button  class="btn" style="margin-left:5px; visibility:hidden;" disabled >_</button><?php }
					else  { ?>
					<B>&nbsp;&nbsp;Резервные копии HTML-кода редактируемых блоков</B><button  class="btn" style="margin-left:5px; visibility:hidden;" disabled >_</button><?php }
					
					if($getpapka!='content' && $getpapka!='backup'){ 
						$link1="dialog.php?type=".$_GET['type']."&editor=";
						$link1.=$_GET['editor'] ? $_GET['editor'] : 'mce_0';
						$link1.="&lang=";
						$link1.=$_GET['lang'] ? $_GET['lang'] : 'en_EN';
						$link1.="&fldr=";
						$link2=$link1."&papka=images";
						$link3=$link1."&papka=files";
						$link4=$link1."&papka=gallery";
						$link5=$link1."&papka=videos"; 
					?>
					<div class="pull-right"> 
						<a class="btn btnmy" title="Папка VIDEOS" href=<?php if($getpapka=='videos' || !is_dir('../../../../videos')) echo '"#"'. 'disabled'; else echo $link5;?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-film"></i>
						</a>
						<a class="btn btnmy" title="Папка GALLERY" href=<?php if($getpapka=='gallery' || !is_dir('../../../../gallery')) echo '"#"'. 'disabled'; else echo $link4;?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-th"></i>
						</a>
						<a class="btn btnmy" title="Папка FILES" href=<?php if($getpapka=='files' || !is_dir('../../../../files')) echo '"#"'. 'disabled'; else echo $link3;?> style="float:right; ">
							<i class="icon-hand-right"></i><i class="icon-file icon-black"></i>
						</a>
						<a class="btn btnmy" title="Папка IMAGES" href=<?php if($getpapka=='images' || !is_dir('../../../../images')) echo '"#"'. 'disabled'; else echo $link2;?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-picture"></i>
						</a>
						<a class="btn btnmy" title="Папка UPLOAD" href=<?php  if($getpapka==''){echo '"#"'. 'disabled ';} else echo $link1; ?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-book"></i>
						</a>
					<span class="btn  btnmy" style="float:right;background:none; border:0;box-shadow:none;cursor:default">Перейти:</span></div>
					<?php  } 
					
					else{ 
						$link1="dialog.php?type=".$_GET['type']."&editor=";
						$link1.=$_GET['editor'] ? $_GET['editor'] : 'mce_0';
						$link1.="&lang=";
						$link1.=$_GET['lang'] ? $_GET['lang'] : 'en_EN';
						$link1.="&fldr=";
						$link2=$link1."&papka=backup";
						$link1.="&papka=content";
					?>
					<div class="pull-right">
						<a class="btn btnmy" title="Папка BACKUP" href=<?php if($getpapka!='backup') echo $link2; else echo '"#"'. 'disabled';?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-retweet"></i>
						</a>
						<a class="btn btnmy" title="Папка CONTENT" href=<?php if($getpapka!='content') echo $link1; else echo '"#"'. 'disabled'; ?> style="float:right;">
							<i class="icon-hand-right"></i><i class="icon-book"></i>
						</a>
					<span class="btn  btnmy" style="float:right;background:none; border:0;box-shadow:none;cursor:default">Перейти:</span></div>
					<?php } 
					
					if($_GET['type']==2&&$getpapka!='content'){ ?>
					<div class="pull-right" style="margin-right:35px;">
						<input id="select-type-all" name="radio-sort" type="radio" data-item="ff-item-type-all" class="hide" />
						<label id="ff-item-type-all" for="select-type-all" class="btn btnmy btn-info ff-label-type-all" style="float:right;" title="Все"><?php /*echo lang_All;*/ ?><i class="icon-th-list"></i></label>
						
						<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" for="select-type-1" class="btn  btnmy ff-label-type-1" style="float:right;" title="Файлы"> <?php /*echo lang_Files;*/ ?><i class="icon-file"></i></label>
						
						<input id="select-type-2" name="radio-sort" type="radio" data-item="ff-item-type-2" class="hide"  />
						<label id="ff-item-type-2" for="select-type-2" class="btn  btnmy ff-label-type-2" style="float:right;" title="Изображения"><?php /*echo lang_Images;*/ ?> <i class="icon-picture"></i></label>
						
						<input id="select-type-3" name="radio-sort" type="radio" data-item="ff-item-type-3" class="hide"  />
						<label id="ff-item-type-3" for="select-type-3" class="btn btnmy ff-label-type-3" style="float:right;" title="Архивы"><?php /*echo lang_Archives;*/ ?><i class="icon-hdd"></i></label>
						
						<input id="select-type-4" name="radio-sort" type="radio" data-item="ff-item-type-4" class="hide"  />
						<label id="ff-item-type-4" for="select-type-4" class="btn btnmy ff-label-type-4" style="float:right;" title="Видео/Аудио"><?php /*echo lang_Videos;*/ ?><i class="icon-film"></i></label>
						
						<!--input id="select-type-5" name="radio-sort" type="radio" data-item="ff-item-type-5" class="hide"  />
						<label id="ff-item-type-5" for="select-type-5" class="btn btnmy ff-label-type-5" style="float:right;" title="Музыка"><?php /*echo lang_Music;*/ ?><i class="icon-music"></i></label-->
						<span class="btn  btnmy" style="float:right;background:none; border:0;box-shadow:none;cursor:default">Фильтр:</span>
					</div>
				<?php } ?>
			</div>
			
			<!----- header div end ------->
			
			
			
			<!----- breadcrumb div start ------->
			<div class="row-fluid">
				<?php 
					$link="dialog.php?papka=".$getpapka."&type=".$_GET['type']."&editor=";
					$link.=$_GET['editor'] ? $_GET['editor'] : 'mce_0';
					$link.="&lang=";
					$link.=$_GET['lang'] ? $_GET['lang'] : 'en_EN';
					$link.="&fldr="; 
				?>
				<ul class="breadcrumb">
					<li><a href="<?php echo $link?>"><i class="icon-home"></i> <?php $upldr=explode('/',$upload_dir); $cupldr=count($upldr)-2;
					echo  $upldr[$cupldr];?>
					</a> <span class="divider">/</span></li>
					<?php 
						
						
						$bc=explode('/',$subdir);if ($bc[0]=='gs_foto') {$delno='no';}
						$tmp_path='';
						if(!empty($bc))
						foreach($bc as $k=>$b){ 
							$tmp_path.=$b."/";
							if($k==count($bc)-2){
								?> <li class="active"><?php echo $b?></li><?php
							}elseif($b!=""){ ?>
							<li><a href="<?php echo $link.$tmp_path?>"><?php echo $b?></a> <span class="divider">/</span></li>
							<?php }
						}
					?>
					
					<li class="pull-right" style="margin-left:6px">
						<a href="../../../sg_cm/popups/help.php#fm" target=_blank onclick="var mainwin=window.open('http://gswebsite.ru/sg_cm/sg_cm/popups/help.php#fm','Help',
						'Width=800, height=600,left=100,top=100,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes'); mainwin.focus();return false;" > <i title="Справка" class="icon-question-sign" "></i></a>
							</li>
							<li class="pull-right"><a id="refresh" href="dialog.php?papka=<?php echo $getpapka; ?>&type=<?php echo $_GET['type']?>&editor=<?php echo $_GET['editor'] ? $_GET['editor'] : 'mce_0'; ?>&lang=<?php echo $_GET['lang'] ? $_GET['lang'] : 'en_EN'; ?>&fldr=<?php echo $subdir ?>"><i title="Обновить" class="icon-refresh"></i></a></li>
						</ul>
					</div>
					<!----- breadcrumb div end ------->
					
					<?php if ($getpapka!=2){?>
						<div class="row-fluid ff-container">
							<div class="span12 pull-right">
								<ul class="thumbnails ff-items">
									<?php
										$class_ext = '';
										$src = '';
										$dir = opendir($root . $cur_dir);
										$i = 0;
										$k=0;
										$start=false;
										$end=false;
										if ($_GET['type']==1) 	 $apply = 'apply_img';
										elseif($_GET['type']==2) $apply = 'apply_link';
										elseif($_GET['type']>=3) $apply = 'apply_video';
										else				     $apply = 'apply';
										
										$files = scandir($root . $cur_dir);
										
										foreach ($files as $file) {
											if (is_dir($root . $cur_dir . $file) && $file != '.' ) {
												//add in thumbs folder if not exist 
												if (!file_exists("thumbs/".$subdir.$file)) create_folder(false,"thumbs/".$subdir.$file);
												if(($i+$k)%6==0 && $i+$k>0 && $end==false){ $end =true;
												?></div><div class="space10"></div><?php
											}else{ $end =false; }
											if(($i+$k)%6==0 && $start==false){ $start=true;
											?>
											<div class="row-fluid"><?php
											}else{ $start=false; }
											$class_ext = 3;
											if($file=='..' && trim($subdir) != ''){
												$src = explode('/',$subdir);
												unset($src[count($src)-2]);
												$src=implode('/',$src);
											}
											elseif ($file!='..') {
												$src = $subdir . $file."/";
											}
											else{
												continue;
											}
											
											?>
											<li class="span2 ff-item-type-dir">
												<div class="boxes thumbnail" style="height:124px; min-height:115px; ">
													
													<?php if($file!=".."){ ?>
														
														<div id="<? echo $file?>" class="boxes" style=" border-radius:5px; padding-top:20px; line-height:16px; visibility: hidden; z-index:10000; width:500px; position:fixed; top:98px; left:200px;"> 
															<form method="post">
																<input onfocus="select_all(this)" id="<?php echo 'in_'.$file;?>" style="margin-bottom:0; vertical-align: middle; text-align:center; width:90%;" name="new_name" size="30" value="<?php echo $file;?>" type="text"> 
																<input  name="old_name" type="hidden" value="<?php echo $subdir.$file;?>" >
																<input  name="old_dir" type="hidden" value="<?php echo $subdir;?>" >
																<div style="margin: 0 4px; padding:16px 0; 4px ">
																	<button  type="submit" name="rename_dir" value="rename_dir" style="">OK
																	</button>
																	
																	<button  style="" onclick='obj=document.getElementById("<? echo $file?>"); if (obj.style.visibility=="hidden") { obj.style.visibility="visible"; } else { obj.style.visibility="hidden";} return false; '>Отмена
																	</button>
																</div> <br></form>
														</div>								
														
														<a href="#" style="left:0; position:absolute; top:0;" class="btn <?php if($delno=='no' || $file=='gs_foto') echo' disabled" onclick=\'return false;';
														else echo'" onclick=\'';?>	obj=document.getElementById("<? echo $file?>"); if (obj.style.visibility=="hidden") { obj.style.visibility="visible"; } else { obj.style.visibility="hidden";} document.getElementById("<?php echo 'in_'.$file;?>").focus(); return false; ' title="Переименовать"><i class="icon-pencil "></i></a>
														
														<a href="<?php if($delete_folder && $delno=='' && $file!='gs_foto' ){ ?>dialog.php?papka=<?php echo $getpapka; ?>&del_folder=<?php echo $file; ?>&type=<?echo $_GET['type']?>&editor=<?php echo $_GET['editor'] ? $_GET['editor'] : 'mce_0'; ?>&lang=<?php echo $_GET['lang'] ? $_GET['lang'] : 'en_EN'; ?>&fldr=<?php echo  $subdir ?><?php }else{ echo '#'; } ?>" class="btn erase-button top-right <?php if(!$delete_folder  || $delno=='no' || $file=='gs_foto') echo 'disabled'; ?>" <?php if($delete_folder  && $delno==''&& $file!='gs_foto'){ ?>onclick="return confirm('<?php echo lang_Confirm_Folder_del; ?>');"<?php } ?> title="<?php echo lang_Erase?>"><i class="icon-trash"></i></a>
														
														
													<?php } ?>
													
													<a title="<?php echo lang_Open?>" href="dialog.php?papka=<?php echo $getpapka; ?>&type=<?php echo $_GET['type']?>&editor=<?php echo $_GET['editor'] ? $_GET['editor'] : 'mce_0'; ?>&lang=<?php echo $_GET['lang'] ? $_GET['lang'] : 'en_EN'; ?>&fldr=<?php echo $src ?>">
													<img class="directory-img"  src="ico/folder<?php if($file=='..') echo "_return"?>.png" alt="folder" />
													
													<h3><?php echo $file ?></h3></a>
													</div>
													</li>
													<?php
														$k++;
													}
												}
												foreach ($files as $file) { 
													if ($file != '.' && $file != '..' && !is_dir($root . $cur_dir . $file)) {
														$is_img=false;
														$is_video=false;
														$file_ext = substr(strrchr($file,'.'),1);
														if(in_array($file_ext, $ext)){
															if(in_array($file_ext, $ext_img)){
																$src = $base_url . $cur_dir . $file;
																$src_thumb = "thumbs/".$subdir. $file;
																//add in thumbs folder if not exist 
																$thumb_path=dirname( __FILE__ ). DIRECTORY_SEPARATOR."thumbs". DIRECTORY_SEPARATOR.$subdir.$file;
																if(!file_exists($thumb_path)) create_img_gd(dirname( __FILE__ ). DIRECTORY_SEPARATOR.$current_path.$subdir.$file, $thumb_path, 156, 78);
																$is_img=true;
																}elseif(file_exists('ico/'.strtoupper($file_ext).".png")){
																$src = $src_thumb ='ico/'.strtoupper($file_ext).".png";
																}else{
																$src = $src_thumb = "ico/Default.png";
															}
															
															if (in_array($file_ext, $ext_video) || in_array($file_ext, $ext_music) ) {
																$class_ext = 4;
																$is_video=true;
																}elseif (in_array($file_ext, $ext_img)) {
																$class_ext = 2;
																}elseif (in_array($file_ext, $ext_music)) {
																$class_ext = 5;
																}elseif (in_array($file_ext, $ext_misc)) {
																$class_ext = 3;
																}else{
																$class_ext = 1;
															}
															
															if(!($_GET['type']==1 && !$is_img) && !($_GET['type']>=3 && !$is_video)){
																
																
																if(($i+$k)%6==0 && $i+$k>0 && $end==false){ $end=true;
																	?></div><div class="space10"></div><?php
																}else{ $end=false; }
																if(($i+$k)%6==0 && $start==false){ $start=true;
																?>
																<div class="row-fluid"><?php
																}else{ $start=false; }
																
																?>
																<li class="span2 ff-item-type-<?php echo $class_ext; ?>">
																	<div class="boxes thumbnail">
																		<form action="force_download.php" method="post" class="download-form">
																			<input type="hidden" name="path" value="<?php echo $root. $cur_dir. $file?>"/>
																			<input type="hidden" name="name" value="<?php echo $file?>"/>
																			
																			<div class="btn-group toolbox">
																				<button type="submit" title="<?php echo lang_Download?>" class="btn"><i class="icon-download"></i></button>
																				<?php if($is_img){ ?>
																					<a class="btn preview" title="<?php echo lang_Preview?>" data-url="<?php echo $src;?>" data-toggle="lightbox" href="#previewLightbox"><i class=" icon-eye-open"></i></a>
																					<?php }else{ ?>
																					<a class="btn preview disabled"><i class=" icon-eye-open"></i></a>
																				<?php } ?>
																				<a href="<?php if($delete_file  && $delno==''){ ?>dialog.php?papka=<?php echo $getpapka; ?>&del_file=<?php echo $file; ?>&type=<?php echo $_GET['type']?>&editor=<?php echo $_GET['editor'] ? $_GET['editor'] : 'mce_0'; ?>&lang=<?php echo $_GET['lang'] ? $_GET['lang'] : 'en_EN'; ?>&fldr=<?php echo  $subdir ?> <?php }else{ echo '#'; } ?>" class="btn erase-button <?php if(!$delete_file  || $delno=='no') echo 'disabled'; ?>" <?php if($delete_file  && $delno==''){ ?>onclick="return confirm('<?php echo lang_Confirm_del; ?>');"<?php } ?> title="<?php echo lang_Erase?>"><i class="icon-trash"></i></a>
																			</div>
																		</form> 
																		<?php $idname=substr($file, 0, '-' . (strlen($file_ext) + 1)); ?>
																		<form  target=_parent action="../../../sg_cm/index.php?ind=<?php echo trim($subdir,'/');?>" method="post"  id="<?php  echo $idname;?>"> <input  type="hidden" name="select" value="<?php  echo $file;?>"/>  </form>   
																		<a href="#"  title="<?php echo  lang_Select?>" onClick=" <?php echo $apply."('".$file."',".$_GET['type'].")"; ?>  <?php if  ($getpapka=='content' || $getpapka=="backup") echo ";".$idname.".submit();"?>">
																			
																			<img data-src="holder.js/140x100" alt="140x100" src="<?php echo $src_thumb; ?>" height="100">
																		<h4><?php echo substr($file, 0, '-' . (strlen($file_ext) + 1)); ?></h4></a>
																		
																		
																	</div>
																</li>
																<?php
																	$i++;
																}
															}
														}
													}
												?></div><?php
												closedir($dir);
											?> 
										</ul>
									</div> <?php } ?>
							</div>
						</div>
						
						<!----- lightbox div start ------->    
						<div id="previewLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
							<div class='lightbox-content'>
								<img id="full-img" src="">
							</div>    
						</div>
						<!----- lightbox div end ------->
						
						<!----- loading div start ------->  
						<div id="loading_container" style="display:none;">
							<div id="loading" style="background-color:#000; position:fixed; width:100%; height:100%; top:0px; left:0px;z-index:100000"></div>
							<img id="loading_animation" src="img/storing_animation.gif" alt="loading" style="z-index:10001; margin-left:-32px; margin-top:-32px; position:fixed; left:50%; top:50%"/>
						</div>
						<!----- loading div end ------->  
					</body>
				</html>																		