Ejemplo n.º 1
0
if ($plxMedias->aFiles) {
    foreach ($plxMedias->aFiles as $v) {
        # Pour chaque fichier
        $isImage = in_array(strtolower($v['extension']), array('.png', '.gif', '.jpg'));
        $ordre = ++$num;
        echo '<tr class="line-' . $num % 2 . '">';
        echo '<td><input type="checkbox" name="idFile[]" value="' . $v['name'] . '" /></td>';
        echo '<td class="icon">';
        if (is_file($v['path']) and $isImage) {
            echo '<a onclick="overlay(\'' . $v['path'] . '\');return false;" title="' . plxUtils::strCheck($v['name']) . '" href="' . $v['path'] . '"><img alt="" src="' . $v['.thumb'] . '" class="thumb" /></a>';
        }
        echo '</td>';
        echo '<td>';
        echo '<a onclick="this.target=\'_blank\';return true;" title="' . plxUtils::strCheck($v['name']) . '" href="' . $v['path'] . '">' . plxUtils::strCheck($v['name']) . '</a><br />';
        if ($isImage and is_file(plxUtils::thumbName($v['path']))) {
            echo '<a onclick="this.target=\'_blank\';return true;" title="' . L_MEDIAS_THUMB . ' : ' . plxUtils::strCheck($v['name']) . '" href="' . plxUtils::thumbName($v['path']) . '">' . L_MEDIAS_THUMB . '</a> : ' . $v['thumb']['infos'][0] . ' x ' . $v['thumb']['infos'][1] . ' (' . plxUtils::formatFilesize($v['thumb']['filesize']) . ')';
        }
        echo '</td>';
        echo '<td>' . strtoupper($v['extension']) . '</td>';
        echo '<td>' . plxUtils::formatFilesize($v['filesize']) . '</td>';
        $dimensions = '&nbsp;';
        if ($isImage and (isset($v['infos']) and isset($v['infos'][0]) and isset($v['infos'][1]))) {
            $dimensions = $v['infos'][0] . ' x ' . $v['infos'][1];
        }
        echo '<td>' . $dimensions . '</td>';
        echo '<td>' . plxDate::formatDate(plxDate::timestamp2Date($v['date'])) . '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="7" class="center">' . L_MEDIAS_NO_FILE . '</td></tr>';
}
Ejemplo n.º 2
0
 /**
  * Méthode qui recréer les miniatures
  *
  * @param   files		liste des fichier à déplacer
  * @param	width		largeur des miniatures
  * @param	height		hauteur des miniatures
  * @return  boolean		faux si erreur sinon vrai
  * @author	Stephane F
  **/
 public function makeThumbs($files, $width, $height)
 {
     $count = 0;
     foreach ($files as $file) {
         $file = basename($file);
         if (is_file($this->path . $this->dir . $file)) {
             $thumName = plxUtils::thumbName($file);
             $ext = strtolower(strrchr($this->path . $this->dir . $file, '.'));
             if (in_array($ext, array('.gif', '.jpg', '.png'))) {
                 if (plxUtils::makeThumb($this->path . $this->dir . $file, $this->path . $this->dir . $thumName, $width, $height, 80)) {
                     $count++;
                 }
             }
         }
     }
     if (sizeof($files) == 1) {
         if ($count == 0) {
             return plxMsg::Error(L_PLXMEDIAS_RECREATE_THUMB_ERR);
         } else {
             return plxMsg::Info(L_PLXMEDIAS_RECREATE_THUMB_SUCCESSFUL);
         }
     } else {
         if ($count == 0) {
             return plxMsg::Error(L_PLXMEDIAS_RECREATE_THUMBS_ERR);
         } else {
             return plxMsg::Info(L_PLXMEDIAS_RECREATE_THUMBS_SUCCESSFUL);
         }
     }
 }