Dotclear

Changeset 2651:f691be17b0a9 for plugins


Ignore:
Timestamp:
02/07/14 12:32:58 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

One loop is better than three, addresses #1704

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/themeEditor/class.themeEditor.php

    r2647 r2651  
    5757          $list = ''; 
    5858          if ($split) { 
    59                // First part for current theme 
    60                $list_theme = ''; 
     59               $list_theme = '';   // Files from current theme 
     60               $list_parent = '';  // Files from parent of current theme 
     61               $list_tpl = '';          // Files from template set used by current theme 
    6162               foreach ($files as $k => $v) 
    6263               { 
     
    6465                         $li = sprintf('<li class="default-file">%s</li>',$item); 
    6566                         $list_theme .= sprintf($li,$k,html::escapeHTML($k)); 
    66                     } 
    67                } 
    68                // Second part for parent theme if any 
    69                $list_parent = ''; 
    70                foreach ($files as $k => $v) 
    71                { 
    72                     if ((strpos($v,$this->user_theme) !== 0) && ($this->parent_theme && strpos($v,$this->parent_theme) === 0)) { 
     67                    } elseif ($this->parent_theme && strpos($v,$this->parent_theme) === 0) { 
    7368                         $li = sprintf('<li class="parent-file">%s</li>',$item); 
    7469                         $list_parent .= sprintf($li,$k,html::escapeHTML($k)); 
    75                     } 
    76                } 
    77                // Third part for template set 
    78                $list_tpl = ''; 
    79                foreach ($files as $k => $v) 
    80                { 
    81                     if ((strpos($v,$this->user_theme) !== 0) && ($this->parent_theme && strpos($v,$this->parent_theme) !== 0)) { 
     70                    } else { 
    8271                         $li = sprintf('<li>%s</li>',$item); 
    8372                         $list_tpl .= sprintf($li,$k,html::escapeHTML($k)); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map