summaryrefslogtreecommitdiffstatshomepage
path: root/templates/sidebar.block.watchstatus.php
blob: d9128467bf5cfddd9f193172da93d617c9607d98 (plain)
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
<?php
$userservice =& ServiceFactory::getServiceInstance('UserService');
if ($userservice->isLoggedOn()) {
    $currentUser = $userservice->getCurrentUser();
    $currentUsername = $currentUser[$userservice->getFieldName('username')];

    if ($currentUsername != $user) {
        $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId());
        if ($result) {
            $linkText = T_('Remove from Watchlist');
        } else {
            $linkText = T_('Add to Watchlist');
        }
        $linkAddress = createURL('watch', $user);
?>

<h2><?php echo T_('Actions'); ?></h2>
<div id="watchlist">
    <ul>
        <li><a href="<?php echo $linkAddress ?>"><?php echo $linkText ?></a></li>
    </ul>
</div>

<?php
    }
}
?>