75 lines
3.8 KiB
PHP
75 lines
3.8 KiB
PHP
|
<?php
|
||
|
namespace Makai;
|
||
|
|
||
|
use Index\Data\IDbConnection;
|
||
|
|
||
|
final class MakaiContext {
|
||
|
private IDbConnection $db;
|
||
|
private ?TemplateContext $tpl = null;
|
||
|
|
||
|
public function __construct(IDbConnection $db) {
|
||
|
$this->db = $db;
|
||
|
}
|
||
|
|
||
|
public function getDatabase(): IDbConnection {
|
||
|
return $this->db;
|
||
|
}
|
||
|
|
||
|
public function getTemplating(): TemplateContext {
|
||
|
if($this->tpl === null) {
|
||
|
$this->tpl = new TemplateContext(MKI_DIR_TEMPLATES);
|
||
|
$this->tpl->setGlobal('makai', $this);
|
||
|
$this->tpl->setGlobal('header_nav', $this->getDefaultNavigation());
|
||
|
$this->tpl->setGlobal('header_bgs', $this->getDefaultHeaders());
|
||
|
$this->tpl->setGlobal('footer_quotes', $this->getFooterQuotes());
|
||
|
}
|
||
|
|
||
|
return $this->tpl;
|
||
|
}
|
||
|
|
||
|
public function getDefaultNavigation(): array {
|
||
|
return [
|
||
|
['title' => 'Home', 'link' => '/'],
|
||
|
['title' => 'Projects', 'link' => '/projects'],
|
||
|
['title' => 'Contact', 'link' => '/contact'],
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function getDefaultHeaders(): array {
|
||
|
return [
|
||
|
'/assets/headers/krk-000.jpg', '/assets/headers/krk-001.jpg', '/assets/headers/krk-002.jpg',
|
||
|
'/assets/headers/krk-003.jpg', '/assets/headers/krk-004.jpg', '/assets/headers/krk-005.jpg',
|
||
|
'/assets/headers/krk-006.jpg', '/assets/headers/krk-007.jpg', '/assets/headers/krk-008.jpg',
|
||
|
|
||
|
'/assets/headers/mkt-000.jpg', '/assets/headers/mkt-001.jpg', '/assets/headers/mkt-002.jpg',
|
||
|
'/assets/headers/mkt-003.jpg', '/assets/headers/mkt-004.jpg', '/assets/headers/mkt-005.jpg',
|
||
|
'/assets/headers/mkt-006.jpg', '/assets/headers/mkt-007.jpg', '/assets/headers/mkt-008.jpg',
|
||
|
'/assets/headers/mkt-009.jpg', '/assets/headers/mkt-010.jpg', '/assets/headers/mkt-011.jpg',
|
||
|
'/assets/headers/mkt-012.jpg', '/assets/headers/mkt-013.jpg', '/assets/headers/mkt-014.jpg',
|
||
|
'/assets/headers/mkt-015.jpg', '/assets/headers/mkt-016.jpg', '/assets/headers/mkt-017.jpg',
|
||
|
'/assets/headers/mkt-018.jpg', '/assets/headers/mkt-019.jpg', '/assets/headers/mkt-020.jpg',
|
||
|
'/assets/headers/mkt-021.jpg', '/assets/headers/mkt-022.jpg', '/assets/headers/mkt-023.jpg',
|
||
|
'/assets/headers/mkt-024.jpg', '/assets/headers/mkt-025.jpg', '/assets/headers/mkt-026.jpg',
|
||
|
'/assets/headers/mkt-027.jpg', '/assets/headers/mkt-028.jpg', '/assets/headers/mkt-029.jpg',
|
||
|
'/assets/headers/mkt-030.jpg', '/assets/headers/mkt-031.jpg', '/assets/headers/mkt-032.jpg',
|
||
|
'/assets/headers/mkt-033.jpg', '/assets/headers/mkt-034.jpg', '/assets/headers/mkt-035.jpg',
|
||
|
'/assets/headers/mkt-036.jpg', '/assets/headers/mkt-037.jpg', '/assets/headers/mkt-038.jpg',
|
||
|
'/assets/headers/mkt-039.jpg', '/assets/headers/mkt-040.jpg', '/assets/headers/mkt-041.jpg',
|
||
|
'/assets/headers/mkt-042.jpg', '/assets/headers/mkt-043.jpg', '/assets/headers/mkt-044.jpg',
|
||
|
'/assets/headers/mkt-045.jpg', '/assets/headers/mkt-046.jpg', '/assets/headers/mkt-047.jpg',
|
||
|
'/assets/headers/mkt-048.jpg', '/assets/headers/mkt-049.jpg', '/assets/headers/mkt-050.jpg',
|
||
|
'/assets/headers/mkt-051.jpg', '/assets/headers/mkt-052.jpg', '/assets/headers/mkt-053.jpg',
|
||
|
'/assets/headers/mkt-054.jpg', '/assets/headers/mkt-055.jpg', '/assets/headers/mkt-056.jpg',
|
||
|
'/assets/headers/mkt-057.jpg', '/assets/headers/mkt-058.jpg', '/assets/headers/mkt-059.jpg',
|
||
|
'/assets/headers/mkt-060.jpg', '/assets/headers/mkt-061.jpg', '/assets/headers/mkt-062.jpg',
|
||
|
'/assets/headers/mkt-063.jpg',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function getFooterQuotes(): array {
|
||
|
return [
|
||
|
'if it ain\'t broke, i\'ll break it',
|
||
|
];
|
||
|
}
|
||
|
}
|