コード例 #1
0
 protected function buildHeaderPaneContent(ConpherenceThread $conpherence)
 {
     $crumbs = $this->buildApplicationCrumbs();
     if ($conpherence->getTitle()) {
         $title = $conpherence->getTitle();
     } else {
         $title = pht('[No Title]');
     }
     $crumbs->addCrumb(id(new PhabricatorCrumbView())->setName($title)->setHref($this->getApplicationURI('update/' . $conpherence->getID() . '/'))->setWorkflow(true));
     return hsprintf('%s', array(phutil_tag('div', array('class' => 'header-loading-mask'), ''), $crumbs));
 }
コード例 #2
0
 private function renderMetadataDialogue(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()));
     $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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 private function renderMetadataDialogue(ConpherenceThread $conpherence, $error_view)
 {
     $form = id(new PHUIFormLayoutView())->appendChild($error_view)->appendChild(id(new AphrontFormTextControl())->setLabel(pht('Title'))->setName('title')->setValue($conpherence->getTitle()));
     require_celerity_resource('conpherence-update-css');
     return id(new AphrontDialogView())->setTitle(pht('Update Conpherence'))->addHiddenInput('action', 'metadata')->addHiddenInput('__continue__', true)->appendChild($form);
 }