Dotclear

Changeset 1773:1f2fd319f35e


Ignore:
Timestamp:
09/10/13 11:09:34 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

My prefs :

  • display only unused favs in available favs list
  • add a mention for default favorites in available favs list
  • ignore hidden iconset folders (name starting with a dot)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/preferences.php

    r1764 r1773  
    6767     if (($d = @dir($iconsets_root)) !== false) { 
    6868          while (($entry = $d->read()) !== false) { 
    69                if ($entry != '.' && $entry != '..' && is_dir($iconsets_root.'/'.$entry)) { 
     69               if ($entry != '.' && $entry != '..' && substr($entry, 0, 1) != '.' && is_dir($iconsets_root.'/'.$entry)) { 
    7070                    $iconsets_combo[$entry] = $entry; 
    7171               } 
     
    553553 
    554554$count = 0; 
     555$user_fav = array(); 
    555556foreach ($ws->dumpPrefs() as $k => $v) { 
    556557     // User favorites only 
     
    566567                    form::checkbox(array('remove[]','fuk-'.$k),$k).__($fav['title']).'</label>'. 
    567568                    '</li>'; 
     569               $user_fav[] = $fav['name']; 
    568570          } 
    569571     } 
     
    596598} 
    597599 
    598 /* 
    599 echo '<div id="default-favs"><h3>'.__('Default favorites').'</h3>'; 
    600 echo '<p>'.__('Those favorites are displayed when My Favorites list is empty.').'</p>'; 
    601 $count = 0; 
     600$default_fav = array(); 
    602601foreach ($ws->dumpPrefs() as $k => $v) { 
    603602     // Global favorites only 
     
    605604          $fav = unserialize($v['value']); 
    606605          if (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)) { 
    607                if ($count == 0) echo '<ul class="fav-list">'; 
    608                $count++; 
    609                echo '<li id="fd-'.$k.'">'. 
    610                '<img src="'.dc_admin_icon_url($fav['small-icon']).'" alt="" /> '.__($fav['title']).'</li>'; 
    611           } 
    612      } 
    613 }     
    614 if ($count > 0) echo '</ul>'; 
    615 echo '</div>'; 
    616 */ 
     606               $default_fav[] = $fav['name']; 
     607          } 
     608     } 
     609} 
    617610 
    618611echo '</div>'; # /box my-fav 
    619612 
    620613echo '<div class="fieldset" id="available-favs">'; 
    621 # Available favorites ------------------------------------- Ici, si possible afficher plutôt les Autres favoris disponibles 
     614# Available favorites 
    622615echo '<h5>'.__('Available favorites').'</h5>'; 
    623616$count = 0; 
     
    633626foreach ($array as $k => $fav) { 
    634627     if (($fav[5] == '*') || $core->auth->check($fav[5],$core->blog->id)) { 
    635           if ($count == 0) echo '<ul class="fav-list">'; 
    636           $count++; 
    637           echo '<li id="fa-'.$fav[0].'">'.'<label for="fak-'.$fav[0].'">'. 
    638                '<img src="'.dc_admin_icon_url($fav[3]).'" alt="" /> '. 
    639                '<span class="zoom"><img src="'.dc_admin_icon_url($fav[4]).'" alt="" /></span>'. 
    640                form::checkbox(array('append[]','fak-'.$fav[0]),$k). 
    641                __($fav[1]).'</label>'.'</li>'; 
    642      } 
    643 }     
     628          if (!in_array($fav[0], $user_fav)) { 
     629               if ($count == 0) echo '<ul class="fav-list">'; 
     630               $count++; 
     631               echo '<li id="fa-'.$fav[0].'">'.'<label for="fak-'.$fav[0].'">'. 
     632                    '<img src="'.dc_admin_icon_url($fav[3]).'" alt="" /> '. 
     633                    '<span class="zoom"><img src="'.dc_admin_icon_url($fav[4]).'" alt="" /></span>'. 
     634                    form::checkbox(array('append[]','fak-'.$fav[0]),$k). 
     635                    __($fav[1]).'</label>'. 
     636                    (in_array($fav[0], $default_fav) ? ' <span class="default-fav">'.__('(default favorite)').'</span>' : ''). 
     637                    '</li>'; 
     638          } 
     639     } 
     640} 
    644641if ($count > 0) echo '</ul>'; 
    645642echo 
Note: See TracChangeset for help on using the changeset viewer.

Sites map