[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/transactions/controller/ -> PhabricatorApplicationTransactionController.php (source)

   1  <?php
   2  
   3  abstract class PhabricatorApplicationTransactionController
   4    extends PhabricatorController {
   5  
   6    protected function guessCancelURI(
   7      PhabricatorUser $viewer,
   8      PhabricatorApplicationTransaction $xaction) {
   9  
  10      // Take an educated guess at the URI where the transactions appear so we
  11      // can send the cancel button somewhere sensible. This won't always get the
  12      // best answer (for example, Diffusion's history is visible on a page other
  13      // than the main object view page) but should always get a reasonable one.
  14  
  15      $cancel_uri = '/';
  16      $handle = id(new PhabricatorHandleQuery())
  17        ->setViewer($viewer)
  18        ->withPHIDs(array($xaction->getObjectPHID()))
  19        ->executeOne();
  20      if ($handle) {
  21        $cancel_uri = $handle->getURI();
  22      }
  23  
  24      return $cancel_uri;
  25    }
  26  
  27  }


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