public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     $application = null;
     if ($controller) {
         $application = $controller->getCurrentApplication();
     }
     if ($application && $application->getHelpURI()) {
         $help_name = pht('%s Help', $application->getName());
         $item = id(new PHUIListItemView())->setName($help_name)->addClass('core-menu-item')->setIcon('info-sm')->setAural($help_name)->setOrder(200)->setHref($application->getHelpURI());
         $items[] = $item;
     }
     return $items;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $href = $this->getApplicationURI('question/create/');
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Ask Question'))->setHref($href)->setIcon('fa-plus-square'));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Blog'))->setHref($this->getApplicationURI('/blog/new'))->setIcon('fa-plus-square'));
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Post'))->setHref($this->getApplicationURI('/post/new'))->setIcon('fa-pencil'));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $can_create = $this->hasApplicationCapability(PhabricatorPhurlURLCreateCapability::CAPABILITY);
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Shorten URL'))->setHref($this->getApplicationURI() . 'url/create/')->setIcon('fa-plus-square')->setDisabled(!$can_create)->setWorkflow(!$can_create));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $actions = id(new PhabricatorActionListView())->setUser($this->getViewer())->addAction(id(new PhabricatorActionView())->setName(pht('Create Event'))->setHref('/calendar/event/create/'))->addAction(id(new PhabricatorActionView())->setName(pht('Create Public Event'))->setHref('/calendar/event/create/?mode=public'))->addAction(id(new PhabricatorActionView())->setName(pht('Create Recurring Event'))->setHref('/calendar/event/create/?mode=recurring'));
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create Event'))->setHref($this->getApplicationURI() . 'event/create/')->setIcon('fa-plus-square')->setDropdownMenu($actions));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $can_create = $this->hasApplicationCapability(PhameBlogCreateCapability::CAPABILITY);
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Blog'))->setHref($this->getApplicationURI('/blog/new/'))->setIcon('fa-plus-square')->setDisabled(!$can_create)->setWorkflow(!$can_create));
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Post'))->setHref($this->getApplicationURI('/post/new/'))->setIcon('fa-pencil'));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     if (get_class($this) != 'PhrictionListController') {
         $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Index'))->setHref('/phriction/')->setIcon('fa-home'));
     }
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Document'))->setHref('/phriction/new/?slug=' . $this->getDocumentSlug())->setWorkflow(true)->setIcon('fa-plus-square'));
     return $crumbs;
 }
 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 buildMainMenuExtraNodes(PhabricatorUser $viewer, PhabricatorController $controller = null)
 {
     $application = null;
     if ($controller) {
         $application = $controller->getCurrentApplication();
     }
     $view = null;
     if ($application) {
         $help_items = $application->getHelpMenuItems($viewer);
         if ($help_items) {
             $view = new PHUIListView();
             foreach ($help_items as $item) {
                 $view->addMenuItem($item);
             }
         }
     }
     return phutil_tag('div', array('id' => 'phabricator-help-menu', 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav', 'style' => 'display: none'), $view);
 }
 public function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $viewer = $this->getRequest()->getUser();
     if ($viewer->getIsAdmin()) {
         $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create New User'))->setHref($this->getApplicationURI('create/'))->setIcon('fa-plus-square'));
     }
     return $crumbs;
 }
 protected function buildConpherenceApplicationCrumbs($is_rooms = false)
 {
     $crumbs = parent::buildApplicationCrumbs();
     if ($is_rooms) {
         $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Room'))->setHref($this->getApplicationURI('new/'))->setIcon('fa-plus-square')->setWorkflow(true));
     } else {
         $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Room'))->setHref($this->getApplicationURI('new/'))->setIcon('fa-plus-square')->setWorkflow(true))->addAction(id(new PHUIListItemView())->setName(pht('Room'))->setHref('#')->setIcon('fa-bars')->setStyle('display: none;')->addClass('device-widgets-selector')->addSigil('device-widgets-selector'));
     }
     return $crumbs;
 }
 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;
 }
 public function handlePanelRequest(AphrontRequest $request, PhabricatorController $controller)
 {
     $viewer = $request->getViewer();
     $application = $this->getApplication();
     $path = $request->getURIData('path');
     if (strlen($path)) {
         return new Aphront404Response();
     }
     $uri = $request->getRequestURI();
     $uri->setQueryParams(array());
     $new = $request->getStr('new');
     $edit = $request->getInt('edit');
     $delete = $request->getInt('delete');
     if ($new) {
         return $this->returnNewAddressResponse($request, $uri, $application);
     }
     if ($edit) {
         return $this->returnEditAddressResponse($request, $uri, $edit);
     }
     if ($delete) {
         return $this->returnDeleteAddressResponse($request, $uri, $delete);
     }
     $table = $this->buildEmailTable($is_edit = true, $request->getInt('id'));
     $form = id(new AphrontFormView())->setUser($viewer);
     $crumbs = $controller->buildPanelCrumbs($this);
     $crumbs->addTextCrumb(pht('Edit Application Emails'));
     $crumbs->setBorder(true);
     $header = id(new PHUIHeaderView())->setHeader(pht('Edit Application Emails: %s', $application->getName()))->setSubheader($application->getAppEmailBlurb())->setHeaderIcon('fa-pencil');
     $icon = id(new PHUIIconView())->setIcon('fa-plus');
     $button = new PHUIButtonView();
     $button->setText(pht('Add New Address'));
     $button->setTag('a');
     $button->setHref($uri->alter('new', 'true'));
     $button->setIcon($icon);
     $button->addSigil('workflow');
     $header->addActionLink($button);
     $object_box = id(new PHUIObjectBoxView())->setHeaderText(pht('Emails'))->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)->setTable($table);
     $title = $application->getName();
     $view = id(new PHUITwoColumnView())->setHeader($header)->setFooter($object_box);
     return $controller->buildPanelPage($this, $title, $crumbs, $view);
 }
 public function willBeginExecution()
 {
     $request = $this->getRequest();
     // Check if this is a VCS request, e.g. from "git clone", "hg clone", or
     // "svn checkout". If it is, we jump off into repository serving code to
     // process the request.
     if (DiffusionServeController::isVCSRequest($request)) {
         $serve_controller = id(new DiffusionServeController())->setCurrentApplication($this->getCurrentApplication());
         return $this->delegateToController($serve_controller);
     }
     return parent::willBeginExecution();
 }
 public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
 {
     $items = array();
     if ($user->isLoggedIn()) {
         $item = id(new PHUIListItemView())->addClass('core-menu-item')->setName(pht('Log Out'))->setIcon('fa-sign-out')->setWorkflow(true)->setHref('/logout/')->setSelected($controller instanceof PhabricatorLogoutController)->setAural(pht('Log Out'))->setOrder(900);
         $items[] = $item;
     } else {
         if ($controller instanceof PhabricatorAuthController) {
             // Don't show the "Login" item on auth controllers, since they're
             // generally all related to logging in anyway.
         } else {
             $uri = new PhutilURI('/auth/start/');
             if ($controller) {
                 $path = $controller->getRequest()->getPath();
                 $uri->setQueryParam('next', $path);
             }
             $item = id(new PHUIListItemView())->addClass('core-menu-item')->setName(pht('Log In'))->setIcon('fa-sign-in')->setHref($uri)->setAural(pht('Log In'))->setOrder(900);
             $items[] = $item;
         }
     }
     return $items;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $viewer = $this->getViewer();
     if ($viewer->getIsAdmin()) {
         $builtin_global = PhabricatorUserPreferences::BUILTIN_GLOBAL_DEFAULT;
         $global_settings = id(new PhabricatorUserPreferencesQuery())->setViewer($viewer)->withBuiltinKeys(array($builtin_global))->execute();
         if (!$global_settings) {
             $action = id(new PHUIListItemView())->setName(pht('Create Global Defaults'))->setHref('/settings/builtin/' . $builtin_global . '/')->setIcon('fa-plus');
             $crumbs->addAction($action);
         }
     }
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $project = $this->getProject();
     if ($project) {
         $ancestors = $project->getAncestorProjects();
         $ancestors = array_reverse($ancestors);
         $ancestors[] = $project;
         foreach ($ancestors as $ancestor) {
             $crumbs->addTextCrumb($ancestor->getName(), $ancestor->getURI());
         }
     }
     return $crumbs;
 }
 public final function setController(PhabricatorController $controller)
 {
     $this->controller = $controller;
     $this->setViewer($controller->getViewer());
     return $this;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     id(new PhabricatorPhurlURLEditEngine())->setViewer($this->getViewer())->addActionToCrumbs($crumbs);
     return $crumbs;
 }
 public function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create List'))->setHref($this->getApplicationURI('edit/'))->setIcon('fa-plus-square'));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     id(new ManiphestEditEngine())->setViewer($this->getViewer())->addActionToCrumbs($crumbs);
     return $crumbs;
 }
 public function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     return $crumbs;
 }
 public function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('New Message'))->setHref($this->getApplicationURI('new/'))->setIcon('fa-plus-square')->setWorkflow(true))->addAction(id(new PHUIListItemView())->setName(pht('Thread'))->setHref('#')->setIcon('fa-bars')->setStyle('display: none;')->addClass('device-widgets-selector')->addSigil('device-widgets-selector'));
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create Countdown'))->setHref($this->getApplicationURI('create/'))->setIcon('fa-plus-square'));
     return $crumbs;
 }
Example #25
0
 public function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $crumbs->addAction(id(new PHUIListItemView())->setName(pht('Create Question'))->setHref('/ponder/question/edit/')->setIcon('fa-plus-square'));
     return $crumbs;
 }
 public function shouldRequireEnabledUser()
 {
     return $this->getConfig('enabled', parent::shouldRequireEnabledUser());
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     return $crumbs;
 }
 protected function buildApplicationCrumbs()
 {
     $crumbs = parent::buildApplicationCrumbs();
     $user = $this->getUser();
     if (!$this->isSelf() && $user) {
         $username = $user->getUsername();
         $crumbs->addTextCrumb($username, "/p/{$username}/");
     }
     return $crumbs;
 }