Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/control/AphrontFormPolicyControl.php
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | Javelin::initBehavior( | ||||
'groups' => array_keys($options), | 'groups' => array_keys($options), | ||||
'order' => $order, | 'order' => $order, | ||||
'icons' => $icons, | 'icons' => $icons, | ||||
'labels' => $labels, | 'labels' => $labels, | ||||
'value' => $this->getValue(), | 'value' => $this->getValue(), | ||||
'capability' => $this->capability, | 'capability' => $this->capability, | ||||
'editURI' => '/policy/edit/'.$context_path, | 'editURI' => '/policy/edit/'.$context_path, | ||||
'customPlaceholder' => $this->getCustomPolicyPlaceholder(), | 'customPlaceholder' => $this->getCustomPolicyPlaceholder(), | ||||
'disabled' => $this->getDisabled(), | |||||
)); | )); | ||||
$selected = idx($flat_options, $this->getValue(), array()); | $selected = idx($flat_options, $this->getValue(), array()); | ||||
$selected_icon = idx($selected, 'icon'); | $selected_icon = idx($selected, 'icon'); | ||||
$selected_name = idx($selected, 'name'); | $selected_name = idx($selected, 'name'); | ||||
$spaces_control = $this->buildSpacesControl(); | $spaces_control = $this->buildSpacesControl(); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | private function buildSpacesControl() { | ||||
} | } | ||||
$select = AphrontFormSelectControl::renderSelectTag( | $select = AphrontFormSelectControl::renderSelectTag( | ||||
$space_phid, | $space_phid, | ||||
PhabricatorSpacesNamespaceQuery::getSpaceOptionsForViewer( | PhabricatorSpacesNamespaceQuery::getSpaceOptionsForViewer( | ||||
$viewer, | $viewer, | ||||
$space_phid), | $space_phid), | ||||
array( | array( | ||||
'disabled' => $this->getDisabled(), | |||||
'name' => 'spacePHID', | 'name' => 'spacePHID', | ||||
'class' => 'aphront-space-select-control-knob', | 'class' => 'aphront-space-select-control-knob', | ||||
)); | )); | ||||
return $select; | return $select; | ||||
} | } | ||||
} | } |