コード例 #1
0
                if ($include && !preg_match($include, $url) || $exclude && preg_match($exclude, $url)) {
                    continue;
                }
                $files[] = array('url' => $url);
            }
        }
    }
    @closedir($dh);
    return dirsort($files);
}
function dbnavi()
{
    return $_SESSION['RheinaufCMSLinker'];
}
function dirsort($files)
{
    usort($files, 'dircomp');
    return $files;
}
function dircomp($a, $b)
{
    if (is_array($a)) {
        $a = array_shift($a);
    }
    if (is_array($b)) {
        $b = array_shift($b);
    }
    return strcmp(strtolower($a), strtolower($b));
}
echo xinha_to_js(array_merge(scan($dir), dbnavi()));
コード例 #2
0
            $js[] = $i;
        }
        if ($useObject) {
            $ret = "{\n" . tabify(implode(",\n", $js), $tabs) . "\n}";
        } else {
            $ret = "[\n" . tabify(implode(",\n", $js), $tabs) . "\n]";
        }
        return $ret;
    }
    return 'null';
}
function tabify($text, $tabs)
{
    if ($text) {
        return str_repeat("  ", $tabs) . preg_replace('/\\n(.)/', "\n" . str_repeat("  ", $tabs) . "\$1", $text);
    }
}
function js_encode($string)
{
    static $strings = "\\,\",',%,&,<,>,{,},@,\n,\r";
    if (!is_array($strings)) {
        $tr = array();
        foreach (explode(',', $strings) as $chr) {
            $tr[$chr] = sprintf('\\x%02X', ord($chr));
        }
        $strings = $tr;
    }
    return strtr($string, $strings);
}
echo to_js(array_merge(dbnavi(), scan($dir)));