<?php

	include "sys/gallery.php";
	include "sys/lib.php";

	class teste extends cGallery {
		
		protected $title;
		protected $body;
		
		function onCreate() {			
			$this->addButton("DELETE","delete.php","DELETE");
			$this->addButton("INFO","plot.php","INFO");
			$this->title = $this->createTAG("h1","TESTE");
			$this->body = $this->createTAG("p","");
		}		
		
		function OnPrepare($fields,$value,&$data) {			
			//$this->teste["value"]=$value['extension'];			
			$this->title->Value($value['extension']);
			$this->body->Value($value['filename']);
			$id=$value['dirname']."/".$value['basename'];
			$id=str_replace("'","\'",$id);
			$data['ident']=$id;
			$data['title']=$value['extension'];
			$data['body']=$value['filename'];
			$data['data']=array('HOST'=>$value['HOST'],'URL'=>$value['URL'],'dirname'=>$value['dirname'],'EXT'=>$value['extension'],'fname'=>$value['filename'],'eeee'=>$value['dirname']);			
		}			
	}


	$search="";
	$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";		
	$URL=parse_url($actual_link);	
	$filetype = array('mp4','avi','mkv','m4v');	
	$path="/home/usuario/AndroidStudioProjects/www/movies/";	
	$data=getDirContents($path,$filetype,$search,"/www/movies/",false);

	$teste = new teste("FORM TESTE","GALERIA","LIST-VIEW",$data);
	$teste->Show();

	showOnlyArray($data);
	
?>
