[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/system/controller/ -> PhabricatorSystemSelectHighlightController.php (source)

   1  <?php
   2  
   3  final class PhabricatorSystemSelectHighlightController
   4    extends PhabricatorController {
   5  
   6    public function shouldRequireLogin() {
   7      return false;
   8    }
   9  
  10    public function processRequest() {
  11      $request = $this->getRequest();
  12  
  13      if ($request->isFormPost()) {
  14        $result = array('highlight' => $request->getStr('highlight'));
  15        return id(new AphrontAjaxResponse())->setContent($result);
  16      }
  17  
  18      $languages = array(
  19        '' => pht('(Use Default)'),
  20      ) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');
  21  
  22      $form = id(new AphrontFormView())
  23        ->setUser($this->getRequest()->getUser())
  24        ->appendRemarkupInstructions(pht('Choose a syntax highlighting to use.'))
  25        ->appendChild(
  26          id(new AphrontFormSelectControl())
  27            ->setLabel(pht('Highlighting'))
  28            ->setName('highlight')
  29            ->setValue($request->getStr('highlight'))
  30            ->setOptions($languages));
  31  
  32      return $this->newDialog()
  33        ->setTitle(pht('Select Syntax Highlighting'))
  34        ->appendChild($form->buildLayoutView())
  35        ->addSubmitButton(pht('Choose Highlighting'))
  36        ->addCancelButton('/');
  37    }
  38  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1