type = idx($data, 'type'); } public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $map = HeraldContentTypeConfig::getContentTypeMap(); if (empty($map[$this->type])) { reset($map); $this->type = key($map); } $form = id(new AphrontFormView()) ->setUser($user) ->setAction('/herald/rule/') ->appendChild( id(new AphrontFormSelectControl()) ->setLabel('New rule for') ->setName('type') ->setValue($this->type) ->setOptions($map)) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue('Create Rule') ->addCancelButton('/herald/view/'.$this->type.'/')); $panel = new AphrontPanelView(); $panel->setHeader('Create New Herald Rule'); $panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->appendChild($form); return $this->buildStandardPageResponse( $panel, array( 'title' => 'Create Herald Rule', )); } }