Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/view/DiffusionBrowseTableView.php
<?php | <?php | ||||
final class DiffusionBrowseTableView extends DiffusionView { | final class DiffusionBrowseTableView extends DiffusionView { | ||||
private $paths; | private $paths; | ||||
private $handles = array(); | |||||
public function setPaths(array $paths) { | public function setPaths(array $paths) { | ||||
assert_instances_of($paths, 'DiffusionRepositoryPath'); | assert_instances_of($paths, 'DiffusionRepositoryPath'); | ||||
$this->paths = $paths; | $this->paths = $paths; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setHandles(array $handles) { | |||||
assert_instances_of($handles, 'PhabricatorObjectHandle'); | |||||
$this->handles = $handles; | |||||
return $this; | |||||
} | |||||
public function render() { | public function render() { | ||||
$request = $this->getDiffusionRequest(); | $request = $this->getDiffusionRequest(); | ||||
$repository = $request->getRepository(); | $repository = $request->getRepository(); | ||||
require_celerity_resource('diffusion-css'); | require_celerity_resource('diffusion-css'); | ||||
$base_path = trim($request->getPath(), '/'); | $base_path = trim($request->getPath(), '/'); | ||||
if ($base_path) { | if ($base_path) { | ||||
$base_path = $base_path.'/'; | $base_path = $base_path.'/'; | ||||
} | } | ||||
$need_pull = array(); | $need_pull = array(); | ||||
$rows = array(); | $rows = array(); | ||||
$show_edit = false; | |||||
foreach ($this->paths as $path) { | foreach ($this->paths as $path) { | ||||
$full_path = $base_path.$path->getPath(); | $full_path = $base_path.$path->getPath(); | ||||
$dir_slash = null; | $dir_slash = null; | ||||
$file_type = $path->getFileType(); | $file_type = $path->getFileType(); | ||||
if ($file_type == DifferentialChangeType::FILE_DIRECTORY) { | if ($file_type == DifferentialChangeType::FILE_DIRECTORY) { | ||||
$browse_text = $path->getPath().'/'; | $browse_text = $path->getPath().'/'; | ||||
$dir_slash = '/'; | $dir_slash = '/'; | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |