-
Notifications
You must be signed in to change notification settings - Fork 1
/
resource.php
133 lines (117 loc) · 4.82 KB
/
resource.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
$showchildren = "n";
$showsiblings = "n";
$titleoverride = "";
include("./inc/head.php");
$image = $page->image;
if ($image) {
$img_sized = $image->size(600);
$img = "<div class='pull-right col-sm-6'>
<img src='{$img_sized->url}' class='img-responsive thumbnail' alt='{$page->image->description}'>
</div>";
}
?>
<div class="row">
<div class="col-sm-9">
<div class="content-space content-border"><h2 class='page-title'><?=$page->title; ?></h2>
<?=$img; $page->image; ?>
<span class='bodytext'><?=$page->body; ?> </span>
<div class='row padding-bottom-xs padding-top-xs'>
<? $matches = $page->children->find("sort=sort");
foreach($matches as $match) {
$image = $match->image;
if ($image) {
$img_sized = $image->size(300);
}
echo "
<div class='col-sm-3 col-xs-6 text-center padding-bottom-md'>
<a class='margin-xs' href='{$match->url}' title='{$match->title}'>
<div class='padding-left-lg padding-right-lg'><img src='{$img_sized->url}' class='img-responsive' alt='{$match->title}'></a></div>
<a class='black' href='{$match->url}' title='{$match->title}'><span class='text-padding-tight'>{$match->title}</span></a>
</div>
";
}
?></div>
<div class='row padding-bottom-xs padding-top-xs'>
<? $matches = $page->resource_repeater;
foreach($matches as $match) {
// Check to see if files exist
if($match->files) {
// Loop
foreach($match->files as $temp) {
// Check extension
if($temp->ext) {
$tempext = " (".$temp->ext.")";
}
// Check if description provided... if not use file name
if(!$temp->description) {
$description = $temp->name;
} else {
$description = $temp->description;
}
// Add to resource var
$resource .="<li><a href='{$temp->url}' title='{$description}' target='_blank' onClick=\"_gaq.push(['_trackEvent', 'resource', '', '{$temp->description}', 1, true]);\"><span class='glyphicon glyphicon-file'></span> {$description} {$tempext}</a></li>";
}
// Unset temp vars
unset($temp);
unset($tempext);
unset($description);
}
// Check to see if images exist
if($match->images) {
// Loop
foreach($match->images as $temp) {
// Check extension
if($temp->ext) {
$tempext = " (".$temp->ext.")";
}
// Check if description provided... if not use file name
if(!$temp->description) {
$description = $temp->name;
} else {
$description = $temp->description;
}
// Add to resource var
$resource .="<li><a href='{$temp->url}' title='{$description}' target='_blank' onClick=\"_gaq.push(['_trackEvent', 'resource', '', '{$temp->description}', 1, true]);\"><span class='glyphicon glyphicon-picture'></span> {$description} {$tempext}</a></li>";
}
// Unset temp vars
unset($temp);
unset($tempext);
unset($description);
}
// Check to see if page exist
if($match->relate_pages) {
// Loop
foreach($match->relate_pages as $temp) {
// Add to resource var
$resource .="<li><a href='{$temp->url}' title='{$temp->title}'><span class='glyphicon glyphicon-link'></span> {$temp->title}</a></li>";
}
// Unset temp vars
unset($temp);
unset($tempext);
}
if($match->url_website) {
$tempval = parse_url($match->url_website);
$tempval = $tempval['host'];
$resource .="<li><a href='{$match->url_website}' title='{$match->url_website}' target='_blank' onClick=\"_gaq.push(['_trackEvent', 'resource', '', '{$match->url_website}', 1, true]);\"><span class='glyphicon glyphicon-new-window'></span> {$tempval}</a></li>";
}
if($resource) {
$resource_list ="<ul class='list-unstyled padding-left-sm'>{$resource}</ul>";
}
echo "
<div class='col-xs-11 margin-bottom-xl margin-left-xl padding-left-xl border-left-xl'>
<h4>{$match->label}</h4>
{$match->body}
{$resource_list}
{$match->textarea_links}
</div>
";
unset($resource);
unset($resource_list);
}
?></div>
<? include("./inc/inc_files.php"); ?>
</div></div>
<? include("./inc/nav_well.php"); ?>
</div>
<? include("./inc/foot.php");