ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
frame_code.html.php
Go to the documentation of this file.
1<?php /* Display a code block for all frames in the stack.
2 * @todo: This should PROBABLY be done on-demand, lest
3 * we get 200 frames to process. */ ?>
4<div class="frame-code-container <?php echo (!$has_frames ? 'empty' : '') ?>">
5 <?php foreach ($frames as $i => $frame): ?>
6 <?php $line = $frame->getLine(); ?>
7 <div class="frame-code <?php echo ($i == 0 ) ? 'active' : '' ?>" id="frame-code-<?php echo $i ?>">
8 <div class="frame-file">
9 <?php $filePath = $frame->getFile(); ?>
10 <?php if ($filePath && $editorHref = $handler->getEditorHref($filePath, (int) $line)): ?>
11 Open:
12 <a href="<?php echo $editorHref ?>" class="editor-link">
13 <strong><?php echo $tpl->escape($filePath ?: '<#unknown>') ?></strong>
14 </a>
15 <?php else: ?>
16 <strong><?php echo $tpl->escape($filePath ?: '<#unknown>') ?></strong>
17 <?php endif ?>
18 </div>
19 <?php
20 // Do nothing if there's no line to work off
21 if ($line !== null):
22
23 // the $line is 1-indexed, we nab -1 where needed to account for this
24 $range = $frame->getFileLines($line - 8, 10);
25
26 // getFileLines can return null if there is no source code
27 if ($range):
28 $range = array_map(function ($line) { return empty($line) ? ' ' : $line;}, $range);
29 $start = key($range) + 1;
30 $code = join("\n", $range);
31 ?>
32 <pre class="code-block prettyprint linenums:<?php echo $start ?>"><?php echo $tpl->escape($code) ?></pre>
33 <?php endif ?>
34 <?php endif ?>
35
36 <?php
37 // Append comments for this frame
38 $comments = $frame->getComments();
39 ?>
40 <div class="frame-comments <?php echo empty($comments) ? 'empty' : '' ?>">
41 <?php foreach ($comments as $commentNo => $comment): ?>
42 <?php extract($comment) ?>
43 <div class="frame-comment" id="comment-<?php echo $i . '-' . $commentNo ?>">
44 <span class="frame-comment-context"><?php echo $tpl->escape($context) ?></span>
45 <?php echo $tpl->escapeButPreserveUris($comment) ?>
46 </div>
47 <?php endforeach ?>
48 </div>
49
50 </div>
51 <?php endforeach ?>
52</div>
global $tpl
Definition: ilias.php:8
$comment
Definition: buildRTE.php:83
$code
Definition: example_050.php:99