Dotclear

Changeset 1855:bc2210b5505c


Ignore:
Timestamp:
09/14/13 17:07:36 (11 years ago)
Author:
Anne Kozlika <kozlika@…>
Branch:
default
Message:

Media.php : sémantique html, deux liens adjacents allant au même endroit, çaymal, pas de conteneur au lien aussi. + un coup de css pour une pésentation différente pour les dossiers et les fichiers. A tester sur des médiathèques diversifiées s'il vous plaît merci.

(Merci à Franck pour son aide précieuse en PHP <3)

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/media.php

    r1854 r1855  
    328328      
    329329     '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    330       
    331      for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++, $j++) 
     330 
     331     $dgroup = ''; 
     332     $fgroup = ''; 
     333     for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++,$j++) 
    332334     { 
    333           echo mediaItemLine($items[$i],$j); 
    334      } 
     335          if ($items[$i]->d) { 
     336               $dgroup .= mediaItemLine($items[$i],$j); 
     337          } else { 
     338               $fgroup .= mediaItemLine($items[$i],$j); 
     339          } 
     340     } 
     341     echo  
     342          ($dgroup != '' ? '<div class="folders-group">'.$dgroup.'</div>' : ''). 
     343          ($fgroup != '' ? '<div class="files-group">'.$fgroup.'</div>' : ''); 
    335344      
    336345     echo 
     
    474483      
    475484     $res = 
    476      '<div class="'.$class.'"><a class="media-icon media-link" href="'.$link.'">'. 
    477      '<img src="'.$f->media_icon.'" alt="" /></a>'. 
    478      '<ul>'. 
    479      '<li><a class="media-link" href="'.$link.'">'.$fname.'</a></li>'; 
     485     '<div class="'.$class.'"><p><a class="media-icon media-link" href="'.$link.'">'. 
     486     '<img src="'.$f->media_icon.'" alt="" />'.$fname.'</a></p>'; 
     487 
     488     $lst = ''; 
    480489      
    481490     if (!$f->d) { 
    482           $res .= 
     491          $lst .= 
    483492          '<li>'.$f->media_title.'</li>'. 
    484493          '<li>'. 
     
    489498     } 
    490499      
    491      $res .= '<li class="media-action">&nbsp;'; 
     500     $act = ''; 
    492501      
    493502     if ($post_id && !$f->d) { 
    494           $res .= '<form action="post_media.php" method="post">'. 
     503          $act .=  
     504          '<form action="post_media.php" method="post">'. 
    495505          '<input type="image" src="images/plus.png" alt="'.__('Attach this file to entry').'" '. 
    496506          'title="'.__('Attach this file to entry').'" /> '. 
     
    503513      
    504514     if ($popup && !$f->d) { 
    505           $res .= '<a href="'.$link.'"><img src="images/plus.png" alt="'.__('Insert this file into entry').'" '. 
     515          $act .= '<a href="'.$link.'"><img src="images/plus.png" alt="'.__('Insert this file into entry').'" '. 
    506516          'title="'.__('Insert this file into entry').'" /></a> '; 
    507517     } 
    508518      
    509519     if ($f->del) { 
    510           $res .= '<a class="media-remove" '. 
     520          $act .= '<a class="media-remove" '. 
    511521          'href="'.html::escapeURL($page_url).'&amp;d='. 
    512522          rawurlencode($GLOBALS['d']).'&amp;remove='.rawurlencode($f->basename).'">'. 
     
    514524     } 
    515525      
    516      $res .= '</li>'; 
     526     $lst .= ($act != '' ? '<li class="media-action">&nbsp;'.$act.'</li>' : ''); 
    517527      
    518528     if ($f->type == 'audio/mpeg3') { 
    519           $res .= '<li>'.dcMedia::mp3player($f->file_url,'index.php?pf=player_mp3.swf').'</li>'; 
    520      } 
    521       
    522      $res .= '</ul></div>'; 
     529          $lst .= '<li>'.dcMedia::mp3player($f->file_url,'index.php?pf=player_mp3.swf').'</li>'; 
     530     } 
     531      
     532     $res .=   ($lst != '' ? '<ul>'.$lst.'</ul>' : ''); 
     533 
     534     $res .= '</div>'; 
    523535      
    524536     return $res; 
  • admin/style/default.css

    r1854 r1855  
    16091609          } 
    16101610/* ------------------------------------------------------------------ media.php */ 
    1611 .media-list { 
    1612      position: static; 
    1613      } 
    16141611.media-item { 
    16151612     position: relative; 
     
    16221619     min-height: 120px 
    16231620     } 
    1624      .media-folder { 
    1625           background: transparent url(bg_menu.png) repeat-y; 
    1626           border-left-color: #f9b233; 
    1627           } 
    1628      .media-folder-up { 
    1629           border: none; 
    1630           } 
    16311621     .media-item ul { 
    16321622          display: block; 
     
    16351625          padding: 0; 
    16361626          } 
    1637      .media-folder ul, .media-folder img { 
    1638           padding-left: 2em; 
    1639           } 
    16401627     a.media-icon { 
    16411628          display: block; 
     
    16461633               display: block; 
    16471634               } 
     1635     .media-link { 
     1636          font-size: 1.1em; 
     1637          } 
    16481638.media-action-box { 
    16491639     position: relative; 
     
    16681658          border: none; 
    16691659          } 
     1660.folders-group .media-item { 
     1661     min-height: 60px; 
     1662     border-color: #eee #eee #eee #eee; 
     1663     } 
     1664     .folders-group .media-item p { 
     1665          margin-bottom: 0; 
     1666          } 
     1667     .media-folder { 
     1668          background: transparent url(bg_menu.png) repeat-y; 
     1669          } 
     1670     .media-folder-up { 
     1671          border: none; 
     1672          padding-bottom: 0; 
     1673          } 
     1674     .media-folder .media-link { 
     1675          font-size: 1.25em; 
     1676          margin-left: 2em; 
     1677          color: #676e78; 
     1678          border-bottom: none; 
     1679          } 
     1680 
    16701681.zip-dl { 
    16711682     background: transparent url(package.png) no-repeat 0 50%; 
  • inc/core/class.dc.media.php

    r1850 r1855  
    462462          $this->dir['files'] = $f_res; 
    463463          foreach ($this->dir['dirs'] as $k => $v) { 
    464                $v->media_icon = sprintf($this->icon_img,($k == '..' ? 'folder-up' : 'folder')); 
     464               $v->media_icon = sprintf($this->icon_img,($v->parent ? 'folder-up' : 'folder')); 
    465465          } 
    466466           
Note: See TracChangeset for help on using the changeset viewer.

Sites map