Bugfixes and Bootstrap 5 finalized
This commit is contained in:
@ -15,8 +15,11 @@ use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Classes\AdminController;
|
||||
use TheTempusProject\Models\User;
|
||||
use TheTempusProject\Plugins\Comments;
|
||||
use TheTempusProject\Plugins\Blog;
|
||||
use TheTempusProject\Models\Comments;
|
||||
use TheTempusProject\Models\Posts;
|
||||
use TheTempusProject\Plugins\Comments as CommentPlugin;
|
||||
use TheTempusProject\Plugins\Blog as BlogPlugin;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
|
||||
class Home extends AdminController {
|
||||
public static $user;
|
||||
@ -30,17 +33,29 @@ class Home extends AdminController {
|
||||
|
||||
public function index() {
|
||||
if ( class_exists( 'TheTempusProject\Plugins\Comments' ) ) {
|
||||
$comments = new Comments;
|
||||
self::$comments = $comments->getModel();
|
||||
$comments = Views::simpleView( 'comments.admin.dashboard', self::$comments->recent( 'all', 5 ) );
|
||||
Components::set( 'commentDash', $comments );
|
||||
$plugin = new CommentPlugin;
|
||||
|
||||
if ( ! $plugin->checkEnabled() ) {
|
||||
Debug::info( 'Comments Plugin is disabled in the control panel.' );
|
||||
Components::set( 'commentDash', '' );
|
||||
} else {
|
||||
$comments = new Comments;
|
||||
$commentList = Views::simpleView( 'comments.admin.dashboard', $comments->recent( 'all', 5 ) );
|
||||
Components::set( 'commentDash', $commentList );
|
||||
}
|
||||
}
|
||||
|
||||
if ( class_exists( 'TheTempusProject\Plugins\Blog' ) ) {
|
||||
$blog = new Blog;
|
||||
self::$posts = $blog->posts;
|
||||
$posts = Views::simpleView( 'blog.admin.dashboard', self::$posts->recent( 5 ) );
|
||||
Components::set( 'blogDash', $posts );
|
||||
$plugin = new BlogPlugin;
|
||||
|
||||
if ( ! $plugin->checkEnabled() ) {
|
||||
Debug::info( 'Blog Plugin is disabled in the control panel.' );
|
||||
Components::set( 'blogDash', '' );
|
||||
} else {
|
||||
$posts = new Posts;
|
||||
$postsList = Views::simpleView( 'blog.admin.dashboard', $posts->recent( 5 ) );
|
||||
Components::set( 'blogDash', $postsList );
|
||||
}
|
||||
}
|
||||
|
||||
self::$user = new User;
|
||||
|
Reference in New Issue
Block a user