Commit 0c2397ec authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

hide dirs: .xxx and _xxx, 'showall' to reveal

parent 94c70f40
......@@ -6,12 +6,18 @@ var markers = [];
$(function(){
//init();
parseURL();
init_maps();
var url = 'list.php';
if (SETTINGS.showall){
url += "?showall";
}
$.ajax({
url: "list.php",
url: url,
success: function(response){
List = response;
......@@ -24,6 +30,21 @@ $(function(){
});
var SETTINGS = {
'showall':false
};
// no comments
function parseURL(){
var parameters=location.href.replace(/\?/ig,"&").split("&");
for (var i=0;i<parameters.length;i++) parameters[i]=parameters[i].split("=");
for (var i=1;i<parameters.length;i++) {
switch (parameters[i][0]) {
case "showall": SETTINGS.showall = true; break;
}
}
}
function parse_list(res){
var index = 0;
......
......@@ -5,7 +5,13 @@ $base = "models";
$THUMBNAME = "thumb.jpeg";
$READMENAME = "README.txt";
$models = selective_scandir($base);
$showall = false;
if (isset($_GET['showall'])){
$showall = true;
}
$models = selective_scandir($base,false);
$res = "";
foreach($models as $model){
......@@ -13,7 +19,7 @@ foreach($models as $model){
$model_path = "$base/$model";
$thumb = "$model_path/$THUMBNAME";
$versions = selective_scandir($model_path);
$versions = selective_scandir($model_path,$showall);
// create thumb
create_thumbnail($model_path,$versions,$thumb);
......@@ -51,7 +57,7 @@ return_xml($res);
//functions
function selective_scandir($path){
function selective_scandir($path,$showall){
$results = Array();
......@@ -59,10 +65,17 @@ function selective_scandir($path){
foreach($contents as $item){
if ($item!='.'&&$item!='..'&&is_dir("$path/$item")){
if ($showall){
array_push($results,$item);
}else{
if (($item[0]!=".")&&($item[0]!="_")){
array_push($results,$item);
}
}
}
}
return $results;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment