mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 20:02:40 +01:00
2492fef029
Summary: Ref T8441. Ref T7715. - Update PholioSearchEngine. - Automatically add project fields. - Update Paste to support project search. - Simplify common Query class construction. Test Plan: - Searched for pastes. - Searched for mocks. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7715, T8441 Differential Revision: https://secure.phabricator.com/D13174
40 lines
814 B
PHP
40 lines
814 B
PHP
<?php
|
|
|
|
final class PhabricatorSearchCheckboxesField
|
|
extends PhabricatorSearchField {
|
|
|
|
private $options;
|
|
|
|
public function setOptions(array $options) {
|
|
$this->options = $options;
|
|
return $this;
|
|
}
|
|
|
|
public function getOptions() {
|
|
return $this->options;
|
|
}
|
|
|
|
protected function getDefaultValue() {
|
|
return array();
|
|
}
|
|
|
|
protected function getValueFromRequest(AphrontRequest $request, $key) {
|
|
return $this->getListFromRequest($request, $key);
|
|
}
|
|
|
|
protected function newControl() {
|
|
$value = array_fuse($this->getValue());
|
|
|
|
$control = new AphrontFormCheckboxControl();
|
|
foreach ($this->getOptions() as $key => $option) {
|
|
$control->addCheckbox(
|
|
$this->getKey().'[]',
|
|
$key,
|
|
$option,
|
|
isset($value[$key]));
|
|
}
|
|
|
|
return $control;
|
|
}
|
|
|
|
}
|