1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14:
15: 16: 17: 18: 19:
20: class NTemplateException extends InvalidStateException implements IDebugPanel
21: {
22:
23: public $sourceFile;
24:
25:
26: public $sourceLine;
27:
28:
29:
30: function __construct($message, $code = 0, $sourceLine = 0)
31: {
32: $this->sourceLine = (int) $sourceLine;
33: parent::__construct($message, $code);
34: }
35:
36:
37:
38: function setSourceFile($file)
39: {
40: $this->sourceFile = (string) $file;
41: $this->message = rtrim($this->message, '.') . " in " . str_replace(dirname(dirname($file)), '...', $file)
42: . ($this->sourceLine ? ":$this->sourceLine" : '');
43: }
44:
45:
46:
47: function getTab()
48: {
49: return 'Template';
50: }
51:
52:
53:
54: function getPanel()
55: {
56: $link = NDebugHelpers::editorLink($this->sourceFile, $this->sourceLine);
57: return '<p><b>File:</b> ' . ($link ? '<a href="' . htmlspecialchars($link) . '">' : '') . htmlspecialchars($this->sourceFile) . ($link ? '</a>' : '')
58: . ' <b>Line:</b> ' . ($this->sourceLine ? $this->sourceLine : 'n/a') . '</p>'
59: . ($this->sourceLine ? '<pre>' . NDebugHelpers::highlightFile($this->sourceFile, $this->sourceLine) . '</pre>' : '');
60: }
61:
62:
63:
64: function getId()
65: {
66: }
67:
68: }
69: