Restructure repository
[scuttle] / templates / sidebar.block.watchstatus.php
1 <?php
2 $userservice =& ServiceFactory::getServiceInstance('UserService');
3 if ($userservice->isLoggedOn()) {
4     $currentUser = $userservice->getCurrentUser();
5     $currentUsername = $currentUser[$userservice->getFieldName('username')];
6
7     if ($currentUsername != $user) {
8         $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
9         if ($result) {
10             $linkText = T_('Remove from Watchlist');
11         } else {
12             $linkText = T_('Add to Watchlist');
13         }
14         $linkAddress = createURL('watch', $user);
15 ?>
16
17 <h2><?php echo T_('Actions'); ?></h2>
18 <div id="watchlist">
19     <ul>
20         <li><a href="<?php echo $linkAddress ?>"><?php echo $linkText ?></a></li>
21     </ul>
22 </div>
23
24 <?php
25     }
26 }
27 ?>

Benjamin Mako Hill || Want to submit a patch?