Request->Items['path'];
$fullPath=realpath($this->Service->BasePath.'/'.$path);
if($fullPath!==false && is_file($fullPath) && strpos($fullPath,$this->Service->BasePath)!==false)
{
if($this->isFileTypeAllowed($this->getFileExtension($fullPath)))
{
$this->_fullPath=strtr($fullPath,'\\','/');
$this->_path=strtr(substr($fullPath,strlen($this->Service->BasePath)),'\\','/');
}
}
if($this->_fullPath===null)
throw new THttpException(500,'File Not Found: %s',$path);
$basePath=dirname($this->_fullPath);
if($dh=opendir($basePath))
{
$str="
{$this->_path}
\n";
while(($file=readdir($dh))!==false)
{
if(is_file($basePath.'/'.$file))
{
$fileType=$this->getFileExtension($basePath.'/'.$file);
if($this->isFileTypeAllowed($fileType))
{
if($fileType==='tpl' || $fileType==='page')
$type='Template file';
else
$type='Class file';
$path='/'.ltrim(strtr(dirname($this->_path),'\\','/').'/'.$file,'/');
$str.="$type: $file
";
}
}
}
closedir($dh);
$this->SourceList->Text=$str;
}
$this->SourceView->Text=highlight_string(file_get_contents($this->_fullPath),true);
//$this->SourceView->Text=file_get_contents($this->_fullPath);
}
}
?>