diff --git a/src/applications/help/controller/PhabricatorHelpDocumentationController.php b/src/applications/help/controller/PhabricatorHelpDocumentationController.php index ce4dc38f42..4983520bab 100644 --- a/src/applications/help/controller/PhabricatorHelpDocumentationController.php +++ b/src/applications/help/controller/PhabricatorHelpDocumentationController.php @@ -1,52 +1,48 @@ getViewer(); $application_class = $request->getURIData('application'); $application = id(new PhabricatorApplicationQuery()) ->setViewer($viewer) ->withClasses(array($application_class)) ->executeOne(); if (!$application) { return new Aphront404Response(); } $items = $application->getHelpMenuItems($viewer); $title = pht('%s Help', $application->getName()); $list = id(new PHUIObjectItemListView()) ->setUser($viewer); foreach ($items as $item) { if ($item->getType() == PHUIListItemView::TYPE_LABEL) { continue; } $list->addItem( id(new PHUIObjectItemView()) ->setHeader($item->getName()) ->setWorkflow($item->getWorkflow()) ->setHref($item->getHref())); } $crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb($title); - return $this->buildApplicationPage( - array( - $crumbs, - $list, - ), - array( - 'title' => $title, - )); + return $this->newPage() + ->setTitle($title) + ->setCrumbs($crumbs) + ->appendChild($list); } } diff --git a/src/applications/help/controller/PhabricatorHelpEditorProtocolController.php b/src/applications/help/controller/PhabricatorHelpEditorProtocolController.php index 010e41ffcd..22ad0f8d2d 100644 --- a/src/applications/help/controller/PhabricatorHelpEditorProtocolController.php +++ b/src/applications/help/controller/PhabricatorHelpEditorProtocolController.php @@ -1,51 +1,47 @@ getViewer(); - $dialog = id(new AphrontDialogView()) - ->setUser($viewer) + return $this->newDialog() ->setMethod('GET') ->setSubmitURI('/settings/panel/display/') ->setTitle(pht('Unsupported Editor Protocol')) ->appendParagraph( pht( 'Your configured editor URI uses an unsupported protocol. Change '. 'your settings to use a supported protocol, or ask your '. 'administrator to add support for the chosen protocol by '. 'configuring: %s', phutil_tag('tt', array(), 'uri.allowed-editor-protocols'))) ->addSubmitButton(pht('Change Settings')) ->addCancelButton('/'); - - return id(new AphrontDialogResponse()) - ->setDialog($dialog); } public static function hasAllowedProtocol($uri) { $uri = new PhutilURI($uri); $editor_protocol = $uri->getProtocol(); if (!$editor_protocol) { // The URI must have a protocol. return false; } $allowed_key = 'uri.allowed-editor-protocols'; $allowed_protocols = PhabricatorEnv::getEnvConfig($allowed_key); if (empty($allowed_protocols[$editor_protocol])) { // The protocol must be on the allowed protocol whitelist. return false; } return true; } } diff --git a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php index b136265d7f..80bd259c48 100644 --- a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php +++ b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php @@ -1,70 +1,67 @@ getViewer(); $keys = $request->getStr('keys'); try { $keys = phutil_json_decode($keys); } catch (PhutilJSONParserException $ex) { return new Aphront400Response(); } // There have been at least two users asking for a keyboard shortcut to // close the dialog, so be explicit that escape works since it isn't // terribly discoverable. $keys[] = array( 'keys' => array('esc'), 'description' => pht('Close any dialog, including this one.'), ); $stroke_map = array( 'left' => "\xE2\x86\x90", 'right' => "\xE2\x86\x92", 'up' => "\xE2\x86\x91", 'down' => "\xE2\x86\x93", 'return' => "\xE2\x8F\x8E", 'tab' => "\xE2\x87\xA5", 'delete' => "\xE2\x8C\xAB", ); $rows = array(); foreach ($keys as $shortcut) { $keystrokes = array(); foreach ($shortcut['keys'] as $stroke) { $stroke = idx($stroke_map, $stroke, $stroke); $keystrokes[] = phutil_tag('kbd', array(), $stroke); } $keystrokes = phutil_implode_html(' or ', $keystrokes); $rows[] = phutil_tag( 'tr', array(), array( phutil_tag('th', array(), $keystrokes), phutil_tag('td', array(), $shortcut['description']), )); } $table = phutil_tag( 'table', array('class' => 'keyboard-shortcut-help'), $rows); - $dialog = id(new AphrontDialogView()) - ->setUser($viewer) + return $this->newDialog() ->setTitle(pht('Keyboard Shortcuts')) ->appendChild($table) ->addCancelButton('#', pht('Close')); - return id(new AphrontDialogResponse()) - ->setDialog($dialog); } }