Moved scripts in "docs" one level up into root folder. In addition, removed "docs...
[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 htmlentities_utf8($this->profile['occupation']); ?></dd>
31                         <?php }?>
32                         <?php if($this->profile['expertise']){ ?>
33                         <dt><?php echo _AT('expertise'); ?></dt><br />
34                         <dd><?php echo htmlentities_utf8($this->profile['expertise']); ?></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 htmlentities_utf8($this->profile['email']); ?></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 htmlentities_utf8($this->profile['phone']); ?></dd>
53                         <?php }?>
54                         <?php if($this->profile['country']){ ?>
55                         <dt><?php echo _AT('country'); ?></dt><br />
56                         <dd><?php echo htmlentities_utf8($this->profile['country']); ?></dd>
57                         <?php }?>
58                         <?php if($this->profile['postal']){ ?>
59                         <dt><?php echo _AT('street_address'); ?></dt><br />
60                         <dd><?php echo htmlentities_utf8($this->profile['postal']); ?></dd>
61                         <?php }?>
62                         <?php if($this->profile['interests']){ ?>
63                         <dt><?php echo _AT('interests'); ?></dt><br />
64                         <dd><?php echo htmlentities_utf8($this->profile['interests']); ?></dd>
65                         <?php }?>
66                         <?php if($this->profile['associations']){ ?>
67                         <dt><?php echo _AT('associations'); ?></dt><br />
68                         <dd><?php echo htmlentities_utf8($this->profile['associations']); ?></dd>
69                         <?php }?>
70                         <?php if($this->profile['awards']){ ?>
71                         <dt><?php echo _AT('awards'); ?></dt><br />
72                         <dd><?php echo htmlentities_utf8($this->profile['awards']); ?></dd>
73                         <?php }?>
74                         <?php if($this->profile['others']){ ?>
75                         <dt><?php echo _AT('others'); ?></dt><br />
76                         <dd><?php echo htmlentities_utf8($this->profile['others']); ?></dd>
77                         <?php }?>
78                         <?php if($this->personal['per_weight']){ ?>
79                         <dt><?php echo _AT('per_weight'); ?></dt><br />
80                         <dd><?php echo htmlentities_utf8($this->personal['per_weight']); ?></dd>
81                         <?php }?>
82                         <?php if($this->personal['per_height']){ ?>
83                         <dt><?php echo _AT('per_height'); ?></dt><br />
84                         <dd><?php echo htmlentities_utf8($this->personal['per_height']); ?></dd>
85                         <?php }?>
86                         <?php if($this->personal['per_hair']){ ?>
87                         <dt><?php echo _AT('per_hair'); ?></dt><br />
88                         <dd><?php echo htmlentities_utf8($this->personal['per_hair']); ?></dd>
89                         <?php }?>
90                         <?php if($this->personal['per_eyes']){ ?>
91                         <dt><?php echo _AT('per_eyes'); ?></dt><br />
92                         <dd><?php echo htmlentities_utf8($this->personal['per_eyes']); ?></dd>
93                         <?php }?>
94                         <?php if($this->personal['per_ethnicity']){ ?>
95                         <dt><?php echo _AT('per_ethnicity'); ?></dt><br />
96                         <dd><?php echo htmlentities_utf8($this->personal['per_ethnicity']); ?></dd>
97                         <?php }?>
98                         <?php if($this->personal['per_languages']){ ?>
99                         <dt><?php echo _AT('per_languages'); ?></dt><br />
100                         <dd><?php echo htmlentities_utf8($this->personal['per_languages']); ?></dd>
101                         <?php }?>
102                         <?php if($this->personal['per_disabilities']){ ?>
103                         <dt><?php echo _AT('per_disabilities'); ?></dt><br />
104                         <dd><?php echo htmlentities_utf8($this->personal['per_disabilities']); ?></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 htmlentities_utf8($value['rep_name']); ?></dd>
118
119                                 <dt><?php echo _AT('title') . ': ' ?></dt> <br /><dd> <?php echo htmlentities_utf8($value['rep_title']); ?></dd>
120                                 <dt><?php echo _AT('phone') . ':' ?></dt><br /> <dd> <?php echo htmlentities_utf8($value['rep_phone']);?></dd>
121                                 <dt><?php echo _AT('email') . ': ' ?></dt><br /> <dd> <?php echo  htmlentities_utf8($value['rep_email']); ?></dd>       
122                                 <dt><?php echo _AT('street_address') . ': ' ?></dt> <br /><dd> <?php echo htmlentities_utf8($value['rep_address']); ?></dd>
123                                 </dl>
124                         
125                         <?php } ?>
126                         </div>
127                         <?php } ?>
128
129                 <?php if (!empty($this->contact)){ ?>
130                         <br /><div  class="headingbox" style="margin-right:1em;"><h4><?php echo _AT('alt_contact'); ?></h4></div>
131                         <div class="contentbox" style="margin-right:1em;">
132
133                                 <?php   foreach($this->contact as $row=>$value){  ?>
134                                 <dl class="public-profile">
135                                 <dt><?php echo _AT('name') . ':' ?></dt> <br /><dd> <?php echo htmlentities_utf8($value['con_name']); ?></dd>
136                                 <dt><?php echo _AT('phone') . ':' ?></dt> <br /><dd> <?php echo htmlentities_utf8($value['con_phone']);?></dd>
137                                 <dt><?php echo _AT('email') . ': ' ?></dt><br /> <dd> <?php echo  htmlentities_utf8($value['con_email']); ?></dd>
138                                 <dt><?php echo _AT('street_address') . ': ' ?></dt><br /> <dd> <?php echo htmlentities_utf8($value['con_address']); ?></dd>
139                                 </dl>
140                         
141                         <?php } ?>
142                         </div>
143                         <br/>
144                         <?php } ?>
145
146
147
148         </div>
149
150         <div class="social-right">      
151                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_EDUCATION, $this->relationship, $this->prefs)): ?>
152                         <?php if (!empty($this->education)){ ?>
153                         <div>
154                                 <div class="headingbox"><h5><?php echo _AT('training_and_education'); ?></h5></div>
155                                 <div class="contentbox">
156                                 <table class="data static">     
157                                         <thead><tr>
158                                                 <th> <?php echo _AT('institution'); ?></th>
159                                                 <th> <?php echo _AT('degrees'); ?></th>
160                                                 <th> <?php echo _AT('year'); ?></th>
161                                         </tr></thead>
162                                         <tbody>
163                                         <?php
164                                                 foreach($this->education as $edu){
165                                                         echo '<tr><td>'.htmlentities_utf8($edu['university']).'</td>';
166                                                         echo '<td>'.htmlentities_utf8($edu['degree'].'/'.$edu['field']).'</td>';
167                                                         echo '<td>'.htmlentities_utf8($edu['from'].'-'.$edu['to']).'</td></tr>';
168                                                 }                                                       
169                                         ?>
170                                         </tbody>
171                                 </table>
172                                 </div>
173                         </div><br/>
174                         <?php } ?>
175                 <?php endif; ?>
176
177                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_POSITION, $this->relationship, $this->prefs)): ?>
178                 
179                         <?php if (!empty($this->position)){ ?>
180                         <div>
181                                 <div class="headingbox"><h5><?php echo _AT('credits_and_work_experience'); ?></h5></div>
182                                 <div class="contentbox">
183                                 <table class="data static">     
184                                         <thead><tr>
185                                                 <th><?php echo _AT('company'); ?></th>
186                                                 <th><?php echo _AT('position'); ?></th>
187                                                 <th><?php echo _AT('year'); ?></th>
188                                         </tr></thead>
189                                         <tbody>
190                                         <?php
191                                                 foreach($this->position as $pos){
192                                                         echo '<tr><td>'.htmlentities_utf8($pos['company']).'</td>';
193                                                         echo '<td>'.htmlentities_utf8($pos['title']).'</td>';
194                                                         echo '<td>'.htmlentities_utf8($pos['from'].'-'.$pos['to']).'</td></tr>';
195                                                 }                                                       
196                                         ?>
197                                         </tbody>
198                                 </table></div>
199                         </div><br/>
200                         <?php } ?>              
201                 <?php endif; ?>
202
203                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_MEDIA, $this->relationship, $this->prefs)): ?>
204                 <div>
205                         <?php if (!empty($this->websites)): ?>
206                         <div class="headingbox"><h5><?php echo _AT('websites'); ?></h5></div>
207                         <div class="contentbox">
208                         <table class="data static">     
209                                 <thead><tr>
210                                         <th><?php echo _AT('site_name'); ?></th>
211                                         <th><?php echo _AT('url'); ?></th>
212                                 </tr></thead>
213                                 <tbody>
214                                 <?php
215                                         foreach($this->websites as $sites){
216                                                 $is_http = preg_match("/^http/", $sites['url']);
217                                                 if ($is_http==0){
218                                                         $sites['url'] = 'http://' . $sites['url'];
219                                                 }
220                                                 echo '<tr><td>'.htmlentities_utf8($sites['site_name']).'</td>';
221                                                 echo '<td><a href="'.$sites['url'].'" target="user_profile_site">'.$sites['url'].'</a></td></tr>';
222                                         }                                                       
223                                 ?>
224                                 </tbody>
225                         </table>
226                         </div><br/>
227                         <?php endif; ?>
228                 </div>
229                 <?php endif; ?>
230
231                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_STATUS_UPDATE, $this->relationship, $this->prefs)): ?>
232                 <div class="headingbox">
233                         <h5><?php echo _AT('activities'); ?></h5></div>
234                 <div class="contentbox" id="activity">
235                         <?php if(!empty($this->activities)): ?>
236                         <ul>
237                                 <?php
238                                         foreach($this->activities as $id=>$activity):
239                                                 /*
240                                                  * harris @may 26, 2009
241                                                  * Would be nice to use this, but we will have to change "has" to "have" for _AT('you')
242                                                  *
243                                                 if ($_SESSION['member_id']== $this->profile['member_id']){
244                                                         echo '<li>'._AT('you');
245                                                         echo ' '.$activity.' ';
246                                                         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>';
247                                                 } else {
248                                                         echo '<li>'.printSocialName($this->profile['member_id']).' '.$activity.'</li>';
249                                                 }
250                                                 */
251                                  ?>
252                                  <li><?php echo $activity['created_date']. ' - '. printSocialName($activity['member_id']).' '. $activity['title']; ?></li>
253                                 <?php endforeach; ?>
254                         </ul>
255                         <?php else: ?>
256                         <?php echo _AT('no_activities'); ?>
257                         <?php endif; ?>
258                 </div><br />
259                 <?php endif; ?>
260
261                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_CONNECTION, $this->relationship, $this->prefs)): ?>
262                 <div class="headingbox">
263                         <h5><?php echo _AT('connections'); ?></h5>
264                 </div>
265                 <div class="contentbox">
266                         <?php if (sizeof($this->friends)>0):
267                                         foreach($this->friends as $friend_id): ?>                                                                                                       
268                                 <div style="float:left; margin-left:1em;">
269                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
270                                 <?php echo printSocialName($friend_id); ?>
271                                 </div>
272                         <?php   endforeach;
273                                 else: 
274                                         echo _AT('no_friends');
275                                 endif; ?>
276                 </div><br/>
277
278                 <?php if (isset($this->mutual_friends)): ?>
279                 <div class="headingbox">
280                         <h5><?php echo _AT('mutual_connections'); ?></h5>
281                 </div>
282                 <div class="contentbox">
283                         <?php foreach($this->mutual_friends as $friend_id): ?>
284                                 <div style="float:left; margin-left:1em;">
285                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
286                                 <?php echo printSocialName($friend_id); ?>
287                                 </div>
288                         <?php endforeach; ?>
289                 </div>
290                 <?php endif; //this->mutual_friends != empty ?>
291         
292         <?php endif; ?>
293
294
295                         
296         </div>
297 <div style="clear:both;"></div>
298 </div>
299