* @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Templates; use TheTempusProject\Houdini\Classes\Loader; use TheTempusProject\Houdini\Classes\Template; use TheTempusProject\Houdini\Classes\Views; use TheTempusProject\Houdini\Classes\Navigation; use TheTempusProject\Houdini\Classes\Components; use TheTempusProject\Bedrock\Classes\Config; use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\TheTempusProject as App; class DefaultLoader extends Loader { const TEMPLATE_NAME = 'Default Tempus Project Template'; const JQUERY_CDN = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/'; const BOOTSTRAP_CDN = 'https://cdn.jsdelivr.net/npm/bootstrap@3.3.6/dist/'; const FONT_AWESOME_URL = 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/'; public function __construct() { Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) ); Components::set( 'BOOTSTRAP_CDN', self::BOOTSTRAP_CDN ); $this->addCss( '' ); $this->addJs( '' ); Components::set( 'LOGO', Config::getValue( 'main/logo' ) ); Components::set( 'FOOT', Navigation::getMenuView( 'foot', 'FOOTER_LINKS', App::FOOTER_MENU_NAME, false ) ); Components::set( 'COPY', Views::simpleView( 'copy') ); /** * Top-Nav */ if ( App::$isLoggedIn ) { Components::set( 'topNavRightDropdown', Template::parse( App::$topNavRightDropdown ) ); Components::set( 'STATUS', Views::simpleView( 'nav.statusLoggedIn' ) ); Components::set( 'USERNAME', App::$activeUser->username ); } else { Components::set( 'STATUS', Views::simpleView( 'nav.statusLoggedOut' ) ); } Components::set( 'topNavRight', Template::parse( App::$topNavRight . '{STATUS}' ) ); Components::set( 'topNavLeft', Navigation::getMenuView( 'nav.main', 'MENU_LINKS', App::MAIN_MENU_NAME ) ); Components::set( 'JQUERY_CDN', self::JQUERY_CDN ); Components::set( 'FONT_AWESOME_URL', self::FONT_AWESOME_URL ); Components::set( 'colorSelect', Views::simpleView( 'forms.colorSelect' ) ); Components::set( 'iconSelect', Views::simpleView( 'forms.iconSelect' ) ); Navigation::setCrumbComponent( 'BREADCRUMB', Input::get( 'url' ) ); $this->buildComponents(); } }