Exemplo n.º 1
0
 /**
  *
  * @param Tx_Feupload_Domain_Model_File $file            
  */
 protected function _getFileType($file)
 {
     switch ($file->getFileExt()) {
         case 'jpg':
         case 'png':
         case 'gif':
         case 'tiff':
             $ret = 'picture';
             break;
         case 'doc':
         case 'docx':
             $ret = 'doc';
             break;
         case 'html':
         case 'htm':
             $ret = 'html';
             break;
         case 'pdf':
             $ret = 'pdf';
             break;
         case 'ppt':
         case 'pptx':
             $ret = 'ppt';
             break;
         case 'rar':
         case 'zip':
         case 'gz':
             return 'zip';
             break;
         default:
             $ret = 'file';
             break;
     }
     return $ret;
 }
Exemplo n.º 2
0
 /**
  * @param		Tx_Feupload_Domain_Model_File		$file			File object
  */
 public function render($file)
 {
     $currentConf['labelStdWrap.']['cObject'] = 'TEXT';
     $currentConf['labelStdWrap.']['cObject.']['value'] = $file->getTitle();
     $conf = array_merge($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_feupload.']['file.'], $currentConf);
     $conf['ATagParams'] = 'class="file download ' . $file->getFileExt() . '"';
     return $GLOBALS['TSFE']->cObj->filelink($file->getFile(), $conf);
 }