wip from ATB

This commit is contained in:
Joey Kimsey
2025-01-04 17:21:14 -05:00
parent 87e4f90bab
commit 32a9711ade
60 changed files with 556 additions and 342 deletions

View File

@ -32,12 +32,12 @@ class Home extends AdminController {
}
public function index() {
Components::set( 'commentDash', '' );
if ( class_exists( 'TheTempusProject\Plugins\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 ) );

View File

@ -37,19 +37,25 @@ class Routes extends AdminController {
public function create() {
if ( Input::exists( 'redirect_type' ) ) {
if ( !TTPForms::check( 'createRoute' ) ) {
Issues::add( 'error', [ 'There was an error with your route.' => Check::userErrors() ] );
}
if ( self::$routes->create(
Input::post( 'original_url' ),
Input::post( 'forwarded_url' ),
Input::post( 'nickname' ),
Input::post( 'redirect_type' )
) ) {
Session::flash( 'success', 'Route Created' );
Redirect::to( 'admin/routes' );
}
return Views::view( 'admin.routes.create' );
}
if ( !TTPForms::check( 'createRoute' ) ) {
Issues::add( 'error', [ 'There was an error with your route.' => Check::userErrors() ] );
return Views::view( 'admin.routes.create' );
}
if ( self::$routes->create(
Input::post( 'original_url' ),
Input::post( 'forwarded_url' ),
Input::post( 'nickname' ),
Input::post( 'redirect_type' )
) ) {
Session::flash( 'success', 'Route Created' );
Redirect::to( 'admin/routes' );
}
Issues::add( 'error', 'There was an unknown error saving your redirect.' );
Views::view( 'admin.routes.create' );
}