Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #118 from Hounddog/bugfixes
Browse files Browse the repository at this point in the history
Added Error Layout
  • Loading branch information
weierophinney committed Jun 28, 2013
2 parents 693ab0a + fa11a87 commit 01ed502
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "vendor/EdpModuleLayouts"]
path = vendor/EdpModuleLayouts
url = https://github.com/EvanDotPro/EdpModuleLayouts.git
[submodule "vendor/LfjErrorLayout"]
path = vendor/LfjErrorLayout
url = https://github.com/lorenzoferrarajr/LfjErrorLayout.git
1 change: 1 addition & 0 deletions config/application.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

return array(
'modules' => array(
'LfjErrorLayout',
'ZfcBase',
'ZfcUser',
'ScnSocialAuth',
Expand Down
31 changes: 0 additions & 31 deletions config/application.config.php.orig

This file was deleted.

1 change: 1 addition & 0 deletions module/Application/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/error' => __DIR__ . '/../view/layout/layout-small-header.phtml',
'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
'application/index/index' => __DIR__ . '/../view/application/index/index.phtml',
'application/index/pagination' => __DIR__ . '/../view/application/index/pagination.phtml',
Expand Down
31 changes: 31 additions & 0 deletions module/Application/public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,35 @@ div.container a.brand {

.small-header {
padding-top:60px;
}

.error-404 {
width: 500px;
height: 617px;
padding-left: 450px;

background: url(../img/mwop-404.png) no-repeat;
}

.error-404-speech-bubble {
position: relative;
display: inline-block;
padding: 15px;
margin-top: 150px;

border: 3px solid #000000;
border-radius: 7px;
}

.error-404-speech-bubble:before {
position: absolute;
content: '';

left: -69px;
top: 50px;

width: 69px;
height: 40px;

background: url(../img/speech-bubble-arrow.png) no-repeat;
}
Binary file added module/Application/public/img/mwop-404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 25 additions & 13 deletions module/Application/view/error/404.phtml
Original file line number Diff line number Diff line change
@@ -1,44 +1,56 @@
<h1><?php echo $this->translate('A 404 error occurred') ?></h1>
<h2><?php echo $this->message ?></h2>
<?php $this->layout()->single = true; ?>

<?php if (isset($this->reason) && $this->reason): ?>

<?php
$reasonMessage= '';
switch ($this->reason) {
case 'error-controller-cannot-dispatch':
$reasonMessage = $this->translate('The requested controller was unable to dispatch the request.');
$reasonMessage = 'The requested controller was unable to dispatch the request.';
break;
case 'error-controller-not-found':
$reasonMessage = $this->translate('The requested controller could not be mapped to an existing controller class.');
$reasonMessage = 'The requested controller could not be mapped to an existing controller class.';
break;
case 'error-controller-invalid':
$reasonMessage = $this->translate('The requested controller was not dispatchable.');
$reasonMessage = 'The requested controller was not dispatchable.';
break;
case 'error-router-no-match':
$reasonMessage = $this->translate('The requested URL could not be matched by routing.');
$reasonMessage = 'The requested URL could not be matched by routing.';
break;
default:
$reasonMessage = $this->translate('We cannot determine at this time why a 404 was generated.');
$reasonMessage = 'We cannot determine at this time why a 404 was generated.';
break;
}
$errorText = array(
"NO, Zend Framework is <strong>not</strong> to blame for this!",
$reasonMessage,
);
?>

<p><?php echo $reasonMessage ?></p>
<div class="error-404">
<div class="error-404-speech-bubble">
<h1>A 404 error occurred</h1>

<h2><?php echo $this->message ?></h2>

<p><?php echo $errorText[array_rand($errorText)]; ?></p>
</div>
</div>


<?php endif ?>

<?php if (isset($this->controller) && $this->controller): ?>

<dl>
<dt><?php echo $this->translate('Controller') ?>:</dt>
<dt>Controller:</dt>
<dd><?php echo $this->escapeHtml($this->controller) ?>
<?php
if (isset($this->controller_class)
&& $this->controller_class
&& $this->controller_class != $this->controller
) {
echo '(' . sprintf($this->translate('resolves to %s'), $this->escapeHtml($this->controller_class)) . ')';
echo '(' . sprintf('resolves to %s', $this->escapeHtml($this->controller_class)) . ')';
}
?>
</dd>
Expand All @@ -48,14 +60,14 @@ if (isset($this->controller_class)

<?php if (isset($this->exception) && $this->exception): ?>

<h2><?php echo $this->translate('Exception') ?>:</h2>
<h2>Exception:</h2>

<p><b><?php echo $this->escapeHtml($this->exception->getMessage()) ?></b></p>

<h3><?php echo $this->translate('Stack trace') ?>:</h3>
<h3>Stack trace:</h3>

<pre>
<?php echo $this->exception->getTraceAsString() ?>
</pre>

<?php endif ?>
<?php endif ?>
31 changes: 16 additions & 15 deletions module/Application/view/error/index.phtml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<h1><?php echo $this->translate('An error occurred') ?></h1>
<?php $this->layout()->single = true; ?>
<h1>An error occurred</h1>
<h2><?php echo $this->message ?></h2>

<?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>

<?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
<hr/>
<h2><?php echo $this->translate('Additional information') ?>:</h2>
<h2>Additional information:</h2>
<h3><?php echo get_class($this->exception); ?></h3>
<dl>
<dt><?php echo $this->translate('File') ?>:</dt>
<dt>File:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->exception->getFile() ?>:<?php echo $this->exception->getLine() ?></pre>
</dd>
<dt><?php echo $this->translate('Message') ?>:</dt>
<dt>Message:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->exception->getMessage() ?></pre>
</dd>
<dt><?php echo $this->translate('Stack trace') ?>:</dt>
<dt>Stack trace:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $this->exception->getTraceAsString() ?></pre>
</dd>
Expand All @@ -26,37 +27,37 @@
if ($e) :
?>
<hr/>
<h2><?php echo $this->translate('Previous exceptions') ?>:</h2>
<h2>Previous exceptions:</h2>
<ul class="unstyled">
<?php while($e) : ?>
<li>
<h3><?php echo get_class($e); ?></h3>
<dl>
<dt><?php echo $this->translate('File') ?>:</dt>
<dt>File:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $e->getFile() ?>:<?php echo $e->getLine() ?></pre>
</dd>
<dt><?php echo $this->translate('Message') ?>:</dt>
<dt>Message:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $e->getMessage() ?></pre>
</dd>
<dt><?php echo $this->translate('Stack trace') ?>:</dt>
<dt>Stack trace:</dt>
<dd>
<pre class="prettyprint linenums"><?php echo $e->getTraceAsString() ?></pre>
</dd>
</dl>
<?php
$e = $e->getPrevious();
endwhile;
?>
</li>
<?php
$e = $e->getPrevious();
endwhile;
?>
</ul>
<?php endif; ?>

<?php else: ?>

<h3><?php echo $this->translate('No Exception available') ?></h3>
<h3>No Exception available</h3>

<?php endif ?>

<?php endif ?>
<?php endif ?>
1 change: 1 addition & 0 deletions vendor/LfjErrorLayout
Submodule LfjErrorLayout added at f57b4c

0 comments on commit 01ed502

Please sign in to comment.