<? global $vis_language;  //echo " Required Array IN Template : ";echo "<pre>";print_r($share_link['links']);echo "</pre>";echo "<br>"; ?>

   <? $status=array($img => ' <i class="vh vh-module"></i>');
   $priority=array(1 => $vis_language['TXTLOW'],2 => $vis_language['TXTMEDIUM'],3 => $vis_language['TXTHIGH']); 
  $imgext_arr=array('ai','bmp','eps','gif','jpg','jpeg','png','psd','tiff','tif','svg','svgz');
		 
  
 ?>


 

    <section class="padder">
    <section class="m-t-sm">   
		
		<div id="vh-drive">
			  <div id="drive-view" class="drive-object grid-view">
		 <?	if($share_link['links']!=-1)
{?>
                <div class="drive-head animated fadeInUp">
                       <div class="drive-items">
                                 
                        </div>
                        <div class="drive-items">
                                 Item 
                        </div>
                        <div class="drive-items">
                               Name 
                             <?//= $share_link['links'][$i]['name'];?>
                        </div>
                        <div class="drive-items">
                                Owner 
                               <?//=$client_info['display_name'];?>
                        </div>
                        <div class="drive-items">
                            Size 
                           <?//= $share_link['links'][$i]['size'];?>KiB
                        </div>
                        <div class="drive-items">
                                 Creation date 
                                        <?//= $date?>
                        </div>
		</div> 
            	
				
				 
<?		   
			
	for($i=0; $i<count($share_link['links'][$i]); $i++){ $flag=0;
   $ext = pathinfo($share_link['links'][$i]['name'], PATHINFO_EXTENSION);
 //$creation_date=$share_link['links'][$i]['client_modified']+ VIS_TIMEZONE;
 $date=date(VIS_DATE_FORMAT,$creation_date);?>
 
               <a data-modal-arguments="vis_module=selfhelp&vis_operation=dropbox_details1&vis_drive_name=<? echo $share_link['links'][$i]['name']; ?>&vis_drive_size=<? echo $share_link['links'][$i]['size']; ?>&vis_drive_type=<? echo $ext; ?>&vis_drive_content=<? echo $share_link['links'][$i]['url']; ?>&vis_drive_owner=<? echo urlencode($client_info['display_name']); ?>&vis_drive_date=<? echo urlencode($share_link['links'][$i]['client_modified']);?>" data-toggle="ajaxModal" href="javascript:void(0);">
                        <div class="drive-info ">
                                <div class="drive-item">
								 
                                        <?  
										 
										
										if($ext=='zip' || $ext=='patch' || $ext=='php' || $ext=='json' || $ext=='css' || $ext=='sql' || $ext=='mkdn' || $ext=='cpp' || $ext=='as') { ?>
      <i class="vh vh-file-text text-muted"></i>
      <?						
						 }
      elseif(in_array($ext,$imgext_arr) ) { ?>
	   <img src="<?= str_replace('www.dropbox.com','dl.dropboxusercontent.com',$share_link['links'][$i]['url']);?>" alt="<?= str_replace('www.dropbox.com','dl.dropboxusercontent.com',$share_link['links'][$i]['url']);?>" />
       <?}
      else if($ext=='xlsx' || $ext=='xlsm' || $ext=='xls') { ?>
       <i class="vh vh-file-spreadsheet vh-file-spreadsheet-color"></i>
       <?} 
       else if($ext=='pdf') { ?>
      <i class="vh vh-file-pdf vh-file-pdf-color"></i>
       <?}
       else if($ext=='doc' || $ext=='docx' || $ext=='docm' || $ext=='ods' || $ext=='odt') { ?>
      <i class="vh vh-file-word vh-file-word-color"></i>
        <?}
        else if($ext=='csv' || $ext=='xhtml' || $ext=='xml') { ?>
      <i class="vh vh-file-spreadsheet vh-file-spreadsheet-color"></i>
        <?} 
        else if($ext=='txt' ) { ?>
      <i class="vh vh-file-text text-muted"></i>
        <?}
		
         else if($ext=='zip' ) { ?>
      <i class="vh vh-file-zip vh-file-zip-color"></i>
         <?} 
        else if($ext=='odp' || $ext=='pps' || $ext=='ppsm'|| $ext=='ppsx' || $ext=='ppt' || $ext=='pptm' || $ext=='pptx') { ?>
      <i class="vh vh-file-presentation vh-file-presentation-color"></i>
        <?} else
        {?>
			<i class="vh vh-file vh-info"></i>
		<?}
        ?>
                                </div>
								 
                                <div class="drive-item-name">
                                        <small>Name</small>
                                       <?= $share_link['links'][$i]['name'];?>
                                </div>
                                <div class="drive-item-owner">
                                        <small>Owner</small>
                                        <?=$client_info['display_name'];?>
                                </div>
                                <div class="drive-item-size">
                                        <small>Size</small>
                                       <?= $share_link['links'][$i]['size'];?>KiB
                                </div>
                                <div class="drive-item-date">
                                        <small>Creation date</small>
                                        <?= $share_link['links'][$i]['client_modified']?>
                                </div> 
                        </div>
                </a>
                
             
<?}
if($drive_details[0]['count']>$view_info['page_count']){?>	
			<div id="load_more_activities" onclick="javascript:mydrive_list_load(<?= $page+1;?>);">
			<div style="text-align: center;">
				<span class="link vis-pointer"><?= $vis_language['TXTLOADMORE'];?></span>
			</div>
			</div><? 
	} 
	

		}
		else
		{
 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
}?>	
		</div>
</div>	

  </section>
</section>
<script>
 function mydrive_list_load(page){
	$.post("index.php?vis_module=selfhelp&vis_operation=mydrive_list_load&vis_tmpst="+new Date().getTime(),{'vis_page': page}, function(data) {
		$("#load_more_activities").last().remove();
		$("#drive-view").last().append(data);
		//$("#load_more_activities").before(data);
	});
}
</script>




