Esempio n. 1
0
function display_dir_tree($folder, $ident)
{
    global $CONFIG, $lang_search_new_php;
    //$PHP_SELF,
    $dir_path = $CONFIG['fullpath'] . $folder;
    if (!is_readable($dir_path)) {
        return;
    }
    $dir = opendir($dir_path);
    static $dirCounter = 0;
    while ($file = readdir($dir)) {
        // loop looking for files - start
        if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file, 0, 1) != "." && strpos($file, "'") == FALSE && strpos($file, trim($CONFIG['userpics'], '/')) === FALSE && strpos($file, 'edit') === FALSE && strpos($file, 'CVS') === FALSE) {
            $start_target = $folder . $file;
            $dir_path = $CONFIG['fullpath'] . $folder . $file;
            $warnings = '';
            if (!is_writable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_ro'];
            }
            if (!is_readable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_cant_read'];
            }
            if ($warnings) {
                $warnings = '&nbsp;&nbsp;&nbsp;<b>' . $warnings . '<b>';
            }
            echo <<<EOT
                            <tr>
                                    <td class="tableb">
                                            {$ident}<img src="images/folder.gif" border="0" alt="" />&nbsp;<a href= "{$_SERVER['PHP_SELF']}?startdir={$start_target}">{$file}</a>{$warnings}
                                    </td>
                            </tr>
EOT;
            $dirCounter++;
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    // loop looking for files - end
    closedir($dir);
    if ($dirCounter == 0) {
        echo '
                        <tr>
                                <td class="tableb">';
        echo '                                   ' . sprintf($lang_search_new_php['no_folders'], trim($CONFIG['fullpath'], '/'), trim($CONFIG['fullpath'], '/'), trim($CONFIG['userpics'], '/'));
        echo '
                                    </td>
                        </tr>';
    }
}
Esempio n. 2
0
function display_dir_tree($folder, $ident)
{
    global $CONFIG, $lang_search_new_php, $CPG_PHP_SELF;
    //$PHP_SELF,
    $dir_path = $CONFIG['fullpath'] . $folder;
    if (!is_readable($dir_path)) {
        return;
    }
    $dir = opendir($dir_path);
    static $dirCounter = 0;
    $folder_icon = cpg_fetch_icon('folder', 0);
    while (($file = readdir($dir)) !== FALSE) {
        // loop looking for files - start
        if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file, 0, 1) != "." && strpos($file, "'") == FALSE && strpos($file, trim($CONFIG['userpics'], '/')) === FALSE && strpos($file, 'edit') === FALSE && strpos($file, '.svn') === FALSE) {
            $start_target = $folder . $file;
            $dir_path = $CONFIG['fullpath'] . $folder . $file;
            $warnings = '';
            if (!is_writable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_ro'];
            }
            if (!is_readable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_cant_read'];
            }
            if ($warnings) {
                $warnings = '&nbsp;&nbsp;&nbsp;<strong>' . $warnings . '<strong>';
            }
            echo <<<EOT
                            <tr>
                                    <td class="tableb">
                                            {$ident}{$folder_icon}&nbsp;<a href= "{$CPG_PHP_SELF}?startdir={$start_target}">{$file}</a>{$warnings}
                                    </td>
                            </tr>
EOT;
            $dirCounter++;
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    // loop looking for files - end
    closedir($dir);
    if ($dirCounter == 0) {
        echo '
                        <tr>
                                <td class="tableb">';
        echo '                                   ' . sprintf($lang_search_new_php['no_folders'], trim($CONFIG['fullpath'], '/'), trim($CONFIG['fullpath'], '/'), trim($CONFIG['userpics'], '/'));
        echo '
                                    </td>
                        </tr>';
    }
}
Esempio n. 3
0
function display_dir_tree($folder, $ident)
{
    global $xoopsModuleConfig, $PHP_SELF;
    $dir_path = XOOPS_ROOT_PATH . "/modules/xcgal/" . $xoopsModuleConfig['fullpath'] . $folder;
    if (!is_readable($dir_path)) {
        return;
    }
    $dir = opendir($dir_path);
    while ($file = readdir($dir)) {
        if (is_dir(XOOPS_ROOT_PATH . "/modules/xcgal/" . $xoopsModuleConfig['fullpath'] . $folder . $file) && $file != "." && $file != "..") {
            $start_target = $folder . $file;
            $dir_path = XOOPS_ROOT_PATH . "/modules/xcgal/" . $xoopsModuleConfig['fullpath'] . $folder . $file;
            $warnings = '';
            if (!is_writable($dir_path)) {
                $warnings .= _AM_SRCHNEW_DIR_RO;
            }
            if (!is_readable($dir_path)) {
                $warnings .= _AM_SRCHNEW_CANT_READ;
            }
            if ($warnings) {
                $warnings = '&nbsp;&nbsp;&nbsp;<b>' . $warnings . '<b>';
            }
            echo <<<EOT
                        <tr>
                                <td class="even">
                                        {$ident}<img src="../images/folder.gif" alt="">&nbsp;<a href= "{$PHP_SELF}?startdir={$start_target}">{$file}</a>{$warnings}
                                </td>
                        </tr>
EOT;
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    closedir($dir);
}
function display_dir_tree($folder, $ident)
{
    global $CONFIG, $PHP_SELF, $lang_search_new_php;
    $dir_path = $CONFIG['fullpath'] . $folder;
    if (!is_readable($dir_path)) {
        return;
    }
    $dir = opendir($dir_path);
    while ($file = readdir($dir)) {
        //if (is_dir($CONFIG['fullpath'] . $folder . $file) && $file != "." && $file != "..") { // removed by following line for 'do not show folders with dots': gaugau 03-11-02
        if (is_dir($CONFIG['fullpath'] . $folder . $file) && substr($file, 0, 1) != "." && strpos($file, "'") == FALSE && $file != "userpics" && $file != "edit") {
            $start_target = $folder . $file;
            $dir_path = $CONFIG['fullpath'] . $folder . $file;
            $warnings = '';
            if (!is_writable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_ro'];
            }
            if (!is_readable($dir_path)) {
                $warnings .= $lang_search_new_php['dir_cant_read'];
            }
            if ($warnings) {
                $warnings = '&nbsp;&nbsp;&nbsp;<b>' . $warnings . '<b>';
            }
            echo <<<EOT
                        <tr>
                                <td class="tableb">
                                        {$ident}<img src="images/folder.gif" alt="" />&nbsp;<a href= "{$PHP_SELF}?startdir={$start_target}">{$file}</a>{$warnings}
                                </td>
                        </tr>
EOT;
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    closedir($dir);
}
Esempio n. 5
0
function display_dir_tree($folder, $ident)
{
    global $CONFIG, $THEME_DIR;
    $dir_path = $CONFIG['fullpath'] . $folder;
    if (!is_readable($dir_path)) {
        return;
    }
    $dir = opendir($dir_path);
    $files = array();
    while ($file = readdir($dir)) {
        $files[] = $file;
    }
    natcasesort($files);
    foreach ($files as $file) {
        if (is_dir($CONFIG['fullpath'] . $folder . $file) && $file != "." && $file != ".." && $file != "CVS") {
            $start_target = $folder . $file;
            $dir_path = $CONFIG['fullpath'] . $folder . $file;
            $warnings = '';
            if (!is_writable($dir_path)) {
                $warnings .= DIR_RO;
            }
            if (!is_readable($dir_path)) {
                $warnings .= DIR_CANT_READ;
            }
            if ($warnings) {
                $warnings = '&nbsp;&nbsp;&nbsp;<b>' . $warnings . '<b>';
            }
            echo '<tr>
				<td class="tableb">
					' . $ident . '<img src="' . $THEME_DIR . '/images/folder.gif" alt="" />&nbsp;<a href= "' . URL::index("&amp;file=searchnew&amp;startdir=" . $start_target, false) . '">' . $file . '</a>' . $warnings . '
				</td>
			</tr>
';
            display_dir_tree($folder . $file . '/', $ident . '&nbsp;&nbsp;&nbsp;&nbsp;');
        }
    }
    closedir($dir);
}