Partial bootstrap 4.5 support
This commit is contained in:
@@ -1,22 +1,29 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
use Template\RenderableTemplate as RenderableTemplate;
|
||||
|
||||
class Dashboard extends RenderableTemplate {
|
||||
|
||||
|
||||
public $content;
|
||||
|
||||
|
||||
public function render() {
|
||||
global $DROPDOWN, $SIDEBAR;
|
||||
|
||||
if (is_ajax_request()) {
|
||||
$this->content = file_get_contents($this->getView()['location']);
|
||||
$this->implate();
|
||||
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;
|
||||
|
||||
//global $DROPDOWN, $SIDEBAR;
|
||||
|
||||
$head = '';
|
||||
|
||||
|
||||
$head .= '<script src="/plugins/jquery/jquery.min.js"></script>';
|
||||
|
||||
$head .= '<script src="/plugins/mousetrap/mousetrap.min.js"></script>';
|
||||
@@ -24,7 +31,7 @@ class Dashboard extends RenderableTemplate {
|
||||
$head .= '<script src="/plugins/jquery-mask-plugin/jquery.mask.min.js"></script>';
|
||||
|
||||
$head .= '<link href="/plugins/bootstrap/bootstrap.min.css" rel="stylesheet" />';
|
||||
$head .= '<script src="/plugins/bootstrap/bootstrap.min.js"></script>';
|
||||
$head .= '<script src="/plugins/bootstrap/bootstrap.bundle.min.js"></script>';
|
||||
|
||||
$head .= '<link href="/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />';
|
||||
|
||||
@@ -36,35 +43,37 @@ class Dashboard extends RenderableTemplate {
|
||||
$head .= '<link href="/plugins/metisMenu/metisMenu.min.css" rel="stylesheet">';
|
||||
$head .= '<script src="/plugins/metisMenu/metisMenu.min.js"></script>';
|
||||
|
||||
$head .= '<link href="/plugins/select2/select2.min.css" rel="stylesheet">';
|
||||
$head .= '<script src="/plugins/select2/select2.min.js"></script>';
|
||||
|
||||
$head .= '<link rel="stylesheet" href="/plugins/datatables/dataTables.css">';
|
||||
$head .= '<script src="/plugins/datatables/dataTables.js"></script>';
|
||||
|
||||
$head .= '<link rel="stylesheet" href="/plugins/trumbowyg/ui/trumbowyg.min.css">';
|
||||
$head .= '<script src="/plugins/trumbowyg/trumbowyg.min.js"></script>';
|
||||
|
||||
$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("{{dropdown}}", $header, $this->content);
|
||||
|
||||
$this->content = str_replace("{{head}}", $head, $this->content);
|
||||
|
||||
if(is_file($this->getView()['location'])){
|
||||
|
||||
if(isset($this->getView()['location']) && 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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,17 +9,18 @@
|
||||
<div id="wrapper">
|
||||
<!-- Sidebar -->
|
||||
<nav id="sidebar-wrapper">
|
||||
<button class="form-control btn-danger menu-toggle menu-small">Fechar</button>
|
||||
<div class="logo" style="">
|
||||
<img src='/media/logo_white.png' alt="logo" />
|
||||
</div>
|
||||
|
||||
<div class="search-nav" style="">
|
||||
<input class="form-control" type="text" placeholder="Busca"/>
|
||||
</div>
|
||||
|
||||
{{elements}}
|
||||
|
||||
<ul id="side-second-menu" class="hidden nav">
|
||||
</ul>
|
||||
<ul id="side-second-menu" class="hidden nav"></ul>
|
||||
</nav>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
<!-- /#sidebar-wrapper -->
|
||||
@@ -31,24 +32,19 @@
|
||||
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
<li class="tooltip-sidebar-toggle">
|
||||
<a href="" id="menu-toggle">
|
||||
<a href="" class="menu-toggle">
|
||||
<i class="fa fa-th-list" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="nav navbar-top-links navbar-right">
|
||||
<!--{{usermenu}}-->
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-user fa-fw"></i>
|
||||
<i class="fa fa-cog fa-fw"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" >
|
||||
<a class="dropdown-item" href="#">Profile</a>
|
||||
<a class="dropdown-item" href="#"><i class=""></i>Settings</a>
|
||||
<a class="dropdown-item" href="#"><i class=""></i>Activity Log</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" ><i class=""></i>Logout</a>
|
||||
{{dropdown}}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user