made a copy
[atutor.git] / mods / _standard / social / html / sprofile.tmpl.php
1 <?php
2 //Profile template for social
3 ?>
4
5 <div>
6         <div><h3><?php echo printSocialName($this->profile['member_id'], false); ?></h3></div>
7         <div style="float:left; width:40%;">            
8                 <div class="headingbox" style="margin-right:1em;">
9                         <h4><?php echo _AT('profile'); ?></h4>
10                 </div>
11                 <div class="contentbox" style="margin-right:1em;">
12                 <?php if ($this->scope=='owner'): ?>
13                 <div style="float:right; border:thin #cccccc solid;">
14                         <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>
15                 </div>          
16                 <?php endif; ?>
17                 <?php 
18                 //TODO: include this in the printSocialProfileImg function itself
19                 if (profile_image_exists($this->profile['member_id'])): ?>
20                         <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>
21                 <?php else: ?>
22                         <?php echo printSocialProfileImg($this->profile['member_id'], 2, false); ?>
23                 <?php endif; ?>
24                 <p><a href="inbox/send_message.php?id=<?php echo $this->profile['member_id']; ?>"><?php echo _AT('send_message'); ?></a></p>
25                 <dl class="public-profile">
26                         <?php if($this->profile['occupation']){ ?>
27                         <dt><?php echo _AT('occupation'); ?></dt>
28                         <dd><?php echo $this->profile['occupation']; ?></dd>
29                         <?php }?>
30                         <?php if($this->profile['expertise']){ ?>
31                         <dt><?php echo _AT('expertise'); ?></dt>
32                         <dd><?php echo $this->profile['expertise']; ?></dd>
33                         <?php }?>
34                         <?php if ($this->relationship==AT_SOCIAL_FRIENDS_VISIBILITY || $this->relationship==AT_SOCIAL_OWNER_VISIBILITY): ?>
35                         <?php if($this->profile['email']): ?>
36                         <dt><?php echo _AT('email'); ?></dt>
37                         <dd><?php echo $this->profile['email']; ?></dd>
38                         <?php endif; ?>
39                         <?php endif; ?>
40                         <?php if($this->profile['gender']!='n'){ ?>
41                         <dt><?php echo _AT('gender'); ?></dt>
42                         <dd><?php echo $this->profile['gender']; ?></dd>
43                         <?php }?>
44                         <?php if($this->profile['dob']!='0000-00-00'){ ?>
45                         <dt><?php echo _AT('dob'); ?></dt>
46                         <dd><?php echo $this->profile['dob']; ?></dd>
47                         <?php }?>
48                         <?php if($this->profile['phone']){ ?>
49                         <dt><?php echo _AT('phone'); ?></dt>
50                         <dd><?php echo $this->profile['phone']; ?></dd>
51                         <?php }?>
52                         <?php if($this->profile['country']){ ?>
53                         <dt><?php echo _AT('country'); ?></dt>
54                         <dd><?php echo $this->profile['country']; ?></dd>
55                         <?php }?>
56                         <?php if($this->profile['postal']){ ?>
57                         <dt><?php echo _AT('street_address'); ?></dt>
58                         <dd><?php echo $this->profile['postal']; ?></dd>
59                         <?php }?>
60                         <?php if($this->profile['interests']){ ?>
61                         <dt><?php echo _AT('interests'); ?></dt>
62                         <dd><?php echo htmlentities_utf8($this->profile['interests']); ?></dd>
63                         <?php }?>
64                         <?php if($this->profile['associations']){ ?>e
65                         <dt><?php echo _AT('associations'); ?></dt>
66                         <dd><?php echo htmlentities_utf8($this->profile['associations']); ?></dd>
67                         <?php }?>
68                         <?php if($this->profile['awards']){ ?>
69                         <dt><?php echo _AT('awards'); ?></dt>
70                         <dd><?php echo htmlentities_utf8($this->profile['awards']); ?></dd>
71                         <?php }?>
72                         <?php if($this->profile['others']){ ?>
73                         <dt><?php echo _AT('others'); ?></dt>
74                         <dd><?php echo $this->profile['others']; ?></dd>
75                         <?php }?>
76                         </dl>
77                 </div>
78         </div>
79
80         <div style="float:left; width:59%;">    
81                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_EDUCATION, $this->relationship, $this->prefs)): ?>
82                         <?php if (!empty($this->education)){ ?>
83                         <div>
84                                 <div class="headingbox"><h5><?php echo _AT('training_and_education'); ?></h5></div>
85                                 <div class="contentbox">
86                                 <table class="data static">     
87                                         <thead><tr>
88                                                 <th> <?php echo _AT('institution'); ?></th>
89                                                 <th> <?php echo _AT('degrees'); ?></th>
90                                                 <th> <?php echo _AT('year'); ?></th>
91                                         </tr></thead>
92                                         <tbody>
93                                         <?php
94                                                 foreach($this->education as $edu){
95                                                         echo '<tr><td>'.htmlentities_utf8($edu['university']).'</td>';
96                                                         echo '<td>'.htmlentities_utf8($edu['degree'].'/'.$edu['field']).'</td>';
97                                                         echo '<td>'.htmlentities_utf8($edu['from'].'-'.$edu['to']).'</td></tr>';
98                                                 }                                                       
99                                         ?>
100                                         </tbody>
101                                 </table>
102                                 </div>
103                         </div><br/>
104                         <?php } ?>
105                 <?php endif; ?>
106
107                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_POSITION, $this->relationship, $this->prefs)): ?>
108                 
109                         <?php if (!empty($this->position)){ ?>
110                         <div>
111                                 <div class="headingbox"><h5><?php echo _AT('credits_and_work_experience'); ?></h5></div>
112                                 <div class="contentbox">
113                                 <table class="data static">     
114                                         <thead><tr>
115                                                 <th><?php echo _AT('company'); ?></th>
116                                                 <th><?php echo _AT('title'); ?></th>
117                                                 <th><?php echo _AT('year'); ?></th>
118                                         </tr></thead>
119                                         <tbody>
120                                         <?php
121                                                 foreach($this->position as $pos){
122                                                         echo '<tr><td>'.htmlentities_utf8($pos['company']).'</td>';
123                                                         echo '<td>'.htmlentities_utf8($pos['title']).'</td>';
124                                                         echo '<td>'.htmlentities_utf8($pos['from'].'-'.$pos['to']).'</td></tr>';
125                                                 }                                                       
126                                         ?>
127                                         </tbody>
128                                 </table></div>
129                         </div><br/>
130                         <?php } ?>              
131                 <?php endif; ?>
132
133                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_MEDIA, $this->relationship, $this->prefs)): ?>
134                 <div>
135                         <?php if (!empty($this->websites)): ?>
136                         <div class="headingbox"><h5><?php echo _AT('websites'); ?></h5></div>
137                         <div class="contentbox">
138                         <table class="data static">     
139                                 <thead><tr>
140                                         <th><?php echo _AT('site_name'); ?></th>
141                                         <th><?php echo _AT('url'); ?></th>
142                                 </tr></thead>
143                                 <tbody>
144                                 <?php
145                                         foreach($this->websites as $sites){
146                                                 $is_http = preg_match("/^http/", $sites['url']);
147                                                 if ($is_http==0){
148                                                         $sites['url'] = 'http://' . $sites['url'];
149                                                 }
150                                                 echo '<tr><td>'.htmlentities_utf8($sites['site_name']).'</td>';
151                                                 echo '<td><a href="'.$sites['url'].'" target="user_profile_site">'.$sites['url'].'</a></td></tr>';
152                                         }                                                       
153                                 ?>
154                                 </tbody>
155                         </table>
156                         </div><br/>
157                         <?php endif; ?>
158                 </div>
159                 <?php endif; ?>
160
161                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_STATUS_UPDATE, $this->relationship, $this->prefs)): ?>
162                 <div class="headingbox">
163                         <h5><?php echo _AT('activities'); ?></h5></div>
164                 <div class="contentbox" id="activity">
165                         <?php if(!empty($this->activities)): ?>
166                         <ul>
167                                 <?php
168                                         foreach($this->activities as $id=>$activity):
169                                                 /*
170                                                  * harris @may 26, 2009
171                                                  * Would be nice to use this, but we will have to change "has" to "have" for _AT('you')
172                                                  *
173                                                 if ($_SESSION['member_id']== $this->profile['member_id']){
174                                                         echo '<li>'._AT('you');
175                                                         echo ' '.$activity.' ';
176                                                         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>';
177                                                 } else {
178                                                         echo '<li>'.printSocialName($this->profile['member_id']).' '.$activity.'</li>';
179                                                 }
180                                                 */
181                                  ?>
182                                  <li><?php echo $activity['created_date']. ' - '. printSocialName($activity['member_id']).' '. $activity['title']; ?></li>
183                                 <?php endforeach; ?>
184                         </ul>
185                         <?php else: ?>
186                         <?php echo _AT('no_activities'); ?>
187                         <?php endif; ?>
188                 </div><br />
189                 <?php endif; ?>
190
191                 <?php if (PrivacyController::validatePrivacy(AT_SOCIAL_PROFILE_CONNECTION, $this->relationship, $this->prefs)): ?>
192                 <div class="headingbox">
193                         <h5><?php echo _AT('connections'); ?></h5>
194                 </div>
195                 <div class="contentbox">
196                         <?php if (sizeof($this->friends)>0):
197                                         foreach($this->friends as $friend_id): ?>                                                                                                       
198                                 <div style="float:left; margin-left:1em;">
199                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
200                                 <?php echo printSocialName($friend_id); ?>
201                                 </div>
202                         <?php   endforeach;
203                                 else: 
204                                         echo _AT('no_friends');
205                                 endif; ?>
206                 </div><br/>
207
208                 <?php if (isset($this->mutual_friends)): ?>
209                 <div class="headingbox">
210                         <h5><?php echo _AT('mutual_connections'); ?></h5>
211                 </div>
212                 <div class="contentbox">
213                         <?php foreach($this->mutual_friends as $friend_id): ?>
214                                 <div style="float:left; margin-left:1em;">
215                                 <?php echo printSocialProfileImg($friend_id); ?><br/>
216                                 <?php echo printSocialName($friend_id); ?>
217                                 </div>
218                         <?php endforeach; ?>
219                 </div>
220                 <?php endif; //this->mutual_friends != empty ?>
221                 <?php endif; ?>
222         </div>
223 </div>
224