public function get()
 {
     $template = new TemplateBootstrap("navbar");
     if (DISPATCHER_USE_REWRITE) {
         $test_link = DISPATCHER_BASEURL . 'test/';
         $about_link = DISPATCHER_BASEURL . 'about/';
     } else {
         $test_link = DISPATCHER_BASEURL . '?service=test';
         $about_link = DISPATCHER_BASEURL . '?service=about';
     }
     $template->setTitle("Comodojo dispatcher")->setBrand("comodojo::dispatcher");
     $template->addMenu("right")->addMenuItem("Test", $test_link, "right")->addMenuItem("About", $about_link, "right");
     $content = '<div class="container"><h1>Comodojo dispatcher</h1><h3 class="text-muted">service-oriented REST microframework</span></h3>';
     $content .= '<p style="margin: 40px; text-align: center">
             <a href="https://docs.comodojo.org/projects/dispatcherframework" target="_blank" class="btn btn-lg btn-success" style="margin-top:40px;" role="button"><span class="glyphicon glyphicon-book"></span>&nbsp;&nbsp;Read documentation</a>&nbsp;&nbsp;
             <a href="https://api.comodojo.org/dispatcher/" target="_blank" class="btn btn-lg btn-primary" style="margin-top:40px;" role="button"><span class="glyphicon glyphicon-cog"></span>&nbsp;&nbsp;Explore API</a>&nbsp;&nbsp;
             <a href="https://github.com/comodojo/dispatcher.framework" target="_blank" class="btn btn-lg btn-danger" style="margin-top:40px;" role="button"><span class="glyphicon glyphicon-new-window"></span>&nbsp;&nbsp;Fork on GitHub</a>
         </p>';
     $content .= '<section style="margin-top:60px;" class="jumbotron">
                 <div class="section-inner">
                     <p>Comodojo dispatcher is distributed under the terms of the GNU V3 General Public License as published by the Free Software Foundation; you can find a copy in each package released or following <a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">this link</a>.</p>
                     <address>
                         Keep in touch: <a href="mailto:#">info@comodojo.org</a><br />
                     </address>
                 </div>
             </section>
         </div>';
     $template->setContent($content);
     return $template->serialize();
 }
 public final function toPdf()
 {
     define('DOMPDF_ENABLE_AUTOLOAD', false);
     require_once DISPATCHER_REAL_PATH . 'vendor/dompdf/dompdf/dompdf_config.inc.php';
     $dompdf = new \DOMPDF();
     $template = new TemplateBootstrap("basic", "lumen");
     $template->setContent($this->toHtml());
     $dompdf->load_html($template->serialize());
     $dompdf->render();
     return $dompdf->output();
 }
    public static function custom_404($ObjectError)
    {
        $template = new TemplateBootstrap("basic", "superhero");
        $template->setTitle("Comodojo Gitdoc")->setBrand("comodojo/documentation");
        $content = '
            <div class="jumbotron" style="text-align:center;">
                <h1>Project not found!</h1>
                <p class="lead">Have you tried one of following links?</p>
                <p>';
        foreach (self::getProjects() as $project) {
            $content .= '<a class="btn btn-lg btn-success" href="' . DISPATCHER_BASEURL . $project . '/" role="button" style="margin-top:10px;"><span class="glyphicon glyphicon-share"></span>&nbsp;&nbsp;' . $project . '</a>&nbsp;&nbsp;';
        }
        $content .= '</p>

            </div>
        ';
        $template->setContent($content);
        $ObjectError->setContent($template->serialize());
        return $ObjectError;
    }
 public function get()
 {
     $template = new TemplateBootstrap("navbar");
     if (DISPATCHER_USE_REWRITE) {
         $test_link = DISPATCHER_BASEURL . 'test/';
         $about_link = DISPATCHER_BASEURL . 'about/';
     } else {
         $test_link = DISPATCHER_BASEURL . '?service=test';
         $about_link = DISPATCHER_BASEURL . '?service=about';
     }
     $content = '
         <div class="jumbotron">
             <h1>Welcome to Comodojo dispatcher</h1>
             <p>This is a default landing page (provided by dispatcher.servicebundle.default).</p>
             <p>To jump to test section use the fat button below or top navbar</p>
             <p>
                 <a class="btn btn-lg btn-primary" href="' . $test_link . '" role="button">Begin tests</a>
             </p>
         </div>';
     $template->setTitle("Comodojo dispatcher")->setBrand("comodojo::dispatcher");
     $template->addMenu("right")->addMenuItem("Test", $test_link, "right")->addMenuItem("About", $about_link, "right");
     $template->setContent($content);
     return $template->serialize();
 }
 public function get()
 {
     // $attributes = $this->getAttributes();
     // if ( isset($attributes['theme']) ) $theme = in_array($attributes['theme'], $this->available_themes) ? $attributes['theme'] : "default";
     // else $theme = "default";
     $theme = "default";
     $template = new TemplateBootstrap("dash", $theme);
     if (DISPATCHER_USE_REWRITE) {
         $test_link = DISPATCHER_BASEURL . 'test/';
         $about_link = DISPATCHER_BASEURL . 'about/';
     } else {
         $test_link = DISPATCHER_BASEURL . '?service=test';
         $about_link = DISPATCHER_BASEURL . '?service=about';
     }
     $template->setTitle("Comodojo dispatcher")->setBrand("comodojo::dispatcher");
     $template->addMenu("right")->addMenuItem("Test", $test_link, "right")->addMenuItem("About", $about_link, "right");
     $template->setContent('<h1>Framework functional tests</h1><p class="lead"><span class="glyphicon glyphicon-arrow-left"></span>&nbsp;&nbsp;Select a test case from the left menu to start.</p>');
     $template->addScript(DISPATCHER_BASEURL . "vendor/comodojo/dispatcher.servicebundle.test/resources/js/dispatcher.test.js?" . microtime());
     $template->addScript(DISPATCHER_BASEURL . "vendor/comodojo/dispatcher.servicebundle.test/resources/js/dispatcher.working.mode.js.php?rw=" . (DISPATCHER_USE_REWRITE ? '1' : '0') . '&' . microtime());
     return $template->serialize();
 }
 private function toPrintable($parser, $configuration, $project, $version, $project_data)
 {
     $template = new TemplateBootstrap("basic", "lumen");
     // setup template
     $template->setTitle($configuration['description'])->setBrand($configuration['sitename']);
     // go parser
     if ($version == "live") {
         $path = $project_data["live"]["path"];
         $time = $project_data["live"]["time"];
         $senderName = $project_data["live"]["senderName"];
         $senderHtml = null;
         $senderAvatar = null;
         $compare = $project_data["live"]["compare"];
     } else {
         if ($version == $project_data["latest"]["version"]) {
             $path = $project_data["latest"]["path"];
             $time = $project_data["latest"]["time"];
             $senderName = $project_data["latest"]["senderName"];
             $senderHtml = $project_data["latest"]["senderHtml"];
             $senderAvatar = $project_data["latest"]["senderAvatar"];
             $compare = null;
         } else {
             $path = $project_data["archive"][$version]["path"];
             $time = $project_data["archive"][$version]["time"];
             $senderName = $project_data["archive"][$version]["senderName"];
             $senderHtml = $project_data["archive"][$version]["senderHtml"];
             $senderAvatar = $project_data["archive"][$version]["senderAvatar"];
             $compare = null;
         }
     }
     $content = $parser->implodeChapters($path)->toHtml();
     $template->setContent($content);
     return $template->serialize();
 }