-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f0aa0e
commit a5dc88e
Showing
10 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
h1 { | ||
text-align: center; | ||
} |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace Theme\Listeners; | ||
|
||
class Error extends \Dsc\Singleton | ||
{ | ||
public function onError( $event ) | ||
{ | ||
$f3 = \Base::instance(); | ||
|
||
if ($f3->get('ERROR.code') == '404') | ||
{ | ||
if ($f3->get('APP_NAME') == 'site') | ||
{ | ||
$response = $event->getArgument('response'); | ||
|
||
$html = \Dsc\System::instance()->get('theme')->renderView('Theme\Views::404.php'); | ||
|
||
$response->action = 'html'; | ||
$response->html = $html; | ||
|
||
$event->setArgument('response', $response); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
<?php //echo \Dsc\Debug::dump( $this->app->hive(), false ); ?> | ||
|
||
<!-- JAVASCRIPTS --> | ||
<!-- Placed at the end of the document so the pages load faster --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<base href="<?php echo $SCHEME . "://" . $HOST . $BASE . "/"; ?>" /> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<meta name="keywords" content="<?php echo $this->app->get('meta.keywords'); ?>" /> | ||
<meta name="description" content="<?php echo $this->app->get('meta.description'); ?>" /> | ||
<meta name="generator" content="<?php echo $this->app->get('meta.generator'); ?>" /> | ||
<meta name="author" content=""> | ||
|
||
|
||
<link href="/minify/css" rel="stylesheet"> | ||
<script src="/minify/js"></script> | ||
|
||
<title><?php echo $this->app->get('meta.title'); ?></title> | ||
|
||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php echo \Dsc\System::instance()->renderMessages(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
class ThemeBootstrap extends \Dsc\Bootstrap | ||
{ | ||
protected $dir = __DIR__; | ||
protected $base = __DIR__; | ||
protected $namespace = 'Theme'; | ||
|
||
/** | ||
* Register this app's view files for all global_apps | ||
* @param string $global_app | ||
*/ | ||
protected function registerViewFiles($global_app) | ||
{ | ||
\Dsc\System::instance()->get('theme')->registerViewPath($this->dir . '/' . $global_app . '/Views/', $this->namespace . '/' . $global_app . '/Views'); | ||
} | ||
|
||
/** | ||
* Triggered when the admin global_app is run | ||
*/ | ||
protected function runAdmin() | ||
{ | ||
parent::runAdmin(); | ||
|
||
$f3 = \Base::instance(); | ||
|
||
// Tell the admin that this is an available front-end theme | ||
\Dsc\System::instance()->get('theme')->registerTheme('Theme', $f3->get('PATH_ROOT') . 'apps/Theme/' ); | ||
|
||
// register this theme's module positions with the admin | ||
\Modules\Factory::registerPositions( array('theme-below-header', 'theme-above-footer', 'theme-below-footer', 'theme-above-content', 'theme-below-content', 'theme-left-content', 'theme-right-content') ); | ||
} | ||
|
||
/** | ||
* Triggered when the front-end global_app is run | ||
*/ | ||
protected function runSite() | ||
{ | ||
parent::runSite(); | ||
$f3 = \Base::instance(); | ||
|
||
if(!is_dir($f3->get('PATH_ROOT').'public/theme')) { | ||
$publictheme = $f3->get('PATH_ROOT').'public/theme'; | ||
$admintheme = $f3->get('PATH_ROOT').'apps/theme/Assets'; | ||
$res = symlink( $admintheme, $publictheme ); | ||
} | ||
|
||
|
||
|
||
|
||
\Dsc\System::instance()->get('theme')->setTheme('Theme', $f3->get('PATH_ROOT') . 'apps/Theme/' ); | ||
\Dsc\System::instance()->get('theme')->registerViewPath( $f3->get('PATH_ROOT') . 'apps/Theme/Views/', 'Theme/Views' ); | ||
|
||
// tell Minify where to find Media, CSS and JS files | ||
\Minify\Factory::registerPath($f3->get('PATH_ROOT') . "public/theme/"); | ||
\Minify\Factory::registerPath($f3->get('PATH_ROOT') . "public/theme/css/"); | ||
\Minify\Factory::registerPath($f3->get('PATH_ROOT') . "public/"); | ||
|
||
// register the less css file | ||
\Minify\Factory::registerLessCssSource( $f3->get('PATH_ROOT') . "apps/Theme/Less/global.less.css" ); | ||
|
||
// add the media assets to be minified | ||
$files = array( | ||
'css/style.css', | ||
); | ||
|
||
foreach ($files as $file) | ||
{ | ||
\Minify\Factory::css($file); | ||
} | ||
|
||
$files = array( | ||
'js/script.js', | ||
); | ||
|
||
foreach ($files as $file) | ||
{ | ||
\Minify\Factory::js($file, array('priority' => 1)); | ||
} | ||
|
||
\Dsc\System::instance()->getDispatcher()->addListener(\Theme\Listeners\Error::instance()); | ||
} | ||
} | ||
$app = new ThemeBootstrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="default <?php echo @$html_class; ?>" > | ||
<head> | ||
<?php echo $this->renderView('Theme/Views::common/head.php'); ?> | ||
</head> | ||
<body> | ||
|
||
<!-- PAGE --> | ||
<body> | ||
<tmpl type="system.messages" /> | ||
<tmpl type="view" /> | ||
<!--/FOOTER --> | ||
</div> | ||
<!--/PAGE --> | ||
<?php echo $this->renderView('Theme/Views::common/footer.php'); ?> | ||
</body> | ||
</html> |