Ejemplo n.º 1
0
 public function buildSearchForm(AphrontFormView $form, PhabricatorSavedQuery $saved)
 {
     $all_types = array();
     foreach (DivinerAtom::getAllTypes() as $type) {
         $all_types[$type] = DivinerAtom::getAtomTypeNameString($type);
     }
     asort($all_types);
     $types = $saved->getParameter('types', array());
     $types = array_fuse($types);
     $type_control = id(new AphrontFormCheckboxControl())->setLabel(pht('Types'));
     foreach ($all_types as $type => $name) {
         $type_control->addCheckbox('types[]', $type, $name, isset($types[$type]));
     }
     $form->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Name Contains'))->setName('name')->setValue($saved->getParameter('name')))->appendChild($type_control);
 }