Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
1.9 kB · 78 lines
PHP
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879<?php
final class DiffusionRepositorySubversionManagementPanel extends DiffusionRepositoryManagementPanel {
const PANELKEY = 'subversion';
public function getManagementPanelLabel() { return pht('Subversion'); }
public function getManagementPanelOrder() { return 1000; }
public function shouldEnableForRepository( PhabricatorRepository $repository) { return $repository->isSVN(); }
public function getManagementPanelIcon() { $repository = $this->getRepository();
$has_any = (bool)$repository->getDetail('svn-subpath');
if ($has_any) { return 'fa-folder'; } else { return 'fa-folder grey'; } }
protected function getEditEngineFieldKeys() { return array( 'importOnly', ); }
public function buildManagementPanelCurtain() { $repository = $this->getRepository(); $viewer = $this->getViewer(); $action_list = $this->newActionList();
$can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, $repository, PhabricatorPolicyCapability::CAN_EDIT);
$subversion_uri = $this->getEditPageURI();
$action_list->addAction( id(new PhabricatorActionView()) ->setIcon('fa-pencil') ->setName(pht('Edit Properties')) ->setHref($subversion_uri) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit));
return $this->newCurtainView() ->setActionList($action_list); }
public function buildManagementPanelContent() { $repository = $this->getRepository(); $viewer = $this->getViewer();
$view = id(new PHUIPropertyListView()) ->setViewer($viewer);
$default_branch = nonempty( $repository->getDetail('svn-subpath'), phutil_tag('em', array(), pht('Import Entire Repository'))); $view->addProperty(pht('Import Only'), $default_branch);
return $this->newBox(pht('Subversion'), $view); }
}