[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/paste/application/ -> PhabricatorPasteApplication.php (source)

   1  <?php
   2  
   3  final class PhabricatorPasteApplication extends PhabricatorApplication {
   4  
   5    public function getName() {
   6      return pht('Paste');
   7    }
   8  
   9    public function getBaseURI() {
  10      return '/paste/';
  11    }
  12  
  13    public function getIconName() {
  14      return 'paste';
  15    }
  16  
  17    public function getTitleGlyph() {
  18      return "\xE2\x9C\x8E";
  19    }
  20  
  21    public function getApplicationGroup() {
  22      return self::GROUP_UTILITIES;
  23    }
  24  
  25    public function getShortDescription() {
  26      return pht('Share Text Snippets');
  27    }
  28  
  29    public function getRemarkupRules() {
  30      return array(
  31        new PhabricatorPasteRemarkupRule(),
  32      );
  33    }
  34  
  35    public function getRoutes() {
  36      return array(
  37        '/P(?P<id>[1-9]\d*)(?:\$(?P<lines>\d+(?:-\d+)?))?'
  38          => 'PhabricatorPasteViewController',
  39        '/paste/' => array(
  40          '(query/(?P<queryKey>[^/]+)/)?' => 'PhabricatorPasteListController',
  41          'create/' => 'PhabricatorPasteEditController',
  42          'edit/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteEditController',
  43          'comment/(?P<id>[1-9]\d*)/' => 'PhabricatorPasteCommentController',
  44        ),
  45      );
  46    }
  47  
  48    protected function getCustomCapabilities() {
  49      return array(
  50        PasteDefaultViewCapability::CAPABILITY => array(
  51          'caption' => pht('Default view policy for newly created pastes.'),
  52        ),
  53      );
  54    }
  55  
  56    public function getQuickCreateItems(PhabricatorUser $viewer) {
  57      $items = array();
  58  
  59      $item = id(new PHUIListItemView())
  60        ->setName(pht('Paste'))
  61        ->setIcon('fa-clipboard')
  62        ->setHref($this->getBaseURI().'create/');
  63      $items[] = $item;
  64  
  65      return $items;
  66    }
  67  
  68  }


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