wip from ATB
This commit is contained in:
@ -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 ) );
|
||||
|
@ -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' );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user