Beispiel #1
0
 public function getImageFileName($imageFilename, $fileName = '', $type = 1, $iconSize = 16)
 {
     $name['filenamestyle'] = '';
     $name['filenamethumb'] = '';
     if ($imageFilename != '') {
         $thumbnail = false;
         $thumbnail = preg_match("/phocathumbnail/i", $imageFilename);
         if ($thumbnail) {
             $name['filenamethumb'] = '<div class="pdfv-image-file-thumb" >' . '<img src="' . $this->cssImagePath . $imageFilename . '" alt="" /></div>';
             $name['filenamestyle'] = '';
         } else {
             $name['filenamethumb'] = '';
             $name['filenamestyle'] = 'style="background: url(\'' . $this->cssImagePath . $imageFilename . '\') 0 center no-repeat;"';
         }
     } else {
         $file_icon_mime = $this->params->get('file_icon_mime', 1);
         if ($fileName != '' && $file_icon_mime == 1) {
             if ($type == 3) {
                 // Plugin
                 $file_icon_size = $iconSize;
             } else {
                 if ($type == 2) {
                     $file_icon_size = $this->params->get('file_icon_size_md', 16);
                 } else {
                     $file_icon_size = $this->params->get('file_icon_size', 16);
                 }
             }
             $icon = PhocaDownloadFile::getMimeTypeIcon($fileName, (int) $file_icon_size, 1);
             $name['filenamethumb'] = '';
             $name['filenamestyle'] = $icon;
         }
     }
     return $name;
 }
Beispiel #2
0
<?php defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.filesystem.file' );

$ext 	= PhocaDownloadFile::getExtension( $this->_tmp_file->path_without_name_relative );
$group 	= PhocaDownloadSettings::getManagerGroup($this->manager);


if ($this->manager == 'filemultiple') {
	$checked 	= JHTML::_('grid.id', $this->filei + count($this->folders), $this->files[$this->filei]->path_with_name_relative_no );
	
	$icon		= PhocaDownloadFile::getMimeTypeIcon($this->_tmp_file->name);
	echo '<tr>'
	.' <td>'. $checked .'</td>'
	.' <td class="ph-img-table">'
	. $icon .'</a></td>'
	.' <td>' . $this->_tmp_file->name . '</td>'
	.'</tr>';
	
	
} else {
	if (($group['i'] == 1) && ($ext == 'png' || $ext == 'jpg' || $ext == 'gif' || $ext == 'jpeg') ) {
		
		echo '<tr>'
		.'<td></td>'
		.'<td>'
		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' .$this->_tmp_file->path_with_name_relative_no.'\')">'
		. JHTML::_( 'image', str_replace( '../', '', $this->_tmp_file->path_without_name_relative), JText::_('COM_PHOCADOWNLOAD_INSERT'), array('title' => JText::_('COM_PHOCADOWNLOAD_INSERT_ICON')))
		.'</a>'
		.' <td>'
		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' . $this->_tmp_file->path_with_name_relative_no.'\')">'