Changeset 57 for trunk/plugins/Linker/scan.php
- Timestamp:
- 04/04/05 07:23:56 (7 years ago)
- Files:
-
- 1 modified
-
trunk/plugins/Linker/scan.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/Linker/scan.php
r21 r57 62 62 if($subdir = scan($path, $url)) 63 63 { 64 $files[] = array( $url,$subdir);64 $files[] = array('url'=>$url, 'children'=>$subdir); 65 65 } 66 66 } … … 68 68 { 69 69 if(($include && !preg_match($include, $url)) || ($exclude && preg_match($exclude, $url))) continue; 70 $files[] = $url;70 $files[] = array('url'=>$url); 71 71 } 72 72 … … 104 104 if(is_array($var)) 105 105 { 106 $useObject = false; 107 foreach(array_keys($var) as $k) { 108 if(!is_numeric($k)) $useObject = true; 109 } 106 110 $js = array(); 107 111 foreach($var as $k => $v) 108 112 { 109 $js[] = to_js($v, $tabs + 1); 113 $i = ""; 114 if($useObject) { 115 if(preg_match('#[a-zA-Z]+[a-zA-Z0-9]*#', $k)) { 116 $i .= "$k: "; 117 } else { 118 $i .= "'$k': "; 119 } 120 } 121 $i .= to_js($v, $tabs + 1); 122 $js[] = $i; 110 123 } 111 return "[\n" . tabify(implode(",\n", $js), $tabs) . "\n]"; 124 if($useObject) { 125 $ret = "{\n" . tabify(implode(",\n", $js), $tabs) . "\n}"; 126 } else { 127 $ret = "[\n" . tabify(implode(",\n", $js), $tabs) . "\n]"; 128 } 129 return $ret; 112 130 } 113 131
