[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class DiffusionBrowseDirectoryController 4 extends DiffusionBrowseController { 5 6 private $browseQueryResults; 7 8 public function setBrowseQueryResults(DiffusionBrowseResultSet $results) { 9 $this->browseQueryResults = $results; 10 return $this; 11 } 12 13 public function getBrowseQueryResults() { 14 return $this->browseQueryResults; 15 } 16 17 public function processRequest() { 18 $drequest = $this->diffusionRequest; 19 20 $results = $this->getBrowseQueryResults(); 21 $reason = $results->getReasonForEmptyResultSet(); 22 23 $content = array(); 24 $actions = $this->buildActionView($drequest); 25 $properties = $this->buildPropertyView($drequest, $actions); 26 27 $object_box = id(new PHUIObjectBoxView()) 28 ->setHeader($this->buildHeaderView($drequest)) 29 ->addPropertyList($properties); 30 31 $content[] = $object_box; 32 $content[] = $this->renderSearchForm($collapsed = true); 33 34 if (!$results->isValidResults()) { 35 $empty_result = new DiffusionEmptyResultView(); 36 $empty_result->setDiffusionRequest($drequest); 37 $empty_result->setDiffusionBrowseResultSet($results); 38 $empty_result->setView($this->getRequest()->getStr('view')); 39 $content[] = $empty_result; 40 } else { 41 $phids = array(); 42 foreach ($results->getPaths() as $result) { 43 $data = $result->getLastCommitData(); 44 if ($data) { 45 if ($data->getCommitDetail('authorPHID')) { 46 $phids[$data->getCommitDetail('authorPHID')] = true; 47 } 48 } 49 } 50 51 $phids = array_keys($phids); 52 $handles = $this->loadViewerHandles($phids); 53 54 $browse_table = new DiffusionBrowseTableView(); 55 $browse_table->setDiffusionRequest($drequest); 56 $browse_table->setHandles($handles); 57 $browse_table->setPaths($results->getPaths()); 58 $browse_table->setUser($this->getRequest()->getUser()); 59 60 $browse_panel = new AphrontPanelView(); 61 $browse_panel->appendChild($browse_table); 62 $browse_panel->setNoBackground(); 63 64 $content[] = $browse_panel; 65 } 66 67 $content[] = $this->buildOpenRevisions(); 68 69 $readme = $this->callConduitWithDiffusionRequest( 70 'diffusion.readmequery', 71 array( 72 'paths' => $results->getPathDicts(), 73 'commit' => $drequest->getStableCommit(), 74 )); 75 if ($readme) { 76 $box = new PHUIBoxView(); 77 $box->appendChild($readme); 78 $box->addPadding(PHUI::PADDING_LARGE); 79 80 $object_box = id(new PHUIObjectBoxView()) 81 ->setHeaderText(pht('README')) 82 ->appendChild($box); 83 84 $content[] = $object_box; 85 } 86 87 $crumbs = $this->buildCrumbs( 88 array( 89 'branch' => true, 90 'path' => true, 91 'view' => 'browse', 92 )); 93 94 return $this->buildApplicationPage( 95 array( 96 $crumbs, 97 $content, 98 ), 99 array( 100 'title' => array( 101 nonempty(basename($drequest->getPath()), '/'), 102 $drequest->getRepository()->getCallsign().' Repository', 103 ), 104 )); 105 } 106 107 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |