bugfixes, cleanup, usercp menu changes

This commit is contained in:
Joey Kimsey
2024-12-05 15:34:36 -05:00
parent bf7b7ba1c9
commit b93d0259e4
10 changed files with 28 additions and 13 deletions

View File

@ -309,7 +309,7 @@ class Plugin {
$data = []; $data = [];
foreach( $this->resourceMatrix as $tableName => $entries ) { foreach( $this->resourceMatrix as $tableName => $entries ) {
foreach ($ids as $id) { foreach ($ids as $id) {
$data[] = self::$db->delete( $tableName, $id ); $data[] = self::$db->delete( $tableName, [ 'ID', '=', $id ] );
} }
} }
return $data; return $data;

View File

@ -36,7 +36,8 @@ class Usercp extends Controller {
Redirect::home(); Redirect::home();
} }
Template::noIndex(); Template::noIndex();
Navigation::activePageSelect( 'nav.usercp', null, true ); $menu = Views::simpleView( 'nav.usercp', App::$userCPlinks );
Navigation::activePageSelect( $menu, null, true, true );
} }
public function email() { public function email() {

View File

@ -13,7 +13,6 @@
namespace TheTempusProject\Models; namespace TheTempusProject\Models;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Canary\Classes\CustomException; use TheTempusProject\Canary\Classes\CustomException;
use TheTempusProject\Classes\DatabaseModel; use TheTempusProject\Classes\DatabaseModel;

View File

@ -14,7 +14,6 @@
*/ */
namespace TheTempusProject\Models; namespace TheTempusProject\Models;
use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Classes\DatabaseModel; use TheTempusProject\Classes\DatabaseModel;

View File

@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views;
class Messages extends Plugin { class Messages extends Plugin {
public $pluginName = 'TP Messages'; public $pluginName = 'TP Messages';
public $configName = 'messages';
public $pluginAuthor = 'JoeyK'; public $pluginAuthor = 'JoeyK';
public $pluginWebsite = 'https://TheTempusProject.com'; public $pluginWebsite = 'https://TheTempusProject.com';
public $modelVersion = '1.0'; public $modelVersion = '1.0';

View File

@ -12,7 +12,6 @@
*/ */
namespace TheTempusProject\Models; namespace TheTempusProject\Models;
use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\Bedrock\Functions\Check; use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Classes\DatabaseModel; use TheTempusProject\Classes\DatabaseModel;

View File

@ -20,7 +20,6 @@ use TheTempusProject\Houdini\Classes\Views;
class Notifications extends Plugin { class Notifications extends Plugin {
public $pluginName = 'TP Notifications'; public $pluginName = 'TP Notifications';
public $configName = 'notifications';
public $pluginAuthor = 'JoeyK'; public $pluginAuthor = 'JoeyK';
public $pluginWebsite = 'https://TheTempusProject.com'; public $pluginWebsite = 'https://TheTempusProject.com';
public $modelVersion = '1.0'; public $modelVersion = '1.0';

View File

@ -7,6 +7,6 @@
</div> </div>
</div> </div>
{PERMISSIONS_FORM} {PERMISSIONS_FORM}
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Edit</button> <button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Save</button>
<input type="hidden" name="token" value="{TOKEN}"> <input type="hidden" name="token" value="{TOKEN}">
</form> </form>

View File

@ -1,7 +1,5 @@
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
<li><a href="{ROOT_URL}usercp">Profile</a></li> {LOOP}
<li><a href="{ROOT_URL}usercp/settings">Settings</a></li> <li><a href="{url}">{name}</a></li>
<li><a href="{ROOT_URL}usercp/email">Change Email</a></li> {/LOOP}
<li><a href="{ROOT_URL}usercp/password">Change Password</a></li>
<li><a href="{ROOT_URL}messages">Messages</a></li>
</ul> </ul>

View File

@ -316,6 +316,8 @@ class TheTempusProject extends Bedrock {
] ]
]; ];
public static $userCPlinks = [];
/** /**
* The constructor takes care of everything that we will need before * The constructor takes care of everything that we will need before
* finally calling appload to instantiate the appropriate controller/method. * 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(); Debug::gend();
} }
@ -546,6 +566,7 @@ class TheTempusProject extends Bedrock {
} }
return null; return null;
} }
/** /**
* Echos useful information about the installation. * Echos useful information about the installation.
* *