/**
  * Renders HTML code for custom panel
  * IDebugPanel
  * @return void
  */
 function getPanel()
 {
     ob_start();
     $template = new FileTemplate(dirname(__FILE__) . '/bar.navigation.panel.latte');
     $template->registerFilter(new Engine());
     $template->tree = $this->getPresenters();
     $template->render();
     return $cache['output'] = ob_get_clean();
 }
 /**
  * Redirects using JavaScript.
  * @param string $url 
  * @return void
  */
 public static function redirectUrl($url)
 {
     if (FALSE === Validators::isUrl($url)) {
         throw new \Nette\InvalidArgumentException($url . " is not valid URL.");
     }
     $template = new FileTemplate(dirname(__FILE__) . '/' . self::$TEMPLATE_DIR . '/iframeRedirect.latte');
     $template->registerHelperLoader('Nette\\Templating\\Helpers::loader');
     $template->registerFilter(new \Nette\Latte\Engine());
     $template->url = $url;
     $template->render();
     exit;
 }
예제 #3
0
 /**
  * Renders HTML code for custom panel
  * IDebugPanel
  *
  * @return void
  */
 function getPanel()
 {
     ob_start();
     $template = new FileTemplate(dirname(__FILE__) . '/configurator.panel.latte');
     $template->registerFilter(new Engine());
     $template->parameters = $this->context->params;
     unset($template->parameters['nette']);
     // ??!
     $template->factories = $this->getFactories();
     $template->netteFactories = $this->getNetteFactories();
     $template->services = $this->getServices();
     $template->netteServices = $this->getNetteFactories();
     $template->render();
     return $cache['output'] = ob_get_clean();
 }
예제 #4
0
 /**
  * Returns the code for the panel itself.
  *
  * @return string
  */
 public function getPanel()
 {
     $template = new FileTemplate();
     $template->setFile(__DIR__ . "/panel.latte");
     $template->onPrepareFilters[] = function ($template) {
         $template->registerFilter(new Engine());
     };
     $template->registerHelperLoader("\\Nette\\Templating\\Helpers::loader");
     $template->setCacheStorage(new PhpFileStorage($this->container->parameters["tempDir"] . "/cache"));
     if ($this->container->application->presenter) {
         $file = $this->container->application->presenter->template->getFile();
         if (!empty($file)) {
             $template->templatePath = $file;
             $template->templateCode = $this->printCode($file);
             $template->presenterLink = $this->container->application->getPresenter()->link("this");
             $template->xhr_header = self::XHR_HEADER;
         }
     }
     ob_start();
     echo $template->render();
     return ob_get_clean();
 }
 /**
  * Renders HTML code for custom panel.
  * @return string
  * @see IDebugPanel::getPanel()
  */
 public function getPanel()
 {
     if ($this->response instanceof \Nette\Application\Responses\ForwardResponse || $this->response instanceof \Nette\Application\Responses\RedirectResponse) {
         return '';
     }
     /** @var Template */
     $template = new FileTemplate();
     $template->setFile(dirname(__FILE__) . "/bar.latte");
     $template->registerFilter(new Engine());
     $template->presenter = $template->control = $template->rootComponent = Environment::getApplication()->getPresenter();
     if ($template->presenter === NULL) {
         return NULL;
     }
     $template->wrap = static::$wrap;
     $template->cache = static::$cache ? Environment::getCache('Debugger.Panels.ComponentTree') : NULL;
     $template->dumps = static::$dumps;
     $template->parametersOpen = static::$parametersOpen;
     $template->presenterOpen = static::$presenterOpen;
     $template->showSources = static::$showSources;
     $template->omittedVariables = static::$omittedTemplateVariables;
     $template->registerHelper('parametersInfo', callback($this, 'getParametersInfo'));
     $template->registerHelper('editlink', callback($this, 'buildEditorLink'));
     $template->registerHelper('highlight', callback($this, 'highlight'));
     $template->registerHelper('filterMethods', callback($this, 'filterMethods'));
     $template->registerHelper('renderedTemplates', callback($this, 'getRenderedTemplates'));
     $template->registerHelper('isPersistent', callback($this, 'isPersistent'));
     $template->registerHelperLoader('Nette\\Templating\\Helpers::loader');
     ob_start();
     $template->render();
     return ob_get_clean();
 }