* @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Plugins; use ReflectionClass; use TheTempusProject\Classes\Installer; use TheTempusProject\Houdini\Classes\Navigation; use TheTempusProject\Classes\Plugin; use TheTempusProject\TheTempusProject as App; class Redirects extends Plugin { public $pluginName = 'TP Redirects'; public $pluginAuthor = 'JoeyK'; public $pluginWebsite = 'https://TheTempusProject.com'; public $modelVersion = '1.0'; public $pluginVersion = '3.0'; public $pluginDescription = 'A simple plugin which adds redirects.'; public $permissionMatrix = [ 'redirects' => [ 'pretty' => 'Can modify redirects', 'default' => false, ], ]; public $admin_links = [ [ 'text' => ' Redirects', 'url' => '{ROOT_URL}admin/routes', ], ]; } // as long as this is in the plugin constructor, it should happen before the controller and method loading // $routes = new RoutesModel; // $route = $routes->findByOriginalUrl( $url ); // if ( false !== $route ) { // if ( 'internal' === $route->redirect_type ) { // $this->setUrl( $route->forwarded_url ); // } else { // Redirect::external( $route->forwarded_url ); // } // }