function dir_array($dir, $chop = false) { $array = array(); $d = dir($dir); if ($chop != false && substr($dir, -1, 1) != '/') { $dir .= '/'; } if ($chop != false && substr($chop, -1, 1) != '/') { $chop .= '/'; } while (FALSE !== ($entry = $d->read())) { if ($entry != '.' && $entry != '..') { $entry = $dir . $entry; if (is_dir($entry)) { $array = array_merge($array, dir_array($entry, $chop)); } else { if ($chop != false) { $array[] = str_replace($chop, '', $entry); } else { $array[] = $entry; } } } } $d->close(); return $array; }
?> </ul> </td> </tr> </table> <?php echo foot(); } elseif ($job == 'phrase') { echo head(); $cache = array(); $diff = array(); $complete = array(); $result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language'); while ($row = $db->fetch_assoc($result)) { $cache[$row['id']] = $row; $diff[$row['id']] = dir_array('language/' . $row['id'], 'language/' . $row['id']); $complete = array_merge($complete, array_diff($diff[$row['id']], $complete)); } usort($complete, 'sort_dirlist'); $width = floor(75 / count($cache)); ?> <form name="form" method="post" action="admin.php?action=language&job=phrase_delete"> <table class="border" border="0" cellspacing="0" cellpadding="4" align="center"> <tr> <td class="obox" colspan="<?php echo count($cache) + 1; ?> "> <span style="float: right;"><a class="button" href="admin.php?action=language&job=phrase_add_lngfile"><?php echo $lang->phrase('admin_lang_add_new_langfile'); ?>