Browse Source

- Fix the 404 page

- Clean some old code
pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
945ef264c9
  1. 44
      app/controllers/ControllerBase.php
  2. 101
      bootstrap.php
  3. 2
      index.php
  4. 2
      infos.php
  5. 2
      jajax.php
  6. 2
      upload.php

44
app/controllers/ControllerBase.php

@ -131,17 +131,39 @@ class ControllerBase
*/
protected function error404()
{
//echo 'Error 404 - Page not found';
$page = new TplPageBuilder();
WidgetWrapper::getInstance(false);
$page->setTitle(t('%s - 404', APP_TITLE));
$page->menuAddLink(t('Home'), 'main', true);
$content = new TplPageBuilder();
$page->setContent($content->build('404.tpl'));
echo $page->build('page.tpl');
?>
<style type="text/css">
body {
}
#content {
margin: 0 auto;
max-width: 1024px;
font-family: sans-serif;
font-size: 3em;
line-height: 1.5em;
text-align: center;
padding: 1em 0em;
}
img.logo {
display: block;
float: right;
}
</style>
<div id="content">
404<br />
<img src="<?php echo BASE_URI.'/themes/movim/img/yuno.png'; ?>" /> <br />
Y U NO FOUND
<br />
<a href="http://movim.eu/">
<img class="logo" src="<?php echo BASE_URI.'themes/movim/img/logo_black.png'; ?>" />
</a>
</div>
<?php
}
}

101
bootstrap.php

@ -52,14 +52,8 @@ class Bootstrap {
}
}
private function getBaseUri() {
$index_pos = strpos($_SERVER['PHP_SELF'], 'index.php');
$path = "";
if($index_pos <= 0) {
$path = $_SERVER['PHP_SELF'];
} else {
$path = substr($_SERVER['PHP_SELF'], 0, $index_pos);
}
private function getBaseUri() {
$path = dirname(dirname($_SERVER['PHP_SELF']));
// Determining the protocol to use.
$uri = "http://";
if((
@ -223,55 +217,64 @@ class Bootstrap {
* Display the boot errors
*/
public function bootLogs() {
if (ENVIRONMENT === 'development') {
?>
<style type="text/css">
body {
font-family: sans-serif;
}
a:link, a:visited {
text-decoration: none;
color: #32434D;
}
#debug {
max-width: 1024px;
margin: 0 auto;
background-color: white;
padding: 2em;
}
#debug img {
float: right;
margin-top: 2em;
}
#logs {
font-family: monospace;
background-color: #353535;
color: white;
padding: 1em;
margin: 1em 0;
}
</style>
<style type="text/css">
body {
font-family: sans-serif;
}
a:link, a:visited {
text-decoration: none;
color: #32434D;
}
#debug {
max-width: 1024px;
margin: 0 auto;
background-color: white;
padding: 2em;
}
#debug img {
float: right;
margin-top: 2em;
}
#logs {
font-family: monospace;
background-color: #353535;
color: white;
padding: 1em;
margin: 1em 0;
}
</style>
<div id="debug">
<div id="debug">
<?php
if (ENVIRONMENT === 'development') {
?>
<div class="carreful">
<p>Be careful you are actually in development environment</p>
<p>Be careful you are currently in development environment</p>
</div>
<div id="logs">
<?php echo Logger::displayLog(); ?>
</div>
Maybe you can fix some issues with the <a href="<?php echo Route::urlize('admin'); ?>">admin panel</a>
Maybe you can fix some issues with the <a href="<?php echo Route::urlize('admin'); ?>">admin panel</a>
<?php
} elseif (ENVIRONMENT === 'production') {
?>
<div class="carreful">
<p>Oops... something went wrong.<br />But don't panic. The NSA is on the case.</p>
</div>
<?php
}
?>
<a href="http://movim.eu/">
<img src="<?php echo BASE_URI.'themes/movim/img/logo_black.png'; ?>" />
<div class="clear"></div>
</div>
<?php
}
</a>
<div class="clear"></div>
</div>
<?php
}
}

2
index.php

@ -37,7 +37,7 @@
* events-based API.
*/
define('DOCUMENT_ROOT', dirname(__FILE__));
define('DOCUMENT_ROOT', dirname(__FILE__));
require_once(DOCUMENT_ROOT.'/bootstrap.php');
$bootstrap = new Bootstrap();

2
infos.php

@ -17,7 +17,7 @@
*/
// We load the Movim kernel
define('DOCUMENT_ROOT', dirname(__FILE__));
define('DOCUMENT_ROOT', (dirname(__FILE__));
require_once(DOCUMENT_ROOT.'/bootstrap.php');
$bootstrap = new Bootstrap();

2
jajax.php

@ -16,7 +16,7 @@
* See the file `COPYING' for licensing information.
*/
define('DOCUMENT_ROOT', dirname(__FILE__));
define('DOCUMENT_ROOT', dirname(__FILE__));
require_once(DOCUMENT_ROOT.'/bootstrap.php');
$bootstrap = new Bootstrap();

2
upload.php

@ -1,5 +1,5 @@
<?php
define('DOCUMENT_ROOT', dirname(__FILE__));
define('DOCUMENT_ROOT', dirname(__FILE__));
require_once(DOCUMENT_ROOT.'/bootstrap.php');
$bootstrap = new Bootstrap();

Loading…
Cancel
Save