-
Notifications
You must be signed in to change notification settings - Fork 1
/
staff.php
150 lines (132 loc) · 6.06 KB
/
staff.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
$showchildren = "n";
$showsiblings = "n";
$titleoverride = "";
include("./inc/head.php");
if($page->image) {
$img_sized = $page->image->size(300)->url;
$img = "<img src='{$img_sized}' class='img img-responsive img-rounded' alt='{$match->title}'>";
} else {
$img = "<img src='{$config->urls->templates}assets/brand/icons/user.jpg' class='img img-responsive img-rounded' alt='{$match->title}'>";
}
?>
<div id="page_body" class="row">
<div class='col-sm-12 col-content'>
<div class='col-sm-9 pull-right'>
<div class='clearfix'><a href="<?=$page->parent->url ?>" class='btn btn-default pull-right'>« Return to <?=$page->parent->title ?></a></div>
<h2><?=$page->title ?></h2>
<p class='text-muted text-sm'><?=$page->staff_title ?></p>
<span class='bodytext'><?=$page->body; ?> </span>
<?
// Finds all of the working groups that this staff ID is tied with as a CHAIR.
$matches = $pages->find("template=working_group, relate_staff_chair=$page->id, sort=alphabetical");
foreach($matches as $match) {
$tempval .= "<li class='col-sm-6'><a href='{$match->url}.' title='{$match->title}.'>{$match->title} (Chair)</a></li>";
}
// Finds all of the working groups that this staff ID is tied with as a Coordinator.
$matches = $pages->find("template=working_group, relate_staff_coordinator=$page->id, sort=alphabetical");
foreach($matches as $match) {
$tempval .= "<li class='col-sm-6'><a href='{$match->url}.' title='{$match->title}.'>{$match->title} (Coordinator)</a></li>";
}
// Finds all of the working groups that this staff ID is tied with as a MEMBER.
$matches = $pages->find("template=working_group, relate_staff=$page->id, sort=alphabetical");
foreach($matches as $match) {
$tempval .= "<li class='col-sm-6'><a href='{$match->url}.' title='{$match->title}.'>{$match->title}</a></li> ";
}
if($tempval) {
echo "<hr /><h3>Committees & Working Groups</h3>";
echo " <ul class='list-icon icon-arrow-right'>";
echo $tempval;
echo " </ul>";
}
unset($tempval);
?>
<?
// The following finds all of the locations this staff person is tied with, loops through and prints.
$matches = $pages->find("template=location, id=$page->relate_supporter, sort=alphabetical");
foreach($matches as $match) {
if ($match->image) {
$img_sized = $match->image->size(300);
$tempimg = "<div class='col-sm-3'>
<a href='{$match->url}.' class='text-bold thumbnail' title='{$match->title}.'>
<img src='{$img_sized->url}' class='img-responsive ' alt='{$match->title} {$img_sized->description}'>
</a>
</div>";
$tempcss = "padding-top-xs"; // This helps push the text down to balance out the position of the text next to the image
}
$tempurl = parse_url($match->url_website);
$tempurl = $tempurl['host']; // prints 'google.com'
$tempval .= "{$tempimg}
<div class='col-sm-9 $tempcss'>
<a href='{$match->url}.' class='text-bold' title='{$match->title}.'>{$match->title}</a>
<div class='text-muted text-sm'>{$match->mapmarker->address}</div>
<a href='{$match->url}.' class='text-muted text-sm' title='{$match->url_website}.'>{$tempurl}</a>
</div>";
}
if($tempval) {
$temptitle = $matches->count() == "1" ? "Location" : 'Locations'; // This changes the title to account for more than 1 location
echo "<hr /><h3>{$temptitle}</h3>";
echo $tempval;
unset($tempurl);
unset($$tempcss);
unset($temptitle);
unset($tempval);
unset($tempimg);
}
?>
</div>
<div class='col-sm-3 pull-left'>
<div class=" padding-right-xl padding-bottom-lg margin-right-xl">
<?=$img ?>
<div class="list-group text-sm padding-top-sm">
<?
if($page->relate_supporter) {
foreach($page->relate_supporter as $match) {
$tempval .= "<a href='{$match->url}' class='list-group-item text-muted'><span class='glyphicon glyphicon-map-marker'></span> {$match->title}</a>";
}
echo $tempval;
unset($tempval);
}
?>
<?
if($page->url_scholar) {
$tempval = parse_url($page->url_scholar);
$tempval = $tempval['host']; // prints 'google.com'
echo "<a href='{$page->url_scholar}' class='list-group-item text-muted'><span class='glyphicon glyphicon-book'></span> {$tempval}</a>";
unset($tempval);
}
?>
<?
if($page->url_website) {
$tempval = parse_url($page->url_website);
$tempval = $tempval['host']; // prints 'google.com'
echo "<a href='{$page->url_website}' class='list-group-item text-muted'><span class='glyphicon glyphicon-new-window'></span> {$tempval}</a>";
unset($tempval);
}
?>
<?
if($page->phone) {
echo "<a href='tel:{$page->phone}' class='list-group-item text-muted'><span class='glyphicon glyphicon-earphone'></span> {$page->phone}</a>";
}
?>
<div class="list-group-item text-center">
<?
if($page->social_twitter) {
echo "<a href='http://www.twitter.com/{$page->social_twitter}' target='_blank'><img src='".$config->urls->templates."assets/img/glyphicons_social/png/glyphicons_social_31_twitter.png' alt='Twitter'/></a> ";
}
if($page->social_linkedin) {
echo "<a href='{$page->social_linkedin}' target='_blank'><img src='".$config->urls->templates."assets/img/glyphicons_social/png/glyphicons_social_17_linked_in.png' alt='LinkedIn'/></a> ";
}
if($page->social_facebook) {
echo "<a href='{$page->social_facebook}' target='_blank'><img src='".$config->urls->templates."/img/glyphicons_social/png/glyphicons_social_30_facebook.png' alt='Facebook'/></a> ";
}
if($page->email) {
echo "<a href='mailto:{$page->email}'><img src='".$config->urls->templates."assets/img/glyphicons/png/glyphicons_010_envelope.png' alt='Facebook'/></a> ";
}
?>
</div>
</div>
</div>
</div>
</div>
<? include("./inc/foot.php");