Reestruturacao da pasta app e mudancas nos templates
This commit is contained in:
+71
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
use Template\RenderableTemplate as RenderableTemplate;
|
||||
|
||||
class Dashboard extends RenderableTemplate {
|
||||
|
||||
public $content;
|
||||
|
||||
public function render() {
|
||||
if (is_ajax_request()) {
|
||||
$this->content = file_get_contents($this->getView()['location']);
|
||||
$this->implate();
|
||||
return;
|
||||
}
|
||||
|
||||
global $DROPDOWN, $SIDEBAR;
|
||||
|
||||
$head = '';
|
||||
$head .= '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
|
||||
$head .= '<script src="/plugins/jquery/jquery.min.js"></script>';
|
||||
|
||||
$head .= '<script src="/plugins/mousetrap/mousetrap.min.js"></script>';
|
||||
|
||||
$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 .= '<link href="/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />';
|
||||
|
||||
$head .= '<link href="/plugins/normalize-css/normalize.css" rel="stylesheet">';
|
||||
$head .= '<link href="/dist/style.css" rel="stylesheet">';
|
||||
|
||||
$head .= '<link href="/dist/theme/black_and_white.css" rel="stylesheet">';
|
||||
|
||||
$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>';
|
||||
$foot .= '<script src="/dist/exercicio_form.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);
|
||||
|
||||
$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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<html>
|
||||
<head>
|
||||
{{head}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<!-- Sidebar -->
|
||||
<!-- Sidebar -->
|
||||
<nav id="sidebar-wrapper">
|
||||
<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> -->
|
||||
|
||||
<hr />
|
||||
|
||||
{{elements}}
|
||||
<ul id="side-second-menu" class="hidden nav">
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /#sidebar-wrapper -->
|
||||
<!-- /#sidebar-wrapper -->
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="main-page-wrapper">
|
||||
|
||||
<header style='min-height: 50px; background-color: #000;'>
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
<li class="tooltip-sidebar-toggle">
|
||||
<a href="" id="menu-toggle">
|
||||
<i class="fa fa-th-list" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <ul id='menu-usuario' class="nav navbar-nav navbar-right nav-dropdown">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" data-method="reload">
|
||||
<i class="fa fa-user" aria-hidden="true"></i> <span class="caret"></span>
|
||||
</a>
|
||||
{{usermenu}}
|
||||
</li>
|
||||
</ul> -->
|
||||
</header>
|
||||
|
||||
<div id="progress" class="progress hidden" >
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated active" style="width: 100%;"></div>
|
||||
</div>
|
||||
<!-- BreadCrumbs -->
|
||||
|
||||
<!-- /BreadCrumbs -->
|
||||
|
||||
<div id="page-content-wrapper">
|
||||
<div class="container-fluid" style="height: 1024px;">
|
||||
|
||||
<div class="row">
|
||||
<div id="content" class="col-lg-12">
|
||||
{{>content}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /#page-content-wrapper -->
|
||||
</div>
|
||||
<div id="modal" class="modal fade" role="dialog"> </div>
|
||||
{{footer}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Template\RenderableTemplate as RenderableTemplate;
|
||||
|
||||
class DefaultTemplate extends RenderableTemplate {
|
||||
|
||||
public function __construct() {
|
||||
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$this->content = file_get_contents(__DIR__ . '/template.html');
|
||||
|
||||
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->implate();
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{>content}}
|
||||
</body>
|
||||
</html>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Template\RenderableTemplate as RenderableTemplate;
|
||||
|
||||
class NullTemplate extends RenderableTemplate {
|
||||
|
||||
public function __construct() {
|
||||
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
if (is_file($this->getView()['location'])) {
|
||||
$this->content = file_get_contents($this->getView()['location']);
|
||||
$this->implate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user