Skip to content

Commit

Permalink
Code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
taiwen committed Aug 30, 2014
1 parent 7e417b8 commit 410c43d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion usr/module/user/src/Api/Nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ public function getList($cur, $uid = 0)
}

return $result;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ public function indexAction()
//'quicklink' => $quicklink,
//'owner' => $isOwner,
));

}

/**
Expand Down
3 changes: 3 additions & 0 deletions usr/module/user/src/Controller/Front/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ protected function getProfile($uid)
$fields = Pi::registry('display_field', 'user')->read($gid);
$list = array();
foreach ($fields as $field) {
if (!isset($meta[$field]['title'])) {
continue;
}
$list[$field] = array(
'title' => $meta[$field]['title'],
'value' => isset($profile[$field]) ? $profile[$field] : '',
Expand Down
2 changes: 1 addition & 1 deletion usr/module/user/src/Registry/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function loadDynamic($options = array())
$list[$row['name']] = array(
'title' => $row['title'],
'description' => $row['description'],
//'module' => $row['module'],
'module' => $row['module'],
'icon' => $row['icon'],
'callback' => $row['callback'],
'template' => $row['template']
Expand Down
5 changes: 5 additions & 0 deletions usr/module/user/template/front/profile-topbar.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if (!$user) {
return;
}

// Check if the current visitor is owner of the user
if (!isset($owner)) {
$owner = !_get('uid') && $uid ? true : false;
}

// Load nav
if ($owner) {
$nav = Pi::api('nav', 'user')->getList($name);
Expand Down

0 comments on commit 410c43d

Please sign in to comment.