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 = []; ...@@ -6,12 +6,18 @@ var markers = [];
$(function(){ $(function(){
//init(); //init();
parseURL();
init_maps(); init_maps();
var url = 'list.php';
if (SETTINGS.showall){
url += "?showall";
}
$.ajax({ $.ajax({
url: "list.php", url: url,
success: function(response){ success: function(response){
List = response; List = response;
...@@ -24,6 +30,21 @@ $(function(){ ...@@ -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){ function parse_list(res){
var index = 0; var index = 0;
......
...@@ -5,7 +5,13 @@ $base = "models"; ...@@ -5,7 +5,13 @@ $base = "models";
$THUMBNAME = "thumb.jpeg"; $THUMBNAME = "thumb.jpeg";
$READMENAME = "README.txt"; $READMENAME = "README.txt";
$models = selective_scandir($base); $showall = false;
if (isset($_GET['showall'])){
$showall = true;
}
$models = selective_scandir($base,false);
$res = ""; $res = "";
foreach($models as $model){ foreach($models as $model){
...@@ -13,7 +19,7 @@ foreach($models as $model){ ...@@ -13,7 +19,7 @@ foreach($models as $model){
$model_path = "$base/$model"; $model_path = "$base/$model";
$thumb = "$model_path/$THUMBNAME"; $thumb = "$model_path/$THUMBNAME";
$versions = selective_scandir($model_path); $versions = selective_scandir($model_path,$showall);
// create thumb // create thumb
create_thumbnail($model_path,$versions,$thumb); create_thumbnail($model_path,$versions,$thumb);
...@@ -51,7 +57,7 @@ return_xml($res); ...@@ -51,7 +57,7 @@ return_xml($res);
//functions //functions
function selective_scandir($path){ function selective_scandir($path,$showall){
$results = Array(); $results = Array();
...@@ -59,10 +65,17 @@ function selective_scandir($path){ ...@@ -59,10 +65,17 @@ function selective_scandir($path){
foreach($contents as $item){ foreach($contents as $item){
if ($item!='.'&&$item!='..'&&is_dir("$path/$item")){ if ($item!='.'&&$item!='..'&&is_dir("$path/$item")){
if ($showall){
array_push($results,$item);
}else{
if (($item[0]!=".")&&($item[0]!="_")){
array_push($results,$item); array_push($results,$item);
} }
} }
}
}
return $results; 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