public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     if ($controller instanceof PhabricatorSettingsMainController) {
         $class = 'main-menu-item-icon-settings-selected';
     } else {
         $class = 'main-menu-item-icon-settings';
     }
     if ($user->isLoggedIn()) {
         $item = new PhabricatorMainMenuIconView();
         $item->setName(pht('Settings'));
         $item->addClass('autosprite main-menu-item-icon ' . $class);
         $item->setHref('/settings/');
         $item->setSortOrder(0.9);
         $items[] = $item;
     }
     return $items;
 }
 public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     $application = null;
     if ($controller) {
         $application = $controller->getCurrentApplication();
     }
     if ($application && $application->getHelpURI()) {
         $class = 'main-menu-item-icon-help';
         $item = new PhabricatorMainMenuIconView();
         $item->setName(pht('%s Help', $application->getName()));
         $item->addClass('autosprite main-menu-item-icon ' . $class);
         $item->setHref($application->getHelpURI());
         $item->setSortOrder(0.1);
         $items[] = $item;
     }
     return $items;
 }
 public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     if ($controller instanceof PhabricatorLogoutController) {
         $class = 'main-menu-item-icon-logout-selected';
     } else {
         $class = 'main-menu-item-icon-logout';
     }
     if ($user->isLoggedIn()) {
         $item = new PhabricatorMainMenuIconView();
         $item->setName(pht('Log Out'));
         $item->addClass('autosprite main-menu-item-icon ' . $class);
         $item->setWorkflow(true);
         $item->setHref('/logout/');
         $item->setSortOrder(1.0);
         $items[] = $item;
     }
     return $items;
 }
 public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     if ($controller instanceof PhabricatorPeopleProfileController && $controller->getProfileUser() && $controller->getProfileUser()->getPHID() == $user->getPHID()) {
         $class = 'main-menu-item-icon-profile-selected';
     } else {
         $class = 'main-menu-item-icon-profile-not-selected';
     }
     if ($user->isLoggedIn()) {
         $image = $user->loadProfileImageURI();
         $item = new PhabricatorMainMenuIconView();
         $item->setName($user->getUsername());
         $item->addClass('main-menu-item-icon-profile ' . $class);
         $item->addStyle('background-image: url(' . $image . ')');
         $item->setHref('/p/' . $user->getUsername() . '/');
         $item->setSortOrder(0.0);
         $items[] = $item;
     }
     return $items;
 }