Path: blob/master/src/applications/dashboard/install/PhabricatorDashboardProjectInstallWorkflow.php
12242 views
<?php12final class PhabricatorDashboardProjectInstallWorkflow3extends PhabricatorDashboardObjectInstallWorkflow {45const WORKFLOWKEY = 'project';67public function getOrder() {8return 3000;9}1011protected function newWorkflowMenuItem() {12return $this->newMenuItem()13->setHeader(pht('Add to Project Menu'))14->setImageIcon('fa-briefcase')15->addAttribute(16pht('Add this dashboard to the menu for a project.'));17}1819protected function newProfileEngine() {20return new PhabricatorProjectProfileMenuEngine();21}2223protected function newQuery() {24return new PhabricatorProjectQuery();25}2627protected function newConfirmDialog($object) {28return $this->newDialog()29->setTitle(pht('Add Dashboard to Project Menu'))30->appendParagraph(31pht(32'Add the dashboard %s to the menu for project %s?',33$this->getDashboardDisplayName(),34phutil_tag('strong', array(), $object->getName())))35->addSubmitButton(pht('Add to Project'));36}3738protected function newObjectSelectionForm($object) {39$viewer = $this->getViewer();4041if ($object) {42$tokenizer_value = array($object->getPHID());43} else {44$tokenizer_value = array();45}4647return id(new AphrontFormView())48->setViewer($viewer)49->appendInstructions(50pht(51'Select which project menu you want to add the dashboard %s to.',52$this->getDashboardDisplayName()))53->appendControl(54id(new AphrontFormTokenizerControl())55->setName('target')56->setLimit(1)57->setLabel(pht('Add to Project'))58->setValue($tokenizer_value)59->setDatasource(new PhabricatorProjectDatasource()));60}6162}636465