Differential D12210 Diff 29358 src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/controller/PhabricatorDashboardInstallController.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | switch ($object_phid) { | ||||
break; | break; | ||||
} | } | ||||
$installer_phid = $viewer->getPHID(); | $installer_phid = $viewer->getPHID(); | ||||
$application_class = $request->getStr( | $application_class = $request->getStr( | ||||
'applicationClass', | 'applicationClass', | ||||
'PhabricatorHomeApplication'); | 'PhabricatorHomeApplication'); | ||||
$handles = $this->loadHandles(array( | |||||
$object_phid, | |||||
$installer_phid, | |||||
)); | |||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
$dashboard_install = id(new PhabricatorDashboardInstall()) | $dashboard_install = id(new PhabricatorDashboardInstall()) | ||||
->loadOneWhere( | ->loadOneWhere( | ||||
'objectPHID = %s AND applicationClass = %s', | 'objectPHID = %s AND applicationClass = %s', | ||||
$object_phid, | $object_phid, | ||||
$application_class); | $application_class); | ||||
if (!$dashboard_install) { | if (!$dashboard_install) { | ||||
$dashboard_install = id(new PhabricatorDashboardInstall()) | $dashboard_install = id(new PhabricatorDashboardInstall()) | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | switch ($application_class) { | ||||
} | } | ||||
} else { | } else { | ||||
$dialog->appendParagraph( | $dialog->appendParagraph( | ||||
pht( | pht( | ||||
'Install this dashboard as the home page dashboard for %s?', | 'Install this dashboard as the home page dashboard for %s?', | ||||
phutil_tag( | phutil_tag( | ||||
'strong', | 'strong', | ||||
array(), | array(), | ||||
$this->getHandle($object_phid)->getName()))); | $viewer->renderHandle($object_phid)))); | ||||
} | } | ||||
break; | break; | ||||
default: | default: | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unknown dashboard application class "%s"!', | 'Unknown dashboard application class "%s"!', | ||||
$application_class)); | $application_class)); | ||||
} | } | ||||
Show All 25 Lines |