* @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Controllers; use TheTempusProject\Houdini\Classes\Views; use TheTempusProject\Classes\Controller; use TheTempusProject\Models\Inithistory; use TheTempusProject\Houdini\Classes\Issues; use TheTempusProject\Houdini\Classes\Components; use TheTempusProject\TheTempusProject as App; class Initiative extends Controller { protected static $initiativeHistory; public function __construct() { self::$title = 'Initiative Tracker - {SITENAME}'; self::$pageDescription = 'This is for tracking player and creature turns and initiatives.'; self::$initiativeHistory = new Inithistory; if ( ! App::$isLoggedIn ) { Issues::add( 'info', 'If you register an account and log in, you can save your initiatives.' ); Components::set( 'initiativeHistory', '' ); } else { $history = self::$initiativeHistory->userHistory(); $historyView = Views::simpleView( 'initiativetracker.historyElement', $history ); Components::set( 'initiativeHistory', $historyView ); } parent::__construct(); } public function index() { Views::view( 'initiativetracker.index' ); } }