From b93d0259e4001bab646dd4449d308f9968cba55e Mon Sep 17 00:00:00 2001 From: Joey Kimsey Date: Thu, 5 Dec 2024 15:34:36 -0500 Subject: [PATCH] bugfixes, cleanup, usercp menu changes --- app/classes/plugin.php | 2 +- app/controllers/usercp.php | 3 ++- app/plugins/bugreport/models/bugreport.php | 1 - app/plugins/feedback/models/feedback.php | 1 - app/plugins/messages/plugin.php | 1 - .../notifications/models/notification.php | 1 - app/plugins/notifications/plugin.php | 1 - app/views/admin/groups/edit.html | 2 +- app/views/nav/usercp.html | 8 +++---- bin/tempus_project.php | 21 +++++++++++++++++++ 10 files changed, 28 insertions(+), 13 deletions(-) diff --git a/app/classes/plugin.php b/app/classes/plugin.php index 696dda3..8fed33e 100644 --- a/app/classes/plugin.php +++ b/app/classes/plugin.php @@ -309,7 +309,7 @@ class Plugin { $data = []; foreach( $this->resourceMatrix as $tableName => $entries ) { foreach ($ids as $id) { - $data[] = self::$db->delete( $tableName, $id ); + $data[] = self::$db->delete( $tableName, [ 'ID', '=', $id ] ); } } return $data; diff --git a/app/controllers/usercp.php b/app/controllers/usercp.php index bdeba21..3991aed 100644 --- a/app/controllers/usercp.php +++ b/app/controllers/usercp.php @@ -36,7 +36,8 @@ class Usercp extends Controller { Redirect::home(); } Template::noIndex(); - Navigation::activePageSelect( 'nav.usercp', null, true ); + $menu = Views::simpleView( 'nav.usercp', App::$userCPlinks ); + Navigation::activePageSelect( $menu, null, true, true ); } public function email() { diff --git a/app/plugins/bugreport/models/bugreport.php b/app/plugins/bugreport/models/bugreport.php index 5ae20ab..df23b78 100644 --- a/app/plugins/bugreport/models/bugreport.php +++ b/app/plugins/bugreport/models/bugreport.php @@ -13,7 +13,6 @@ namespace TheTempusProject\Models; use TheTempusProject\Bedrock\Functions\Check; -use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Classes\CustomException; use TheTempusProject\Classes\DatabaseModel; diff --git a/app/plugins/feedback/models/feedback.php b/app/plugins/feedback/models/feedback.php index 398c36b..b010ea2 100644 --- a/app/plugins/feedback/models/feedback.php +++ b/app/plugins/feedback/models/feedback.php @@ -14,7 +14,6 @@ */ namespace TheTempusProject\Models; -use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Classes\DatabaseModel; diff --git a/app/plugins/messages/plugin.php b/app/plugins/messages/plugin.php index 743890c..b26a8a8 100644 --- a/app/plugins/messages/plugin.php +++ b/app/plugins/messages/plugin.php @@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views; class Messages extends Plugin { public $pluginName = 'TP Messages'; - public $configName = 'messages'; public $pluginAuthor = 'JoeyK'; public $pluginWebsite = 'https://TheTempusProject.com'; public $modelVersion = '1.0'; diff --git a/app/plugins/notifications/models/notification.php b/app/plugins/notifications/models/notification.php index 4313b79..637dd54 100644 --- a/app/plugins/notifications/models/notification.php +++ b/app/plugins/notifications/models/notification.php @@ -12,7 +12,6 @@ */ namespace TheTempusProject\Models; -use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Classes\DatabaseModel; diff --git a/app/plugins/notifications/plugin.php b/app/plugins/notifications/plugin.php index 700e6e7..4f6152c 100644 --- a/app/plugins/notifications/plugin.php +++ b/app/plugins/notifications/plugin.php @@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views; class Notifications extends Plugin { public $pluginName = 'TP Notifications'; - public $configName = 'notifications'; public $pluginAuthor = 'JoeyK'; public $pluginWebsite = 'https://TheTempusProject.com'; public $modelVersion = '1.0'; diff --git a/app/views/admin/groups/edit.html b/app/views/admin/groups/edit.html index a8624e9..18a123c 100644 --- a/app/views/admin/groups/edit.html +++ b/app/views/admin/groups/edit.html @@ -7,6 +7,6 @@ {PERMISSIONS_FORM} - + \ No newline at end of file diff --git a/app/views/nav/usercp.html b/app/views/nav/usercp.html index b95299f..4c9f21b 100644 --- a/app/views/nav/usercp.html +++ b/app/views/nav/usercp.html @@ -1,7 +1,5 @@ \ No newline at end of file diff --git a/bin/tempus_project.php b/bin/tempus_project.php index 922496e..a713ef7 100644 --- a/bin/tempus_project.php +++ b/bin/tempus_project.php @@ -316,6 +316,8 @@ class TheTempusProject extends Bedrock { ] ]; + public static $userCPlinks = []; + /** * The constructor takes care of everything that we will need before * finally calling appload to instantiate the appropriate controller/method. @@ -362,6 +364,24 @@ class TheTempusProject extends Bedrock { } } + // load the damn usercp menu n a retarded fashion + self::$userCPlinks[] = (object) [ + "url" => "{ROOT_URL}usercp", + "name" => "Profile" + ]; + self::$userCPlinks[] = (object) [ + "url" => "{ROOT_URL}usercp/settings", + "name" => "Settings" + ]; + self::$userCPlinks[] = (object) [ + "url" => "{ROOT_URL}usercp/email", + "name" => "Change Email" + ]; + self::$userCPlinks[] = (object) [ + "url" => "{ROOT_URL}usercp/password", + "name" => "Change Password" + ]; + Debug::gend(); } @@ -546,6 +566,7 @@ class TheTempusProject extends Bedrock { } return null; } + /** * Echos useful information about the installation. *