private function renderMetadataDialog(ConpherenceThread $conpherence, $error_view)
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $title = pht('Update Room');
     $form = id(new PHUIFormLayoutView())->appendChild($error_view)->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Title'))->setName('title')->setValue($conpherence->getTitle()))->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Topic'))->setName('topic')->setValue($conpherence->getTopic()));
     $policies = id(new PhabricatorPolicyQuery())->setViewer($user)->setObject($conpherence)->execute();
     $form->appendChild(id(new AphrontFormPolicyControl())->setName('viewPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_VIEW)->setPolicies($policies))->appendChild(id(new AphrontFormPolicyControl())->setName('editPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_EDIT)->setPolicies($policies))->appendChild(id(new AphrontFormPolicyControl())->setName('joinPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_JOIN)->setPolicies($policies));
     $view = id(new AphrontDialogView())->setTitle($title)->addHiddenInput('action', 'metadata')->addHiddenInput('latest_transaction_id', $request->getInt('latest_transaction_id'))->addHiddenInput('__continue__', true)->appendChild($form);
     if ($request->getExists('force_ajax')) {
         $view->addHiddenInput('force_ajax', true);
     }
     return $view;
 }
 private function renderMetadataDialog(ConpherenceThread $conpherence, $error_view)
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $title = pht('Update Room');
     $form = id(new PHUIFormLayoutView())->appendChild($error_view)->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Title'))->setName('title')->setValue($conpherence->getTitle()))->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Topic'))->setName('topic')->setValue($conpherence->getTopic()));
     $nopic = $this->getRequest()->getExists('nopic');
     $image = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG);
     if ($nopic) {
         // do not render any pic related controls
     } else {
         if ($image) {
             $crop_uri = $conpherence->loadImageURI(ConpherenceImageData::SIZE_CROP);
             $form->appendChild(id(new AphrontFormMarkupControl())->setLabel(pht('Image'))->setValue(phutil_tag('img', array('src' => $crop_uri))))->appendChild(id(new ConpherencePicCropControl())->setLabel(pht('Crop Image'))->setValue($image))->appendChild(id(new ConpherenceFormDragAndDropUploadControl())->setLabel(pht('Change Image')));
         } else {
             $form->appendChild(id(new ConpherenceFormDragAndDropUploadControl())->setLabel(pht('Image')));
         }
     }
     $policies = id(new PhabricatorPolicyQuery())->setViewer($user)->setObject($conpherence)->execute();
     $form->appendChild(id(new AphrontFormPolicyControl())->setName('viewPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_VIEW)->setPolicies($policies))->appendChild(id(new AphrontFormPolicyControl())->setName('editPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_EDIT)->setPolicies($policies))->appendChild(id(new AphrontFormPolicyControl())->setName('joinPolicy')->setPolicyObject($conpherence)->setCapability(PhabricatorPolicyCapability::CAN_JOIN)->setPolicies($policies));
     require_celerity_resource('conpherence-update-css');
     $view = id(new AphrontDialogView())->setTitle($title)->addHiddenInput('action', 'metadata')->addHiddenInput('latest_transaction_id', $request->getInt('latest_transaction_id'))->addHiddenInput('__continue__', true)->appendChild($form);
     if ($request->getExists('minimal_display')) {
         $view->addHiddenInput('minimal_display', true);
     }
     if ($request->getExists('force_ajax')) {
         $view->addHiddenInput('force_ajax', true);
     }
     return $view;
 }