callStackItem.php 1.61 KB
Newer Older
resurtm committed
1 2
<?php
/**
3 4 5 6
 * @var string|null $file
 * @var integer|null $line
 * @var string|null $class
 * @var string|null $method
resurtm committed
7 8 9 10
 * @var integer $index
 * @var string[] $lines
 * @var integer $begin
 * @var integer $end
11
 * @var \yii\base\ErrorHandler $handler
resurtm committed
12 13
 */
?>
14
<li class="<?php if (!$handler->isCoreFile($file) || $index === 1) echo 'application'; ?> call-stack-item"
Alexander Makarov committed
15
	data-line="<?= (int)($line - $begin) ?>">
resurtm committed
16 17
	<div class="element-wrap">
		<div class="element">
Alexander Makarov committed
18
			<span class="item-number"><?= (int)$index ?>.</span>
19
			<span class="text"><?php if ($file !== null) echo 'in ' . $handler->htmlEncode($file); ?></span>
20 21 22
			<?php if ($method !== null): ?>
				<span class="call">
					<?php if ($file !== null) echo '&ndash;' ?>
Alexander Makarov committed
23
					<?php if ($class !== null) echo $handler->addTypeLinks($class) . '::'; ?><?= $handler->addTypeLinks($method . '()') ?>
24 25 26
				</span>
			<?php endif; ?>
			<span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
resurtm committed
27
			<span class="line"><?php if ($line !== null) echo (int)$line + 1; ?></span>
resurtm committed
28 29
		</div>
	</div>
30 31
	<?php if (!empty($lines)): ?>
		<div class="code-wrap">
32 33
			<div class="error-line"></div>
			<?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
34
			<div class="code">
Alexander Makarov committed
35
				<?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int)($i + 1) ?></span><?php endfor; ?>
36 37 38
				<pre><?php
					// fill empty lines with a whitespace to avoid rendering problems in opera
					for ($i = $begin; $i <= $end; ++$i) {
39
						echo (trim($lines[$i]) == '') ? " \n" : $handler->htmlEncode($lines[$i]);
40 41
					}
				?></pre>
42
			</div>
resurtm committed
43
		</div>
44
	<?php endif; ?>
resurtm committed
45
</li>