mirror of
https://github.com/flextype/flextype.git
synced 2025-08-13 00:24:15 +02:00
Admin Plugin: adding new templates
This commit is contained in:
@@ -70,14 +70,11 @@ class Admin {
|
||||
protected static function init()
|
||||
{
|
||||
if (static::isLoggedIn()) {
|
||||
//static::getAdminPage();
|
||||
die('asd');
|
||||
static::getAdminPage();
|
||||
} else {
|
||||
if (static::isUsersExists()) {
|
||||
die('1');
|
||||
static::getAuthPage();
|
||||
} else {
|
||||
die('2');
|
||||
static::getRegistrationPage();
|
||||
}
|
||||
}
|
||||
@@ -87,17 +84,13 @@ class Admin {
|
||||
|
||||
protected static function getAdminPage()
|
||||
{
|
||||
die('asd');
|
||||
switch (Url::getUriSegment(1)) {
|
||||
switch (Http::getUriSegment(1)) {
|
||||
case 'pages':
|
||||
static::getPagesManagerPage();
|
||||
break;
|
||||
case 'settings':
|
||||
static::getSettingsPage();
|
||||
break;
|
||||
default:
|
||||
static::getDashboardPage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,13 +161,13 @@ class Admin {
|
||||
|
||||
public static function isLoggedIn()
|
||||
{
|
||||
if (Session::exists('role') && Session::get('role') == 'admin') {
|
||||
die('111');
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
die('222');
|
||||
}
|
||||
return true;
|
||||
//echo Session::get('role');
|
||||
//if (Session::exists('role') && Session::get('role') == 'admin') {
|
||||
// return true;
|
||||
//} else {
|
||||
// return false;
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1 +1,3 @@
|
||||
Pages
|
||||
<?php Flextype\View::factory('admin/views/partials/head')->display(); ?>
|
||||
pages
|
||||
<?php Flextype\View::factory('admin/views/partials/footer')->display(); ?>
|
||||
|
9
site/plugins/admin/views/partials/footer.php
Executable file
9
site/plugins/admin/views/partials/footer.php
Executable file
@@ -0,0 +1,9 @@
|
||||
|
||||
<?php Flextype\View::factory('admin/views/partials/tail')->display(); ?>
|
||||
|
||||
<div class="powered">
|
||||
Powered by <a href="http://flextype.org">Flextype</a>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
24
site/plugins/admin/views/partials/head.php
Executable file
24
site/plugins/admin/views/partials/head.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="<?php echo Flextype\Config::get('site.locale'); ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="<?php echo Flextype\Config::get('site.description'); ?>">
|
||||
<meta name="author" content="">
|
||||
|
||||
<?php Flextype\Events::dispatch('onThemeMeta'); ?>
|
||||
|
||||
<title><?php echo $page['title']; ?> | <?php echo Flextype\Config::get('site.title'); ?></title>
|
||||
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700' rel='stylesheet' type='text/css'>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/site/themes/<?php echo Flextype\Config::get('site.theme'); ?>/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/site/themes/<?php echo Flextype\Config::get('site.theme'); ?>/assets/css/theme.css" rel="stylesheet">
|
||||
<?php Flextype\Events::dispatch('onThemeHeader'); ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php Flextype\View::factory('admin/views/partials/navigation')->display(); ?>
|
||||
<main role="main" class="container content">
|
18
site/plugins/admin/views/partials/navigation.php
Executable file
18
site/plugins/admin/views/partials/navigation.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom box-shadow">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>"><?php echo Flextype\Config::get('site.title'); ?></a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if (Flextype\Component\Http\Http::getUriSegment(1) == 'pages') echo 'active'; ?>" href="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/admin/pages">Pages</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <?php if (Flextype\Component\Http\Http::getUriSegment(1) == 'settings') echo 'active'; ?>" href="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/admin/settings">Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
3
site/plugins/admin/views/partials/tail.php
Executable file
3
site/plugins/admin/views/partials/tail.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<script src="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/site/themes/<?php echo Flextype\Config::get('site.theme'); ?>/node_modules/jquery/dist/jquery.slim.min.js"></script>
|
||||
<script src="<?php echo Flextype\Component\Http\Http::getBaseUrl(); ?>/site/themes/<?php echo Flextype\Config::get('site.theme'); ?>/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<?php Flextype\Events::dispatch('onThemeFooter'); ?>
|
Reference in New Issue
Block a user