The best way to learn how to use the WebCore is by example. See the documentation for more information.
The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.
Source for: https://www.earthli.com/shared/handle_exception.php
Uses WebCore template(s):
00 <?php
01 require_once ('webcore/init.php');
02 require_once ($Page->page_template_for ('webcore/pages/handle_exception.php'));
03 ?>
Source for template: webcore/pages/handle_exception.php
00 <?php
01
02 /****************************************************************************
03
04 Copyright (c) 2002-2014 Marco Von Ballmoos
05
06 This file is part of earthli WebCore.
07
08 earthli WebCore is free software; you can redistribute it and/or modify
09 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 earthli WebCore is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with earthli WebCore; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 For more information about the earthli WebCore, visit:
23
24 http://www.earthli.com/software/webcore
25
26 ****************************************************************************/
27
28 $Page->title->subject = "An error has occurred";
29 $Page->template_options->title = "Exception";
30
31 $class_name = $Page->final_class_name ('EXCEPTION_SIGNATURE', 'webcore/sys/exception_signature.php');
32 /** @var $sig EXCEPTION_SIGNATURE */
33 $sig = new $class_name ($Page);
34 $sig->load_from_request ();
35
36 $class_name = $Page->final_class_name ('SUBMIT_EXCEPTION_FORM', 'webcore/forms/submit_exception_form.php');
37 /** @var $form SUBMIT_EXCEPTION_FORM */
38 $form = new $class_name ($Page);
39
40 $form->process_existing ($sig);
41 if ($form->committed ())
42 {
43 $Env->redirect_local ('exception_submitted.php');
44 }
45
46 $Page->location->add_root_link ();
47 $Page->location->append($Page->title->subject, '', '{icons}indicators/warning');
48
49 $Page->start_display ();
50 ?>
51 <div class="main-box">
52 <div class="text-flow">
53 <p>An error occurred while processing your last request.</p>
54 <p>Please submit the prepared report below to help us address this issue.</p>
55 <p>Or take a chance and try again. You never know.</p>
56 <p>We apologize for the inconvenience and thank you in advance for your help,<br>
57 the earthli Team.</p>
58 </div>
59 <?php
60 $controls_renderer = $Page->make_controls_renderer ();
61 $buttons [] = $controls_renderer->button_as_html ('Submit report', '#submission-form', '{icons}buttons/send');
62 ?>
63 <p>
64 <?php
65 $controls_renderer->draw_buttons ($buttons);
66 ?>
67 </p>
68 <?php
69 if (!$form->previewing())
70 {
71 $class_name = $Page->final_class_name ('EXCEPTION_RENDERER', 'webcore/gui/exception_renderer.php');
72 /** @var $renderer EXCEPTION_RENDERER */
73 $renderer = new $class_name ($Page);
74 /** @var $options EXCEPTION_RENDERER_OPTIONS */
75 $options = $renderer->options ();
76 $options->include_page_data = true;
77 $options->include_browser_info = true;
78 $renderer->display_as_html ($sig, $options);
79 }
80 ?>
81 <div class="form-content" id="submission-form">
82 <?php
83 $form->display ();
84 ?>
85 </div>
86 </div>
87 <?php
88 $Page->finish_display ();
89 ?>