forked from newscoop/theme-JournalB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobile_resources.tpl
61 lines (48 loc) · 882 Bytes
/
mobile_resources.tpl
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
49
50
51
52
53
54
55
56
57
58
59
60
61
{{ php }}
header('Content-type: application/json');
$path_to_theme = "themes/publication_1/theme_1/";
$folders = array("_css","_js","_css/webfonts","_img");
$data = array();
$data["files"] = array();
$data["images"] = array();
if (isset($_GET["retina"]) && $_GET["retina"]==1)
{
$retina = true;
}
else
{
$retina = false;
}
foreach ($folders as $folder)
{
$files = glob($path_to_theme.$folder."/*.*");
foreach ($files as $file)
{
if (strstr($file,"~web"))
{
if (strstr($file,"@2x"))
{
if (!$retina) continue;
}
else
{
if ($retina) continue;
}
}
$dfile = array();
$dfile["url"] = "/".$file;
$dfile["time"] = filemtime($file);
if ($folder=="_img")
{
$data["images"][] = $dfile;
}
else
{
$data["files"][] = $dfile;
}
}
}
$json = json_encode($data);
$json = str_replace('\\','',$json);
echo $json;
{{ /php }}