Changeset 30 for branches/lang_editor

Show
Ignore:
Timestamp:
02/10/09 18:06:06 (3 years ago)
Author:
daris
Message:

lang editor: small fixes

Location:
branches/lang_editor
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lang_editor/admin/lang_editor.php

    r2 r30  
    2323************************************************************************/ 
    2424 
    25  
    2625if (!defined('FORUM_ROOT')) 
    2726        define('FORUM_ROOT', '../../../'); 
     
    6362        while ($f = $d->read()) 
    6463        { 
    65                 if (substr($f, 0, 1) != '.' && $file == null) 
     64                if (substr($f, 0, 1) != '.' && $file == null && substr($f, strlen($f)-3) == 'php') 
    6665                        $file = $dir.'/'.$f; 
    6766        } 
     
    137136        $archive = FORUM_ROOT.'extensions/lang_editor/cache/'.$ext.'_'.$version.'.zip'; 
    138137         
     138        if (file_exists($archive)) 
     139                @unlink($arcive); 
     140         
    139141        $zip = new ZipArchive(); 
    140142        if ($zip->open($archive, ZIPARCHIVE::CREATE) === TRUE) 
     
    346348        while ($f = $d->read()) 
    347349        { 
    348                 if (substr($f, 0, 1) != '.' && (file_exists($dir.$f.'/lang/English') || file_exists($dir.$f.'/lang/English.php'))) 
     350                if (substr($f, 0, 1) != '.' && $f != 'index.html' /*&& (file_exists($dir.$f.'/lang/English') || file_exists($dir.$f.'/lang/English.php'))*/) 
    349351                { 
    350352                        $name = ucfirst(str_replace('_', ' ', $f)); 
     353                         
     354                        $export = ' [ <a href="'.EXT_FILE.'?act=export&amp;lang='.$lang.'&amp;ext='.$f.'">Export</a> ]'; 
    351355                        // if translated lang exists 
    352356                        if (file_exists($dir.$f.'/lang/'.$lang) || file_exists($dir.$f.'/lang/'.$lang.'.php')) 
    353                                 echo '<li><a href="'.EXT_FILE.'?lang='.$lang.'&ext='.$f.'">'.$name.'</a> [ <a href="'.EXT_FILE.'?act=export&amp;lang='.$lang.'&amp;ext='.$f.'">Export</a> ]</li>'; 
     357                                echo '<li><a href="'.EXT_FILE.'?lang='.$lang.'&ext='.$f.'">'.$name.'</a>'.$export.'</li>'; 
    354358                        else 
    355                                 echo '<li><a href="'.EXT_FILE.'?act=create&amp;lang='.$lang.'&ext='.$f.'" style="color: red">'.$name.'</a></li>'; 
     359                                echo '<li><a href="'.EXT_FILE.'?act=create&amp;lang='.$lang.'&ext='.$f.'" style="color: red">'.$name.'</a>'.$export.'</li>'; 
    356360                } 
    357361        } 
  • branches/lang_editor/include/functions.php

    r2 r30  
    120120        while ($file = $dir->read()) 
    121121        { 
    122                 if (substr($file, 0, 1) != '.') 
     122                if (substr($file, 0, 1) != '.' && !preg_match('#.diff$#', $file)) 
    123123                { 
    124124                        if (is_dir($directory.'/'.$subdir.'/'.$file))