private function buildFieldList(PhabricatorEditEngineConfiguration $config) { $viewer = $this->getViewer(); $engine = $config->getEngine(); $fields = $engine->getFieldsForConfig($config); $form = id(new AphrontFormView())->setUser($viewer)->setAction(null); foreach ($fields as $field) { $field->setIsPreview(true); $field->appendToForm($form); } $info = id(new PHUIInfoView())->setSeverity(PHUIInfoView::SEVERITY_NOTICE)->setErrors(array(pht('This is a preview of the current form configuration.'))); $box = id(new PHUIObjectBoxView())->setHeaderText(pht('Form Preview'))->setInfoView($info)->setForm($form); return $box; }
private function newQuickCreateItem(PhabricatorEditEngineConfiguration $config) { $item_name = $config->getName(); $item_icon = $config->getIcon(); $form_key = $config->getIdentifier(); $item_uri = $this->getEditURI(null, "form/{$form_key}/"); return id(new PHUIListItemView())->setName($item_name)->setIcon($item_icon)->setHref($item_uri); }
protected function newEditableObject() { return PhabricatorEditEngineConfiguration::initializeNewConfiguration($this->getViewer(), $this->getTargetEngine()); }
protected final function newConfiguration() { return PhabricatorEditEngineConfiguration::initializeNewConfiguration($this->getViewer(), $this); }