Custom web page error for users and companies.
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 2 Dec 2012 21:12:40 +0000 (22:12 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 2 Dec 2012 21:12:40 +0000 (22:12 +0100)
It does not work during development just for production environment.

apps/companyfront/config/settings.yml
apps/companyfront/modules/customerrors/actions/actions.class.php [new file with mode: 0644]
apps/companyfront/modules/customerrors/config/view.yml [new file with mode: 0644]
apps/companyfront/modules/customerrors/templates/error404Success.php [new file with mode: 0644]
apps/userfront/config/settings.yml
apps/userfront/modules/customerrors/actions/actions.class.php [new file with mode: 0644]
apps/userfront/modules/customerrors/config/view.yml [new file with mode: 0644]
apps/userfront/modules/customerrors/templates/error404Success.php [new file with mode: 0644]

index f1642a6..59d99c6 100644 (file)
@@ -42,3 +42,6 @@ all:
 
     secure_module:          sfGuardAuth
     secure_action:          secure
+
+    error_404_module: customerrors
+    error_404_action: error404
diff --git a/apps/companyfront/modules/customerrors/actions/actions.class.php b/apps/companyfront/modules/customerrors/actions/actions.class.php
new file mode 100644 (file)
index 0000000..23f3df8
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * category actions.
+ *
+ * @package    mobiads
+ * @subpackage customerrors
+ * @author     Gustavo Martin Morcuende
+ * @version
+ */
+class customerrorsActions extends sfActions
+{
+  /**
+   * Error page for page not found (404) error
+   *
+   */
+  public function executeError404()
+  {
+  }
+}
diff --git a/apps/companyfront/modules/customerrors/config/view.yml b/apps/companyfront/modules/customerrors/config/view.yml
new file mode 100644 (file)
index 0000000..4084c6e
--- /dev/null
@@ -0,0 +1,20 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/13-View
+
+default:
+  http_metas:
+    content-type: text/html
+
+  metas:
+    #title:        symfony project
+    #description:  symfony project
+    #keywords:     symfony, project
+    #language:     en
+    #robots:       index, follow
+
+  stylesheets:    [inadminpanel/style.css, inadminpanel/niceforms-default.css]
+
+  javascripts:    [jquery-1.6.2.min.js, inadminpanel/ddaccordion.js]
+
+  has_layout:     true
+  layout:         layoutsfGuardAuth
diff --git a/apps/companyfront/modules/customerrors/templates/error404Success.php b/apps/companyfront/modules/customerrors/templates/error404Success.php
new file mode 100644 (file)
index 0000000..95b2d35
--- /dev/null
@@ -0,0 +1,16 @@
+<center><?php echo image_tag('/sf/sf_default/images/icons/cancel48.png', array('alt' => 'page not found', 'size' => '48x48')) ?></center>
+<h1><center>Oops! Page Not Found</center></h1>
+<h1><center>The server returned a 404 response.</center></h1>
+
+<table align="center">
+    <tbody>
+        <tr>
+        <td>
+            <a href="javascript:history.go(-1)"class="bt_red"><span class="bt_red_lft"></span><strong><?php echo __('Back to previous page') ?></strong><span class="bt_red_r"></span></a>
+        </td>
+        <td>
+            <a href="<?php echo url_for('@homepage') ?>" class="bt_green"><span class="bt_green_lft"></span><strong><?php echo __('Go to Homepage') ?></strong><span class="bt_green_r"></span></a>
+        </td>
+        </tr>
+    </tbody>
+</table>
index 57a00ba..1fb1f4d 100644 (file)
@@ -42,3 +42,6 @@ all:
 
     secure_module:          sfGuardAuth
     secure_action:          secure
+
+    error_404_module: customerrors
+    error_404_action: error404
diff --git a/apps/userfront/modules/customerrors/actions/actions.class.php b/apps/userfront/modules/customerrors/actions/actions.class.php
new file mode 100644 (file)
index 0000000..23f3df8
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * category actions.
+ *
+ * @package    mobiads
+ * @subpackage customerrors
+ * @author     Gustavo Martin Morcuende
+ * @version
+ */
+class customerrorsActions extends sfActions
+{
+  /**
+   * Error page for page not found (404) error
+   *
+   */
+  public function executeError404()
+  {
+  }
+}
diff --git a/apps/userfront/modules/customerrors/config/view.yml b/apps/userfront/modules/customerrors/config/view.yml
new file mode 100644 (file)
index 0000000..4084c6e
--- /dev/null
@@ -0,0 +1,20 @@
+# You can find more information about this file on the symfony website:
+# http://www.symfony-project.org/reference/1_4/en/13-View
+
+default:
+  http_metas:
+    content-type: text/html
+
+  metas:
+    #title:        symfony project
+    #description:  symfony project
+    #keywords:     symfony, project
+    #language:     en
+    #robots:       index, follow
+
+  stylesheets:    [inadminpanel/style.css, inadminpanel/niceforms-default.css]
+
+  javascripts:    [jquery-1.6.2.min.js, inadminpanel/ddaccordion.js]
+
+  has_layout:     true
+  layout:         layoutsfGuardAuth
diff --git a/apps/userfront/modules/customerrors/templates/error404Success.php b/apps/userfront/modules/customerrors/templates/error404Success.php
new file mode 100644 (file)
index 0000000..95b2d35
--- /dev/null
@@ -0,0 +1,16 @@
+<center><?php echo image_tag('/sf/sf_default/images/icons/cancel48.png', array('alt' => 'page not found', 'size' => '48x48')) ?></center>
+<h1><center>Oops! Page Not Found</center></h1>
+<h1><center>The server returned a 404 response.</center></h1>
+
+<table align="center">
+    <tbody>
+        <tr>
+        <td>
+            <a href="javascript:history.go(-1)"class="bt_red"><span class="bt_red_lft"></span><strong><?php echo __('Back to previous page') ?></strong><span class="bt_red_r"></span></a>
+        </td>
+        <td>
+            <a href="<?php echo url_for('@homepage') ?>" class="bt_green"><span class="bt_green_lft"></span><strong><?php echo __('Go to Homepage') ?></strong><span class="bt_green_r"></span></a>
+        </td>
+        </tr>
+    </tbody>
+</table>