Files
thetempusproject/app/templates/default/default.inc.php
2024-08-20 06:37:38 -04:00

60 lines
3.0 KiB
PHP

<?php
/**
* app/templates/default/default.inc.php
*
* This is the loader for the default template.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @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( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
$this->addJs( '<script language="JavaScript" crossorigin="anonymous" type="text/javascript" src="{ROOT_URL}app/js/main.js"></script>' );
Components::setIfNull( 'LOGO', Config::getValue( 'main/logo' ) );
Components::setIfNull( 'FOOTER_LEFT', Navigation::getMenuView( 'footer.left', 'FOOTER_LINKS', App::FOOTER_MENU_NAME, false ) );
Components::setIfNull( 'FOOTER_CENTER', Views::simpleView( 'footer.center') );
Components::setIfNull( 'FOOTER_RIGHT', Views::simpleView( 'footer.right') );
Components::setIfNull( 'FOOT', Views::simpleView( 'footer.container') );
Components::setIfNull( '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();
}
}