VENOM-10: added files x.tpl, x.php Modules

This commit is contained in:
engineerTrooper 2020-12-03 17:58:36 +01:00
commit f9dd03193e
33 changed files with 975 additions and 35 deletions

5
.gitignore vendored
View file

@ -466,3 +466,8 @@ conf/modules.inc.php
conf/routers.inc.php
conf/lang.inc.php
logs/Exception.log
z_dome/
composer.lock
adminer.php

View file

@ -5,7 +5,13 @@
"authors": [
{
"name": "Maurice Grönwoldt",
"email": "mauricegroenwoldt@gmail.com"
"email": "mauricegroenwoldt@gmail.com",
"description": "founder"
},
{
"name": "Dominic Seela",
"email": "kontakt@engineertrooper.com",
"description": "friendly developer, supporter"
}
],
"require": {

View file

@ -1 +1 @@
main{display:flex;height:100vh;overflow:hidden}.menu{width:220px;background-color:#1b1b1b;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);flex-shrink:0;display:flex;flex-direction:column}.menu .logo{text-align:center;font-family:monospace}.menu div[data-link]{padding:.75rem .5rem;position:relative}.menu div[data-link]:after{background-color:#3949ab;content:"";position:absolute;left:0;bottom:0;height:3px;width:100%;transform:scaleX(0);transition:transform .4s;transform-origin:left}.menu div[data-link]:hover:after{transform:scaleX(1)}.menu div[data-link]:last-child{margin-top:auto}.menu div[data-link].active{font-weight:700}.content-area{padding:0 1%;margin:1rem 1.5rem;flex-grow:1;overflow-y:auto;width:100%;max-height:100%;background:rgba(27,27,27,.5)}.content-area .inline{display:inline}.content-area .inline div{display:inline}.content-area .btn-line{margin-top:35px}.content-area .btn-line div{text-align:right}.content-area .btn-line div button{display:inline;margin-left:10px;min-width:100px}.content-area textarea{background:rgba(27,27,27,.5);color:#fff;margin:15px 0 0 0;font-family:sans-serif;font-size:1.1rem;min-width:100%}.content-area .modules div{padding:6px 20px 6px 0}.content-area .fix-pad{padding-top:14px}
main{display:flex;height:100vh;overflow:hidden}.menu{width:220px;background-color:#1b1b1b;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);flex-shrink:0;display:flex;flex-direction:column}.menu .logo{text-align:center;font-family:monospace}.menu div[data-link]{padding:.75rem .5rem;position:relative}.menu div[data-link]:after{background-color:#3949ab;content:"";position:absolute;left:0;bottom:0;height:3px;width:100%;transform:scaleX(0);transition:transform .4s;transform-origin:left}.menu div[data-link]:hover:after{transform:scaleX(1)}.menu div[data-link]:last-child{margin-top:auto}.menu div[data-link].active{font-weight:700}.content-area{padding:0 1%;margin:1rem 1.5rem;flex-grow:1;overflow-y:auto;width:100%;max-height:100%;background:rgba(27,27,27,.5)}.content-area header{display:block;text-align:center}.content-area .back-arrow{width:36px;height:36px}.content-area .block{display:block}.content-area .flexbox{display:flex;flex-wrap:wrap}.content-area .flexbox div{width:50%}.content-area .inline{display:inline}.content-area .inline div{display:inline}.content-area .btn-line{margin-top:35px}.content-area .btn-line div{text-align:right}.content-area .btn-line div button{display:inline;margin-left:10px;min-width:100px}.content-area .role-edit .block{margin:40px 0}.content-area .role-edit .role-switches h4{padding:0 5px}.content-area .role-edit .role-switches div v-switch{padding:10px 5px;border-bottom:#5d5d5d 1px solid}.content-area .role-edit .role-switches .modules div{padding:14px 5px 8px 5px}.content-area textarea{background:rgba(27,27,27,.5);color:#fff;margin:15px 0 0 0;font-family:sans-serif;font-size:1.1rem;min-width:100%}.content-area .modules div{padding:6px 20px 6px 0}.content-area .fix-pad{padding-top:14px}

File diff suppressed because one or more lines are too long

View file

@ -23,6 +23,66 @@ class Component {
}
}
}
class MetaDataComponent extends Component {
constructor() {
super("/metaData");
this.tpl = "metaDataList";
this.tpl2 = "metaDataEdit";
this._url = "/admin/api/metaData";
}
async handle(data, ds) {
let meTpl = ds.id ? this.tpl2 : this.tpl;
await tpl.loadTemplate(meTpl);
return await tpl.renderOn(meTpl, data.content);
}
getUrl(ds) {
let url = this._url;
if (ds.id) {
url += '/' + ds.id;
}
return url;
}
}
class OverviewComponent extends Component {
constructor() {
super("/overview");
this.tpl = "overview";
this._url = "/admin/api/overview";
}
async handle(data, ds) {
await tpl.loadTemplate(this.tpl);
return await tpl.renderOn(this.tpl, data.content);
}
getUrl(ds) {
return this._url;
}
}
class PagesComponent extends Component {
constructor() {
super("/pages");
this.tpl = "pagesList";
this.tpl2 = "pageEdit";
this._url = "/admin/api/pages";
}
async handle(data, ds) {
let meTpl = ds.id ? this.tpl2 : this.tpl;
await tpl.loadTemplate(meTpl);
return await tpl.renderOn(meTpl, data.content);
}
getUrl(ds) {
let url = this._url;
if (ds.id) {
url += '/' + ds.id;
}
return url;
}
}
class RolesComponent extends Component {
constructor() {
super("/roles");
@ -45,9 +105,76 @@ class RolesComponent extends Component {
return url;
}
}
class SeoUrlComponent extends Component {
constructor() {
super("/seoUrl");
this.tpl = "seoUrlList";
this.tpl2 = "seoUrlEdit";
this._url = "/admin/api/seoUrl";
}
async handle(data, ds) {
let meTpl = ds.id ? this.tpl2 : this.tpl;
await tpl.loadTemplate(meTpl);
return await tpl.renderOn(meTpl, data.content);
}
getUrl(ds) {
let url = this._url;
if (ds.id) {
url += '/' + ds.id;
}
return url;
}
}
class UsersComponent extends Component {
constructor() {
super("/users");
this.tpl = "usersList";
this.tpl2 = "userEdit";
this._url = "/admin/api/users";
}
async handle(data, ds) {
let meTpl = ds.id ? this.tpl2 : this.tpl;
await tpl.loadTemplate(meTpl);
return await tpl.renderOn(meTpl, data.content);
}
getUrl(ds) {
let url = this._url;
if (ds.id) {
url += '/' + ds.id;
}
return url;
}
}
class VenomStatusComponent extends Component {
constructor() {
super("/venomStatus");
this.tpl = "venomStatus";
this._url = "/admin/api/venomStatus";
}
async handle(data, ds) {
await tpl.loadTemplate(this.tpl);
return await tpl.renderOn(this.tpl, data.content);
}
getUrl(ds) {
return this._url;
}
}
(() => {
// init all Components ;)
new MetaDataComponent();
new OverviewComponent();
new PagesComponent();
new RolesComponent();
new SeoUrlComponent();
new UsersComponent();
new VenomStatusComponent();
if (routerIsReady) {
document.body.dispatchEvent(new CustomEvent('triggerRouter'));

View file

@ -1 +1 @@
class Component{constructor(t){this.name=t,this.start()}handle(t,e){}init(){}getUrl(t){return""}start(){window.routerIsReady?(router.addComponent(this.name||VUtils.tempId(),this),this.init()):window.addEventListener("routerReady",this.start.bind(this))}}class RolesComponent extends Component{constructor(){super("/roles"),this.tpl="rolesList",this.tpl2="roleEdit",this._url="/admin/api/roles"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}new RolesComponent,routerIsReady?document.body.dispatchEvent(new CustomEvent("triggerRouter")):document.addEventListener("routerReady",t=>{document.body.dispatchEvent(new CustomEvent("triggerRouter"))});
class Component{constructor(t){this.name=t,this.start()}handle(t,e){}init(){}getUrl(t){return""}start(){window.routerIsReady?(router.addComponent(this.name||VUtils.tempId(),this),this.init()):window.addEventListener("routerReady",this.start.bind(this))}}class MetaDataComponent extends Component{constructor(){super("/metaData"),this.tpl="metaDataList",this.tpl2="metaDataEdit",this._url="/admin/api/metaData"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}class OverviewComponent extends Component{constructor(){super("/overview"),this.tpl="overview",this._url="/admin/api/overview"}async handle(t,e){return await tpl.loadTemplate(this.tpl),await tpl.renderOn(this.tpl,t.content)}getUrl(t){return this._url}}class PagesComponent extends Component{constructor(){super("/pages"),this.tpl="pagesList",this.tpl2="pageEdit",this._url="/admin/api/pages"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}class RolesComponent extends Component{constructor(){super("/roles"),this.tpl="rolesList",this.tpl2="roleEdit",this._url="/admin/api/roles"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}class SeoUrlComponent extends Component{constructor(){super("/seoUrl"),this.tpl="seoUrlList",this.tpl2="seoUrlEdit",this._url="/admin/api/seoUrl"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}class UsersComponent extends Component{constructor(){super("/users"),this.tpl="usersList",this.tpl2="userEdit",this._url="/admin/api/users"}async handle(t,e){let n=e.id?this.tpl2:this.tpl;return await tpl.loadTemplate(n),await tpl.renderOn(n,t.content)}getUrl(t){let e=this._url;return t.id&&(e+="/"+t.id),e}}class VenomStatusComponent extends Component{constructor(){super("/venomStatus"),this.tpl="venomStatus",this._url="/admin/api/venomStatus"}async handle(t,e){return await tpl.loadTemplate(this.tpl),await tpl.renderOn(this.tpl,t.content)}getUrl(t){return this._url}}new MetaDataComponent,new OverviewComponent,new PagesComponent,new RolesComponent,new SeoUrlComponent,new UsersComponent,new VenomStatusComponent,routerIsReady?document.body.dispatchEvent(new CustomEvent("triggerRouter")):document.addEventListener("routerReady",t=>{document.body.dispatchEvent(new CustomEvent("triggerRouter"))});

View file

@ -476,7 +476,17 @@ class FormHandler {
}
}
class VSwitch extends HTMLElement {
constructor() {
super();
const id = this.dataset.id || VUtils.tempId();
$('input', this).id = id;
$('label', this).setAttribute('for', id);
}
}
customElements.define("v-input", VInput);
customElements.define("v-switch", VSwitch);
if ($('#login')) {
new FormHandler('form#login', 'body', () => {
@ -685,7 +695,8 @@ class FormHandler {
});
})
document.body.addEventListener('triggerRouter', e => {
this.handle(sessionStorage.getItem('url'));
let storage = sessionStorage.getItem('url') || JSON.stringify({data: {link: $('[data-link].active').dataset.link}});
this.handle(storage);
})
window.addEventListener('popstate', e => {
this.handle(e.state);
@ -1157,7 +1168,7 @@ class VTpeLTemplate {
parseContent(cache) {
if (cache) {
let storage = localStorage.getItem(this.name);
let storage = localStorage.getItem("vtepl-"+this.name);
if (storage) {
this.parser.parsed = JSON.parse(storage);
return;
@ -1165,7 +1176,7 @@ class VTpeLTemplate {
}
this.parser.tokenize();
if (cache) {
localStorage.setItem(this.name, JSON.stringify(this.parser.parsed));
localStorage.setItem("vtepl-"+this.name, JSON.stringify(this.parser.parsed));
}
}
}
@ -1181,5 +1192,6 @@ class VTpeLTemplate {
'includes/input',
'includes/select',
'includes/svg',
'includes/switch'
])
})();

File diff suppressed because one or more lines are too long

View file

@ -4,6 +4,7 @@
namespace Venom\Admin\Routes;
use Venom\Core\ArgumentHandler;
use Venom\Core\Config;
use Venom\Helper\TemplateUtil;
use Venom\Routing\Route;
@ -11,8 +12,10 @@ class TemplateLoader implements Route
{
public function handle(): bool
{
if (!Config::getInstance()->isDevMode()) {
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 60 * 30)));
header('Cache-Control: public');
}
$id = ArgumentHandler::get()->getItem('tpl', '..');
if (strpos($id, '..')) {
return false;

View file

@ -49,7 +49,7 @@ class DatabaseHandler
}
}
public function getOne(string $query, array $args): ?DatabaseObject
public function getOne(string $query, array $args = []): ?DatabaseObject
{
$data = $this->getAll($query, $args);
if (count($data) > 0) {
@ -58,7 +58,7 @@ class DatabaseHandler
return null;
}
public function getAll(string $query, array $args): array
public function getAll(string $query, array $args = []): array
{
$stmt = $this->db->prepare($query);
$stmt->setFetchMode(PDO::FETCH_CLASS, DatabaseObject::class);
@ -66,7 +66,7 @@ class DatabaseHandler
return $stmt->fetchAll();
}
public function execute(string $query, array $args): bool
public function execute(string $query, array $args = []): bool
{
$stmt = $this->db->prepare($query);
return $stmt->execute($args);

View file

@ -6,7 +6,7 @@ namespace Venom\Helper;
class AdminHelper
{
public static function getResponse($content, bool $shouldReload = false, string $component = '', $extra = false)
public static function sendResponse($content, string $component = '', bool $shouldReload = false, $extra = false)
{
$response = [
'content' => $content,

View file

@ -0,0 +1,78 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class MetaDataModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/metaData' => [
'cl' => MetaDataModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'metaData' => [
['id' => 1, 'name' => 'engineertrooper', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'versustunze', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -0,0 +1,81 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class OverviewModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/overview' => [
'cl' => OverviewModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'pages' => [
['id' => 1, 'name' => 'Flamingos going wild!', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'Turbinen sind geil.', 'icon' => 'vt-edit'],
['id' => 3, 'name' => 'Aufbau und Umbau des neuen VENOMs Plugins', 'icon' => 'vt-edit'],
['id' => 4, 'name' => 'Aber Mama hat gesagt!', 'icon' => 'vt-edit'],
['id' => 5, 'name' => 'Frische Fische nur heute!', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -0,0 +1,81 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class PageModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/pages' => [
'cl' => PageModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'pages' => [
['id' => 1, 'name' => 'Flamingos going wild!', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'Turbinen sind geil.', 'icon' => 'vt-edit'],
['id' => 3, 'name' => 'Aufbau und Umbau des neuen VENOMs Plugins', 'icon' => 'vt-edit'],
['id' => 4, 'name' => 'Aber Mama hat gesagt!', 'icon' => 'vt-edit'],
['id' => 5, 'name' => 'Frische Fische nur heute!', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -5,6 +5,7 @@ namespace Modules;
use Venom\Core\Config;
use Venom\Core\DatabaseHandler;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
@ -48,7 +49,8 @@ class RoleModule implements Module, Route
public function get()
{
AdminHelper::getResponse([
//$req = DatabaseHandler::get()->getAll("SELECT * FROM roles");
AdminHelper::sendResponse([
'roles' => [
['id' => 1, 'name' => 'Admin', 'icon' => 'vt-visibility'],
['id' => 2, 'name' => 'Moderator', 'icon' => 'vt-edit'],
@ -69,7 +71,7 @@ class RoleModule implements Module, Route
public function getById($id)
{
AdminHelper::getResponse([
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',

View file

@ -0,0 +1,81 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class SeoUrlModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/seoUrl' => [
'cl' => SeoUrlModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'pages' => [
['id' => 1, 'name' => 'Flamingos going wild!', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'Turbinen sind geil.', 'icon' => 'vt-edit'],
['id' => 3, 'name' => 'Aufbau und Umbau des neuen VENOMs Plugins', 'icon' => 'vt-edit'],
['id' => 4, 'name' => 'Aber Mama hat gesagt!', 'icon' => 'vt-edit'],
['id' => 5, 'name' => 'Frische Fische nur heute!', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -0,0 +1,78 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class UserModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/users' => [
'cl' => UserModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'users' => [
['id' => 1, 'name' => 'engineertrooper', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'versustunze', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -0,0 +1,78 @@
<?php
namespace Modules;
use Venom\Core\Config;
use Venom\Core\Module;
use Venom\Helper\AdminHelper;
use Venom\Routing\Route;
use Venom\Routing\Router;
use Venom\Venom;
class VenomStatusModule implements Module, Route
{
public function register(Venom $venom): bool
{
if (Config::getInstance()->isAdmin()) {
$this->registerAdminRoutes($venom);
}
return true;
}
public function init(): void
{
}
private function registerAdminRoutes(Venom $venom)
{
$venom->getRouter(Router::ADMIN_ROUTER)->addRoutes([
'/venomStatus' => [
'cl' => VenomStatusModule::class,
'roles' => ['ROLE_ADMIN'],
'routes' => [
'*' => [
"GET" => 'get',
],
'1' => [
"GET" => 'getById',
"POST" => 'update',
"PUT" => 'insert',
]
]
]
]);
}
public function get()
{
AdminHelper::sendResponse([
'users' => [
['id' => 1, 'name' => 'engineertrooper', 'icon' => 'vt-edit'],
['id' => 2, 'name' => 'versustunze', 'icon' => 'vt-edit']
]
]);
}
public function update(): bool
{
return false;
}
public function insert(): bool
{
return false;
}
public function getById($id)
{
AdminHelper::sendResponse([
'caseName' => 'ROLE_ADMIN',
'id' => $id,
'name' => 'Admin',
'icon' => 'vt-visibility',
]);
}
}

View file

@ -1,13 +1,13 @@
<main>
<nav class="menu">
<h1 class="logo">Venom</h1>
<div data-link="">Meta Data</div>
<div data-link="" class="active">Overview</div>
<div data-link="">Pages</div>
<div data-link="/metaData">Meta Data</div>
<div data-link="/overview" class="active">Overview</div>
<div data-link="/pages">Pages</div>
<div data-link="/roles">Roles</div>
<div data-link="">SEO-URL</div>
<div data-link="">Users</div>
<div data-link="">Venom-Status</div>
<div data-link="/seoUrl">SEO-URL</div>
<div data-link="/users">Users</div>
<div data-link="/venomStatus">Venom-Status</div>
<div data-link="/admin/api/login/logout">Ausloggen</div>
</nav>
<div class="content-area">

View file

@ -1,6 +1,7 @@
<?php
use Venom\Views\Asset;
use Venom\Core\Config;
?>
<!doctype html>
@ -14,7 +15,7 @@ use Venom\Views\Asset;
<?php Asset::get()->renderCSS(); ?>
<!--link rel="stylesheet" href="/theme/admin/css/admin-panel.css"-->
</head>
<body>
<body <?=Config::getInstance()->isDevMode() ? 'debug' : ''?>>
<?php
if (!$this->getVar('isLoggedIn')) {
$this->renderTemplate('login');

Some files were not shown because too many files have changed in this diff Show more