| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- use Template\RenderableTemplate as RenderableTemplate;
- class Dashboard extends RenderableTemplate {
-
- public $content;
-
- public function render() {
- global $DROPDOWN, $SIDEBAR;
- if (is_ajax_request()) {
- if(is_file($this->getView()['location'])){
- $this->content = file_get_contents($this->getView()['location']);
- $this->implate();
- }else{
- $this->content = '';
- $this->implate();
- }
- return;
- }
- //global $DROPDOWN, $SIDEBAR;
-
- $head = '';
-
- $head .= '<script src="/plugins/jquery/dist/jquery.min.js"></script>';
- $head .= '<script src="/plugins/mousetrap/mousetrap.min.js"></script>';
- $head .= '<script src="/plugins/jquery-mask-plugin/dist/jquery.mask.min.js"></script>';
- $head .= '<link href="/plugins/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />';
- $head .= '<script src="/plugins/bootstrap/dist/js/bootstrap.min.js"></script>';
- $head .= '<link href="/plugins/fontawesome/css/all.css" rel="stylesheet" />';
-
- $head .= '<link href="/dist/style.css" rel="stylesheet">';
- $head .= '<link href="/dist/themes/black_and_white.css" rel="stylesheet">';
- $head .= '<link href="/plugins/metismenu/dist/metisMenu.min.css" rel="stylesheet">';
- $head .= '<script src="/plugins/metismenu/dist/metisMenu.min.js"></script>';
- //$head .= '<link rel="stylesheet" href="/plugins/datatables/dataTables.css">';
- //$head .= '<script src="/plugins/datatables/dataTables.js"></script>';
-
- //Bind input ranges to a span on label. Show percentage.
- $head .= '<script src="/plugins/sliderTelepatic/dist/sliderTelepatic.min.js"></script>';
-
- $head .= '<script src="/plugins/trumbowyg/dist/trumbowyg.min.js"></script>';
- $head .= '<link rel="stylesheet" href="/plugins/trumbowyg/dist/ui/trumbowyg.min.css">';
-
- $foot = '';
- $foot .= '<script src="/dist/script.js"></script>';
-
- $this->content = file_get_contents(__DIR__ . '/template.html');
- $this->content = str_replace("{{usermenu}}", "", $this->content);
- $this->content = str_replace("{{elements}}", $SIDEBAR->render(), $this->content);
-
- $header = '';
-
- //HACK
- foreach ($DROPDOWN as $item){
- $header .= "<a class='dropdown-item' href='".$item['route']."'>".$item['name']."</a>";
- }
-
- $this->content = str_replace("{{projects}}", $header, $this->content);
- $this->content = str_replace("{{head}}", $head, $this->content);
-
- if(is_file($this->getView()['location'])){
- $this->content = str_replace('{{>content}}', $this->replaceSections(file_get_contents($this->getView()['location']), $this->_view['values']), $this->content);
- }else{
- $this->content = str_replace('{{>content}}', '', $this->content);
- }
-
- $this->content = str_replace("{{footer}}", $foot, $this->content);
-
- $this->implate();
-
- }
- }
|