Changeset View
Changeset View
Standalone View
Standalone View
src/view/page/PhabricatorStandardPageView.php
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | Javelin::initBehavior( | ||||
array( | array( | ||||
'tokenName' => AphrontRequest::getCSRFTokenName(), | 'tokenName' => AphrontRequest::getCSRFTokenName(), | ||||
'header' => AphrontRequest::getCSRFHeaderName(), | 'header' => AphrontRequest::getCSRFHeaderName(), | ||||
'current' => $current_token, | 'current' => $current_token, | ||||
)); | )); | ||||
Javelin::initBehavior('device'); | Javelin::initBehavior('device'); | ||||
if ($user->hasSession()) { | |||||
$hisec = ($user->getSession()->getHighSecurityUntil() - time()); | |||||
if ($hisec > 0) { | |||||
$remaining_time = phutil_format_relative_time($hisec); | |||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'high-security-warning', | 'high-security-warning', | ||||
array( | $this->getHighSecurityWarningConfig()); | ||||
'uri' => '/auth/session/downgrade/', | |||||
'message' => pht( | |||||
'Your session is in high security mode. When you '. | |||||
'finish using it, click here to leave.', | |||||
$remaining_time), | |||||
)); | |||||
} | |||||
} | |||||
if ($console) { | if ($console) { | ||||
require_celerity_resource('aphront-dark-console-css'); | require_celerity_resource('aphront-dark-console-css'); | ||||
$headers = array(); | $headers = array(); | ||||
if (DarkConsoleXHProfPluginAPI::isProfilerStarted()) { | if (DarkConsoleXHProfPluginAPI::isProfilerStarted()) { | ||||
$headers[DarkConsoleXHProfPluginAPI::getProfilerHeader()] = 'page'; | $headers[DarkConsoleXHProfPluginAPI::getProfilerHeader()] = 'page'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | return array( | ||||
// T3684. | // T3684. | ||||
'uri' => pht('Main Request'), | 'uri' => pht('Main Request'), | ||||
'selected' => $user ? $user->getConsoleTab() : null, | 'selected' => $user ? $user->getConsoleTab() : null, | ||||
'visible' => $user ? (int)$user->getConsoleVisible() : true, | 'visible' => $user ? (int)$user->getConsoleVisible() : true, | ||||
'headers' => $headers, | 'headers' => $headers, | ||||
); | ); | ||||
} | } | ||||
private function getHighSecurityWarningConfig() { | |||||
$user = $this->getRequest()->getUser(); | |||||
$show = false; | |||||
if ($user->hasSession()) { | |||||
$hisec = ($user->getSession()->getHighSecurityUntil() - time()); | |||||
if ($hisec > 0) { | |||||
$show = true; | |||||
} | |||||
} | |||||
return array( | |||||
'show' => $show, | |||||
'uri' => '/auth/session/downgrade/', | |||||
'message' => pht( | |||||
'Your session is in high security mode. When you '. | |||||
'finish using it, click here to leave.'), | |||||
); | |||||
} | |||||
private function renderFooter() { | private function renderFooter() { | ||||
if (!$this->getShowChrome()) { | if (!$this->getShowChrome()) { | ||||
return null; | return null; | ||||
} | } | ||||
if (!$this->getShowFooter()) { | if (!$this->getShowFooter()) { | ||||
return null; | return null; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | foreach ($applications as $application_class) { | ||||
} | } | ||||
$application = PhabricatorApplication::getByClass($application_class); | $application = PhabricatorApplication::getByClass($application_class); | ||||
$rendered_dropdowns[$application_class] = | $rendered_dropdowns[$application_class] = | ||||
$application->buildMainMenuExtraNodes( | $application->buildMainMenuExtraNodes( | ||||
$viewer, | $viewer, | ||||
$controller); | $controller); | ||||
} | } | ||||
$hisec_warning_config = $this->getHighSecurityWarningConfig(); | |||||
$console_config = null; | $console_config = null; | ||||
$console = $this->getConsole(); | $console = $this->getConsole(); | ||||
if ($console) { | if ($console) { | ||||
$console_config = $this->getConsoleConfig(); | $console_config = $this->getConsoleConfig(); | ||||
} | } | ||||
return array( | return array( | ||||
'title' => $this->getTitle(), | 'title' => $this->getTitle(), | ||||
'aphlictDropdownData' => array( | 'aphlictDropdownData' => array( | ||||
$dropdown_query->getNotificationData(), | $dropdown_query->getNotificationData(), | ||||
$dropdown_query->getConpherenceData(), | $dropdown_query->getConpherenceData(), | ||||
), | ), | ||||
'globalDragAndDrop' => $controller->isGlobalDragAndDropUploadEnabled(), | 'globalDragAndDrop' => $controller->isGlobalDragAndDropUploadEnabled(), | ||||
'aphlictDropdowns' => $rendered_dropdowns, | 'aphlictDropdowns' => $rendered_dropdowns, | ||||
'hisecWarningConfig' => $hisec_warning_config, | |||||
'consoleConfig' => $console_config, | 'consoleConfig' => $console_config, | ||||
) + $this->buildAphlictListenConfigData(); | ) + $this->buildAphlictListenConfigData(); | ||||
} | } | ||||
private function buildAphlictListenConfigData() { | private function buildAphlictListenConfigData() { | ||||
$user = $this->getRequest()->getUser(); | $user = $this->getRequest()->getUser(); | ||||
$subscriptions = $this->pageObjects; | $subscriptions = $this->pageObjects; | ||||
$subscriptions[] = $user->getPHID(); | $subscriptions[] = $user->getPHID(); | ||||
Show All 33 Lines |