public function renderExample()
 {
     $view = new PhabricatorBarePageView();
     $view->appendChild(phutil_tag('h1', array(), $this->getDescription()));
     $response = new AphrontWebpageResponse();
     $response->setContent($view->render());
     return $response;
 }
 public function renderForQuicksand()
 {
     parent::willRenderPage();
     $response = $this->renderPageBodyContent();
     $response = $this->willSendResponse($response);
     $extra_config = $this->getQuicksandConfig();
     return array('content' => hsprintf('%s', $response)) + $this->buildQuicksandConfig() + $extra_config;
 }
 protected function getTail()
 {
     $request = $this->getRequest();
     $user = $request->getUser();
     $tail = array(parent::getTail());
     $response = CelerityAPI::getStaticResourceResponse();
     if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
         if ($user && $user->isLoggedIn()) {
             $aphlict_object_id = celerity_generate_unique_node_id();
             $aphlict_container_id = celerity_generate_unique_node_id();
             $client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri');
             $client_uri = new PhutilURI($client_uri);
             if ($client_uri->getDomain() == 'localhost') {
                 $this_host = $this->getRequest()->getHost();
                 $this_host = new PhutilURI('http://' . $this_host . '/');
                 $client_uri->setDomain($this_host->getDomain());
             }
             $map = CelerityResourceMap::getNamedInstance('phabricator');
             $swf_uri = $response->getURI($map, 'rsrc/swf/aphlict.swf', true);
             $enable_debug = PhabricatorEnv::getEnvConfig('notification.debug');
             $subscriptions = $this->pageObjects;
             if ($user) {
                 $subscriptions[] = $user->getPHID();
             }
             Javelin::initBehavior('aphlict-listen', array('id' => $aphlict_object_id, 'containerID' => $aphlict_container_id, 'server' => $client_uri->getDomain(), 'port' => $client_uri->getPort(), 'debug' => $enable_debug, 'swfURI' => $swf_uri, 'pageObjects' => array_fill_keys($this->pageObjects, true), 'subscriptions' => $subscriptions));
             $tail[] = phutil_tag('div', array('id' => $aphlict_container_id, 'style' => 'position: absolute; width: 0; height: 0; overflow: hidden;'), '');
         }
     }
     $tail[] = $response->renderHTMLFooter();
     return $tail;
 }