histogram: Make histograms crash less
[ninja.git] / application / widgets / error / error.php
blob3d11d7dbf3ae5352bff926ebf1ae67829766d12e
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Widget for rendering load errors
4 */
5 class Error_Widget extends widget_Base {
6 private $message = false;
7 /**
8 * Takes a widget model instance, and an exception, and tries to render
9 * both in a somewhat user-friendly way.
11 public function __construct($widget_obj, $exception) {
12 $this->model = $widget_obj;
13 if ($this->model == false) {
14 $this->model = new stdclass();
15 $this->model->name = 'unknown';
16 $this->model->instance_id = 1;
17 $this->model->friendly_name = 'Unknown widget';
19 if (empty($exception))
20 $exception = new Exception("Unknown error");
21 $this->exception = $exception;
23 $this->auto_render = FALSE;
25 public function index() {
26 require(dirname(__FILE__).'/view.php');