Changeset 134

Show
Ignore:
Timestamp:
04/15/06 15:30:39 (3 years ago)
Author:
michiel
Message:

Get rid of useles exec call.

Re #56

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/functions_blog.php

    r133 r134  
    326326//-------------------------------------------------------- 
    327327function blog_show_styleswitcher() { 
    328         exec("ls style", $dirindex); 
    329         foreach ($dirindex as $v) { 
    330                 if (is_dir("style/".$v) && file_exists("style/".$v."/index.css")) { 
    331                         $stylename[] = $v; 
    332                 } 
    333         } 
    334         if (count($stylename)) { 
    335                 ?> 
    336                 <select name="styleswitchselect" id="styleswitchselect" onchange="switchstyle();"> 
    337                         <? foreach ($stylename as $v) { ?> 
    338                                 <? if ($v == $_SESSION["style"]) { $selected="selected=\"selected\""; } else { $selected=""; } ?> 
    339                                 <option value="<?=$v?>" <?=$selected?>><?=$v?></option> 
    340                         <? } ?> 
    341                 </select> 
    342                 <script language="Javascript1.2" type="text/javascript" src="common/js/styleswitcher.js"></script> 
    343                 <? 
     328        if ($dh = opendir("style")) { 
     329                while (false !== ($v = readdir($dh))) { 
     330                        if (is_dir("style/".$v) && file_exists("style/".$v."/index.css")) { 
     331                                $stylename[] = $v; 
     332                        } 
     333                } 
     334                if (count($stylename)) { 
     335                        ?> 
     336                        <select name="styleswitchselect" id="styleswitchselect" onchange="switchstyle();"> 
     337                                <? foreach ($stylename as $v) { ?> 
     338                                        <? if ($v == $_SESSION["style"]) { $selected="selected=\"selected\""; } else { $selected=""; } ?> 
     339                                        <option value="<?=$v?>" <?=$selected?>><?=$v?></option> 
     340                                <? } ?> 
     341                        </select> 
     342                        <script language="Javascript1.2" type="text/javascript" src="common/js/styleswitcher.js"></script> 
     343                        <? 
     344                } 
     345        } else { 
     346                return false; 
    344347        } 
    345348}