diff --git a/app/controllers/admin/groups.php b/app/controllers/admin/groups.php
index 44e8ccc..b6ed9d9 100644
--- a/app/controllers/admin/groups.php
+++ b/app/controllers/admin/groups.php
@@ -32,8 +32,6 @@ class Groups extends AdminController {
self::$title = 'Admin - Groups';
self::$group = new Group;
self::$permissions = new Permissions;
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/groups' );
- Components::set( 'ADMINNAV', $view );
}
public function create( $data = null ) {
diff --git a/app/controllers/admin/images.php b/app/controllers/admin/images.php
new file mode 100644
index 0000000..0499c41
--- /dev/null
+++ b/app/controllers/admin/images.php
@@ -0,0 +1,114 @@
+
+ * @link https://TheTempusProject.com
+ * @license https://opensource.org/licenses/MIT [MIT LICENSE]
+ */
+namespace TheTempusProject\Controllers\Admin;
+
+use TheTempusProject\Classes\Forms as TTPForms;
+use TheTempusProject\Houdini\Classes\Views;
+use TheTempusProject\Houdini\Classes\Issues;
+use TheTempusProject\Houdini\Classes\Navigation;
+use TheTempusProject\Houdini\Classes\Components;
+use TheTempusProject\Houdini\Classes\Forms;
+use TheTempusProject\Classes\AdminController;
+use TheTempusProject\Models\Token;
+use TheTempusProject\Bedrock\Functions\Input;
+use TheTempusProject\Bedrock\Functions\Check;
+use TheTempusProject\Hermes\Functions\Redirect;
+use TheTempusProject\Bedrock\Functions\Session;
+
+class Images extends AdminController {
+
+ public function __construct() {
+ parent::__construct();
+ self::$title = 'Admin - Images';
+ }
+
+ public function create() {
+ if ( Input::exists( 'submit' ) ) {
+ if ( !TTPForms::check( 'addImage' ) ) {
+ Issues::add( 'error', [ 'There was an error with your image.' => Check::userErrors() ] );
+ }
+
+ if ( Input::exists( 'folder' ) ) {
+ $folder = Input::post('folder');
+ } else {
+ // IMAGE_DIRECTORY
+ $folder = UPLOAD_DIRECTORY . App::$activeUser->username . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
+ }
+
+ $upload = Upload::image( 'upload', $folder );
+
+ if ( $upload ) {
+ $route = str_replace( APP_ROOT_DIRECTORY, '', $folder );
+ $out = $route . Upload::last();
+ } else {
+ Debug::error( 'There was an error with your upload.');
+ Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] );
+ }
+
+
+
+
+
+
+
+
+
+ // if ( self::$token->create(
+ // Input::post( 'name' ),
+ // Input::post( 'notes' ),
+ // Input::post( 'token_type' )
+ // ) ) {
+ // Session::flash( 'success', 'Token Created' );
+ // Redirect::to( 'admin/images' );
+ // }
+
+
+ }
+ Views::view( 'admin.images.create' );
+ }
+
+ public function delete( $id = null ) {
+ if ( self::$token->delete( [ $id ] ) ) {
+ Session::flash( 'success', 'Token deleted.' );
+ }
+ Redirect::to( 'admin/images' );
+ }
+
+ public function edit( $id = null ) {
+ $token = self::$token->findById( $id );
+ if ( Input::exists( 'submit' ) ) {
+ if ( !TTPForms::check( 'adminEditToken' ) ) {
+ Issues::add( 'error', [ 'There was an error with your token.' => Check::userErrors() ] );
+ } else {
+ if ( self::$token->update(
+ $id,
+ Input::post( 'name' ),
+ Input::post( 'notes' ),
+ Input::post( 'token_type' )
+ ) ) {
+ Session::flash( 'success', 'Token Updated' );
+ Redirect::to( 'admin/images' );
+ }
+ }
+ }
+ Forms::selectOption( $token->token_type );
+ return Views::view( 'admin.images.edit', $token );
+ }
+
+ public function index() {
+ return Views::view( 'admin.images.list', self::$token->listPaginated() );
+ }
+
+ public function view( $id = null ) {
+ return Views::view( 'admin.images.view', self::$token->findById( $id ) );
+ }
+}
diff --git a/app/controllers/admin/plugins.php b/app/controllers/admin/plugins.php
index ea152e8..34ae918 100644
--- a/app/controllers/admin/plugins.php
+++ b/app/controllers/admin/plugins.php
@@ -30,8 +30,6 @@ class Plugins extends AdminController {
self::$title = 'Admin - Installed Plugins';
$this->installer = new Installer;
$this->plugins = $this->installer->getAvailablePlugins();
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/plugins' );
- Components::set( 'ADMINNAV', $view );
}
public function index() {
diff --git a/app/controllers/admin/routes.php b/app/controllers/admin/routes.php
index 1f8b84c..116394b 100644
--- a/app/controllers/admin/routes.php
+++ b/app/controllers/admin/routes.php
@@ -31,8 +31,6 @@ class Routes extends AdminController {
parent::__construct();
self::$title = 'Admin - Redirects';
self::$routes = new RoutesClass;
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/routes' );
- Components::set( 'ADMINNAV', $view );
}
public function create() {
diff --git a/app/controllers/admin/tokens.php b/app/controllers/admin/tokens.php
index 5655b22..a60aa75 100644
--- a/app/controllers/admin/tokens.php
+++ b/app/controllers/admin/tokens.php
@@ -31,8 +31,6 @@ class Tokens extends AdminController {
parent::__construct();
self::$title = 'Admin - Tokens';
self::$token = new Token;
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/tokens' );
- Components::set( 'ADMINNAV', $view );
}
public function create() {
diff --git a/app/controllers/admin/users.php b/app/controllers/admin/users.php
index 0cff516..d97aa97 100644
--- a/app/controllers/admin/users.php
+++ b/app/controllers/admin/users.php
@@ -37,8 +37,6 @@ class Users extends AdminController {
self::$title = 'Admin - Users';
self::$user = new User;
self::$group = new Group;
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/users' );
- Components::set( 'ADMINNAV', $view );
}
public function create() {
diff --git a/app/js/main.js b/app/js/main.js
index 805f466..461b5fe 100644
--- a/app/js/main.js
+++ b/app/js/main.js
@@ -125,7 +125,7 @@ document.addEventListener('DOMContentLoaded', function () {
if ( toggleButton ) {
toggleButton.checked = true;
}
-
+
if ( enableButton ) {
enableButton.innerText = 'Disable Now';
}
@@ -158,21 +158,21 @@ document.addEventListener('DOMContentLoaded', function () {
toggleButton.addEventListener('click', function () {
if (darkModeStylesheet.disabled) {
toggleDarkModePref( true );
- darkModeStylesheet.disabled = false;
- localStorage.setItem('darkMode', 'enabled');
- } else {
- toggleDarkModePref( false );
- darkModeStylesheet.disabled = true;
- localStorage.setItem('darkMode', 'disabled');
- }
-
- document.querySelectorAll('.table-striped').forEach((table) => {
- if (localStorage.getItem('darkMode') === 'enabled') {
- table.classList.add('table-dark');
- table.classList.remove('table-light');
+ darkModeStylesheet.disabled = false;
+ localStorage.setItem('darkMode', 'enabled');
} else {
- table.classList.add('table-light');
- table.classList.remove('table-dark');
+ toggleDarkModePref( false );
+ darkModeStylesheet.disabled = true;
+ localStorage.setItem('darkMode', 'disabled');
+ }
+
+ document.querySelectorAll('.table-striped').forEach((table) => {
+ if (localStorage.getItem('darkMode') === 'enabled') {
+ table.classList.add('table-dark');
+ table.classList.remove('table-light');
+ } else {
+ table.classList.add('table-light');
+ table.classList.remove('table-dark');
}
});
});
diff --git a/app/plugins/blog/controllers/admin/blog.php b/app/plugins/blog/controllers/admin/blog.php
index 36b9097..b97e319 100644
--- a/app/plugins/blog/controllers/admin/blog.php
+++ b/app/plugins/blog/controllers/admin/blog.php
@@ -29,8 +29,6 @@ class Blog extends AdminController {
parent::__construct();
self::$posts = new Posts;
self::$title = 'Admin - Blog';
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/blog' );
- Components::set( 'ADMINNAV', $view );
}
public function index( $data = null ) {
diff --git a/app/plugins/contact/controllers/admin/contact.php b/app/plugins/contact/controllers/admin/contact.php
index 1a1aa4a..be6fd11 100644
--- a/app/plugins/contact/controllers/admin/contact.php
+++ b/app/plugins/contact/controllers/admin/contact.php
@@ -27,8 +27,6 @@ class Contact extends AdminController {
parent::__construct();
self::$title = 'Admin - Contact';
self::$contact = new ContactModel;
- $view = Navigation::activePageSelect( 'nav.admin', '/admin/contact' );
- Components::set( 'ADMINNAV', $view );
}
public function view( $id = null ) {
diff --git a/bin/tempus_project.php b/bin/tempus_project.php
index ef2a22f..697ee5d 100644
--- a/bin/tempus_project.php
+++ b/bin/tempus_project.php
@@ -100,6 +100,10 @@ class TheTempusProject extends Bedrock {
'text' => ' Tokens',
'url' => '{ROOT_URL}admin/tokens',
],
+ [
+ 'text' => ' Images',
+ 'url' => '{ROOT_URL}admin/images',
+ ],
[
'text' => ' Modules',
'url' => [