Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / settings / controller / PhabricatorSettingsIssueController.php
blobbb472c8832eb767b5d1df8ecd10916a12566d9e7
1 <?php
3 final class PhabricatorSettingsIssueController
4 extends PhabricatorController {
6 public function handleRequest(AphrontRequest $request) {
7 $viewer = $request->getViewer();
9 $setup_uri = id(new PhabricatorEmailAddressesSettingsPanel())
10 ->setViewer($viewer)
11 ->setUser($viewer)
12 ->getPanelURI();
14 $issues = array();
15 if (!$viewer->getIsEmailVerified()) {
16 // We could specifically detect that the user has missed email because
17 // their address is unverified here and point them at Mail so they can
18 // look at messages they missed.
20 // We could also detect that an administrator unverified their address
21 // and let that come with a message.
23 // For now, just make sure the unverified address does not escape notice.
24 $issues[] = array(
25 'title' => pht('Primary Email Unverified'),
26 'summary' => pht(
27 'Your primary email address is unverified. You will not be able '.
28 'to receive email until you verify it.'),
29 'uri' => $setup_uri,
33 if ($issues) {
34 require_celerity_resource('phabricator-notification-menu-css');
36 $items = array();
37 foreach ($issues as $issue) {
38 $classes = array();
39 $classes[] = 'phabricator-notification';
40 $classes[] = 'phabricator-notification-unread';
42 $uri = $issue['uri'];
43 $title = $issue['title'];
44 $summary = $issue['summary'];
46 $items[] = javelin_tag(
47 'div',
48 array(
49 'class' =>
50 'phabricator-notification phabricator-notification-unread',
51 'sigil' => 'notification',
52 'meta' => array(
53 'href' => $uri,
56 array(
57 phutil_tag('strong', array(), pht('%s:', $title)),
58 ' ',
59 $summary,
60 ));
63 $content = phutil_tag(
64 'div',
65 array(
66 'class' => 'setup-issue-menu',
68 $items);
69 } else {
70 $content = phutil_tag(
71 'div',
72 array(
73 'class' => 'phabricator-notification no-notifications',
75 pht('You have no account setup issues.'));
78 $header = phutil_tag(
79 'div',
80 array(
81 'class' => 'phabricator-notification-header',
83 phutil_tag(
84 'a',
85 array(
86 'href' => $setup_uri,
88 pht('Account Setup Issues')));
90 $content = array(
91 $header,
92 $content,
95 $json = array(
96 'content' => hsprintf('%s', $content),
97 'number' => count($issues),
100 return id(new AphrontAjaxResponse())->setContent($json);