forked from MaxPovver/fl-ru-damp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__css_blocks.php
48 lines (40 loc) · 1015 Bytes
/
__css_blocks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
define('BASE_PATH','/var/www/_beta/html');
define('BASE_HOST','http://beta.fl.ru');
$dirs = array(
//'/html/main2013/',
'CSS Blocks' => '/css/block/'//,
//'HTML' => '/html/main2013/'
);
?>
<style>
table td {vertical-align: top;}
</style>
<table width="100%">
<tr>
<td>
<?php
$idx = 0;
foreach($dirs as $key => $path)
{
echo '<h1>' . $key . '</h1>';
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(BASE_PATH . $path), RecursiveIteratorIterator::SELF_FIRST);
$objects = new RegexIterator($objects, '/^.+\.(css|php|html)$/i', RecursiveRegexIterator::GET_MATCH);
if(count($objects))
{
foreach($objects as $name => $object)
{
$link = BASE_HOST . str_replace(BASE_PATH, '', $object[0]);
?>
<a target="_blank" href="<?=$link?>"><?=$link?></a><br/>
<?php
}
}
$idx++;
if(count($dirs) > $idx) echo '</td><td>';
}
?>
</td>
</tr>
</table>
<?php