move code up one directory
[atutor.git] / themes / default / social / sprofile.tmpl.php
1 <?php
2 //Profile template for social
3 ?>
4
5
6 <div  class="social-wrapper">
7         <div><h3><?php echo printSocialName($this->profile['member_id'], false); ?></h3></div>
8         <div class="social-left">               
9                 <div class="headingbox" style="margin-right:1em;">
10                         <h4><?php echo _AT('profile'); ?></h4>
11                 </div>
12                 <div class="contentbox" style="margin-right:1em;">
13                 <?php if ($this->scope=='owner'): ?>
14                 <div style="float:right; border:thin #cccccc solid;">
15                         <a href="<?php echo url_rewrite(AT_SOCIAL_BASENAME."edit_profile.php");?>"><img src="<?php echo $_base_href.AT_SOCIAL_BASENAME;?>images/edit_profile.gif" alt="<?php echo _AT('edit_profile'); ?>" title="<?php echo _AT('edit_profile'); ?>" border="0"/></a>
16                 </div>          
17                 <?php endif; ?>
18                 <?php 
19                 //TODO: include this in the printSocialProfileImg function itself
20                 if (profile_image_exists($this->profile['member_id'])): ?>
21                         <a href="get_profile_img.php?id=<?php echo $this->profile['member_id'].SEP ;?>size=o"><?php echo printSocialProfileImg($this->profile['member_id'], 2, false); ?></a>
22                 <?php else: ?>
23                         <?php echo printSocialProfileImg($this->profile['member_id'], 2, false); ?>
24                 <?php endif; ?>
25                 <p><a href="inbox/send_message.php?id=<?php echo $this->profile['member_id']; ?>"><?php echo _AT('send_message'); ?></a></p>
26                 <dl class="public-profile">
27
28                 <?php         if($this->profile['occupation']){ ?>
29                         <dt><?php echo _AT('occupation'); ?></dt><br />
30                         <dd><?php echo AT_print($this->profile['occupation'], 'social.profile'); ?></dd>
31                         <?php }?>
32                         <?php if($this->profile['expertise']){ ?>
33                         <dt><?php echo _AT('expertise'); ?></dt><br />
34                         <dd><?php echo AT_print($this->profile['expertise'], 'social.profile'); ?></dd>
35                         <?php }?>
36                         <?php if ($this->relationship==AT_SOCIAL_FRIENDS_VISIBILITY || $this->relationship==AT_SOCIAL_OWNER_VISIBILITY): ?>
37                         <?php if($this->profile['email']): ?>
38                         <dt><?php echo _AT('email'); ?></dt><br />
39                         <dd><?php echo AT_print($this->profile['email'], 'social.profile'); ?></dd>
40                         <?php endif; ?>
41                         <?php endif; ?>
42                         <?php if($this->profile['gender']!='n'){ ?>
43                         <dt><?php echo _AT('gender'); ?></dt><br />
44                         <dd><?php echo $this->profile['gender']; ?></dd>
45                         <?php }?>
46                         <?php if($this->profile['dob']!='0000-00-00'){ ?>
47                         <dt><?php echo _AT('dob'); ?></dt><br />
48                         <dd><?php echo $this->profile['dob']; ?></dd>
49                         <?php }?>
50                         <?php if($this->profile['phone']){ ?>
51                         <dt><?php echo _AT('phone'); ?></dt><br />
52                         <dd><?php echo AT_print($this->profile['phone'], 'social.profile'); ?></dd>
53                         <?php }?>
54                         <?php if($this->profile['country']){ ?>
55                         <dt><?php echo _AT('country'); ?></dt><br />
56                         <dd><?php echo AT_print($this->profile['country'], 'social.profile'); ?></dd>
57                         <?php }?>
58                         <?php if($this->profile['postal']){ ?>
59                         <dt><?php echo _AT('street_address'); ?></dt><br />
60                         <dd><?php echo AT_print($this->profile['postal'], 'social.profile'); ?></dd>
61                         <?php }?>
62                         <?php if($this->profile['interests']){ ?>
63                         <dt><?php echo _AT('interests'); ?></dt><br />
64                         <dd><?php echo AT_print($this->profile['interests'], 'social.profile'); ?></dd>
65                         <?php }?>
66                         <?php if($this->profile['associations']){ ?>
67                         <dt><?php echo _AT('associations'); ?></dt><br />
68                         <dd><?php echo AT_print($this->profile['associations'], 'social.profile'); ?></dd>
69                         <?php }?>
70                         <?php if($this->profile['awards']){ ?>
71                         <dt><?php echo _AT('awards'); ?></dt><br />
72                         <dd><?php echo AT_print($this->profile['awards'], 'social.profile'); ?></dd>
73                         <?php }?>
74                         <?php if($this->profile['others']){ ?>
75                         <dt><?php echo _AT('others'); ?></dt><br />
76                         <dd><?php echo AT_print($this->profile['others'], 'social.profile'); ?></dd>
77                         <?php }?>
78                         <?php if($this->personal['per_weight']){ ?>
79                         <dt><?php echo _AT('per_weight'); ?></dt><br />
80                         <dd><?php echo AT_print($this->personal['per_weight'], 'social.profile'); ?></dd>
81                         <?php }?>
82                         <?php if($this->personal['per_height']){ ?>
83                         <dt><?php echo _AT('per_height'); ?></dt><br />
84                         <dd><?php echo AT_print($this->personal['per_height'], 'social.profile'); ?></dd>
85                         <?php }?>
86                         <?php if($this->personal['per_hair']){ ?>
87                         <dt><?php echo _AT('per_hair'); ?></dt><br />
88                         <dd><?php echo AT_print($this->personal['per_hair'], 'social.profile'); ?></dd>
89                         <?php }?>
90                         <?php if($this->personal['per_eyes']){ ?>
91                         <dt><?php echo _AT('per_eyes'); ?></dt><br />
92                         <dd><?php echo AT_print($this->personal['per_eyes'], 'social.profile'); ?></dd>
93                         <?php }?>
94                         <?php if($this->personal['per_ethnicity']){ ?>
95                         <dt><?php echo _AT('per_ethnicity'); ?></dt><br />
96                         <dd><?php echo AT_print($this->personal['per_ethnicity'], 'social.profile'); ?></dd>
97                         <?php }?>
98                         <?php if($this->personal['per_languages']){ ?>
99                         <dt><?php echo _AT('per_languages'); ?></dt><br />
100                         <dd><?php echo AT_print($this->personal['per_languages'], 'social.profile'); ?></dd>
101                         <?php }?>
102                         <?php if($this->personal['per_disabilities']){ ?>
103                         <dt><?php echo _AT('per_disabilities'); ?></dt><br />
104                         <dd><?php echo AT_print($this->personal['per_disabilities'], 'social.profile'); ?></dd>
105                         <?php }?>
106
107
108
109                         </dl>
110                 </div><br />
111                 <?php if (!empty($this->representation)){ ?>
112                         <br /><div  class="headingbox" style="margin-right:1em;"><h4><?php echo _AT('representation'); ?></h4></div>
113                         <div class="contentbox" style="margin-right:1em;">
114
115                                 <?php foreach($this->representation as $row=>$value){  ?>
116                                 <dl class="public-profile">
117                                 <dt><?php echo _AT('name') . ':' ?></dt> <br /><dd> <?php echo AT_print($value['rep_name'], 'social.profile'); ?></dd>
118                                 <dt><?php echo _AT('title') . ': ' ?></dt> <br /><dd> <?php echo AT_print($value['rep_title'], 'social.profile'); ?></dd>
119                                 <dt><?php echo _AT('phone') . ':' ?></dt><br /> <dd> <?php echo AT_print($value['rep_phone'], 'social.profile');?></dd>
120                                 <dt><?php echo _AT('email') . ': ' ?></dt><br /> <dd> <?php echo  AT_print($value['rep_email'], 'social.profile'); ?></dd>      
121                                 <dt><?php echo _AT('street_address') . ': ' ?></dt> <br /><dd> <?php echo AT_print($value['rep_address'], 'social.profile'); ?></dd>
122                                 </dl>
123                         
124                         <?php } ?>
125                         </div>
126                         <?php } ?>
127
128                 <?php if (!empty($this->contact)){ ?>
129                         <br /><div  class="headingbox" style="margin-right:1em;"><h4><?php echo _AT('alt_contact'); ?></h4></div>
130                         <div class="contentbox" style="margin-right:1em;">
131
132                                 <?php   foreach($this->contact as $row=>$value){  ?>
133                                 <dl class="public-profile">
134                                 <dt><?php echo _AT('name') . ':' ?></dt> <br /><dd> <?php echo AT_print($value['con_name'], 'social.profile'); ?></dd>
135                                 <dt><?php echo _AT('phone') . ':' ?></dt> <br /><dd> <?php echo AT_print($value['con_phone'], 'social.profile');?></dd>
136                                 <dt><?php echo _AT('email') . ': ' ?></dt><br /> <dd> <?php echo  AT_print($value['con_email'], 'social.profile'); ?></dd>
137                                 <dt><?php echo _AT('street_address') . ': ' ?></dt><br /> <dd> <?php echo AT_print($value['con_address'], 'social.profile'); ?></dd>
138                                 </dl>
139                         
140                         <?php } ?>
141                         </div>
142                         <br/>
143                         <?php } ?>
144
145
146
147         </div>
148
149         <div class="social-right">      
150                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_EDUCATION, $this->relationship, $this->prefs)): ?>
151                         <?php if (!empty($this->education)){ ?>
152                         <div>
153                                 <div class="headingbox"><h5><?php echo _AT('training_and_education'); ?></h5></div>
154                                 <div class="contentbox">
155                                 <table class="data static">     
156                                         <thead><tr>
157                                                 <th> <?php echo _AT('institution'); ?></th>
158                                                 <th> <?php echo _AT('degrees'); ?></th>
159                                                 <th> <?php echo _AT('year'); ?></th>
160                                         </tr></thead>
161                                         <tbody>
162                                         <?php
163                                                 foreach($this->education as $edu){
164                                                         echo '<tr><td>'.AT_print($edu['university'], 'social.profile').'</td>';
165                                                         echo '<td>'.AT_print($edu['degree'].'/'.$edu['field'], 'social.profile').'</td>';
166                                                         echo '<td>'.AT_print($edu['from'].'-'.$edu['to'], 'social.profile').'</td></tr>';
167                                                 }                                                       
168                                         ?>
169                                         </tbody>
170                                 </table>
171                                 </div>
172                         </div><br/>
173                         <?php } ?>
174                 <?php endif; ?>
175
176                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_POSITION, $this->relationship, $this->prefs)): ?>
177                 
178                         <?php if (!empty($this->position)){ ?>
179                         <div>
180                                 <div class="headingbox"><h5><?php echo _AT('credits_and_work_experience'); ?></h5></div>
181                                 <div class="contentbox">
182                                 <table class="data static">     
183                                         <thead><tr>
184                                                 <th><?php echo _AT('company'); ?></th>
185                                                 <th><?php echo _AT('position'); ?></th>
186                                                 <th><?php echo _AT('year'); ?></th>
187                                         </tr></thead>
188                                         <tbody>
189                                         <?php
190                                                 foreach($this->position as $pos){
191                                                         echo '<tr><td>'.AT_print($pos['company'], 'social.profile').'</td>';
192                                                         echo '<td>'.AT_print($pos['title'], 'social.profile').'</td>';
193                                                         echo '<td>'.AT_print($pos['from'].'-'.$pos['to'], 'social.profile').'</td></tr>';
194                                                 }                                                       
195                                         ?>
196                                         </tbody>
197                                 </table></div>
198                         </div><br/>
199                         <?php } ?>              
200                 <?php endif; ?>
201
202                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_MEDIA, $this->relationship, $this->prefs)): ?>
203                 <div>
204                         <?php if (!empty($this->websites)): ?>
205                         <div class="headingbox"><h5><?php echo _AT('websites'); ?></h5></div>
206                         <div class="contentbox">
207                         <table class="data static">     
208                                 <thead><tr>
209                                         <th><?php echo _AT('site_name'); ?></th>
210                                         <th><?php echo _AT('url'); ?></th>
211                                 </tr></thead>
212                                 <tbody>
213                                 <?php
214                                         foreach($this->websites as $sites){
215                                                 $is_http = preg_match("/^http/", $sites['url']);
216                                                 if ($is_http==0){
217                                                         $sites['url'] = 'http://' . $sites['url'];
218                                                 }
219                                                 echo '<tr><td>'.AT_print($sites['site_name'], 'social.profile').'</td>';
220                                                 echo '<td><a href="'.$sites['url'].'" target="user_profile_site">'.$sites['url'].'</a></td></tr>';
221                                         }                                                       
222                                 ?>
223                                 </tbody>
224                         </table>
225                         </div><br/>
226                         <?php endif; ?>
227                 </div>
228                 <?php endif; ?>
229
230                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_STATUS_UPDATE, $this->relationship, $this->prefs)): ?>
231                 <div class="headingbox">
232                         <h5><?php echo _AT('activities'); ?></h5></div>
233                 <div class="contentbox" id="activity">
234                         <?php if(!empty($this->activities)): ?>
235                         <ul>
236                                 <?php
237                                         foreach($this->activities as $id=>$activity):
238                                                 /*
239                                                  * harris @may 26, 2009
240                                                  * Would be nice to use this, but we will have to change "has" to "have" for _AT('you')
241                                                  *
242                                                 if ($_SESSION['member_id']== $this->profile['member_id']){
243                                                         echo '<li>'._AT('you');
244                                                         echo ' '.$activity.' ';
245                                                         echo '<a href="'.url_rewrite(AT_SOCIAL_BASENAME.'sprofile.php?delete='.$id).'"><img src="'.$_base_href.AT_SOCIAL_BASENAME.'images/b_drop.png" alt="'._AT('remove').'" title="'._AT('remove').'" border="0" /></a></li>';
246                                                 } else {
247                                                         echo '<li>'.printSocialName($this->profile['member_id']).' '.$activity.'</li>';
248                                                 }
249                                                 */
250                                  ?>
251                                  <li><?php echo $activity['created_date']. ' - '. printSocialName($activity['member_id']).' '. $activity['title']; ?></li>
252                                 <?php endforeach; ?>
253                         </ul>
254                         <?php else: ?>
255                         <?php echo _AT('no_activities'); ?>
256                         <?php endif; ?>
257                 </div><br />
258                 <?php endif; ?>
259
260                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_CONNECTION, $this->relationship, $this->prefs)): ?>
261                 <div class="headingbox">
262                         <h5><?php echo _AT('connections'); ?></h5>
263                 </div>
264                 <div class="contentbox">
265                         <?php if (sizeof($this->friends)>0):
266                                         foreach($this->friends as $friend_id): ?>                                                                                                       
267                                 <div style="float:left; margin-left:1em;">
268                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
269                                 <?php echo printSocialName($friend_id); ?>
270                                 </div>
271                         <?php   endforeach;
272                                 else: 
273                                         echo _AT('no_friends');
274                                 endif; ?>
275                 </div><br/>
276
277                 <?php if (isset($this->mutual_friends)): ?>
278                 <div class="headingbox">
279                         <h5><?php echo _AT('mutual_connections'); ?></h5>
280                 </div>
281                 <div class="contentbox">
282                         <?php foreach($this->mutual_friends as $friend_id): ?>
283                                 <div style="float:left; margin-left:1em;">
284                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
285                                 <?php echo printSocialName($friend_id); ?>
286                                 </div>
287                         <?php endforeach; ?>
288                 </div>
289                 <?php endif; //this->mutual_friends != empty ?>
290         
291         <?php endif; ?>
292
293
294                         
295         </div>
296 <div style="clear:both;"></div>
297 </div>
298