Differential D18133 Diff 43631 src/applications/notification/query/PhabricatorNotificationSearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/query/PhabricatorNotificationSearchEngine.php
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | switch ($query->getQueryKey()) { | ||||
| default: | default: | ||||
| $header = pht('Notifications'); | $header = pht('Notifications'); | ||||
| $no_data = pht('You have no notifications.'); | $no_data = pht('You have no notifications.'); | ||||
| break; | break; | ||||
| } | } | ||||
| $clear_uri = id(new PhutilURI('/notification/clear/')); | $clear_uri = id(new PhutilURI('/notification/clear/')); | ||||
| if ($notifications) { | if ($notifications) { | ||||
| $chrono_key = head($notifications)->getChronologicalKey(); | |||||
| $builder = id(new PhabricatorNotificationBuilder($notifications)) | $builder = id(new PhabricatorNotificationBuilder($notifications)) | ||||
| ->setUser($viewer); | ->setUser($viewer); | ||||
| $view = $builder->buildView(); | $view = $builder->buildView(); | ||||
| $clear_uri->setQueryParam( | $clear_uri->setQueryParam( | ||||
| 'chronoKey', | 'chronoKey', | ||||
| head($notifications)->getChronologicalKey()); | head($notifications)->getChronologicalKey()); | ||||
| $clear_uri->setQueryParam( | |||||
| 'redirect', | |||||
| true); | |||||
| } else { | } else { | ||||
| $view = phutil_tag_div( | $view = phutil_tag_div( | ||||
| 'phabricator-notification no-notifications', | 'phabricator-notification no-notifications', | ||||
| $no_data); | $no_data); | ||||
| $button->setDisabled(true); | $button->setDisabled(true); | ||||
| } | } | ||||
| $button->setHref((string)$clear_uri); | $button->setHref((string)$clear_uri); | ||||
| Show All 17 Lines | |||||