Start moving some stuff over to the new template layout

This commit is contained in:
filp
2013-06-25 00:06:07 +01:00
parent ad7e219076
commit 517340f9bf
3 changed files with 36 additions and 26 deletions
+15 -4
View File
@@ -127,10 +127,21 @@ class PrettyPageHandler extends Handler
// Add extra entries list of data tables:
$v->tables = array_merge($extraTables, $v->tables);
// Temp:
$vars["e"] = array($helper, "escape");
$vars["slug"] = array($helper, "slug");
$vars["v"] = $v;
$vars = array(
// Backwards-compatibility:
"v" => $v,
"page_title" => $this->getPageTitle(),
// Todo: asset compiler
"stylesheet" => file_get_contents($cssFile),
// Template paths:
"frames_list" => $this->getResource("views/frames_list.php"),
"slug" => array($helper, "slug"),
"e" => array($helper, "escape")
);
$helper->render($templateFile, $vars);
@@ -0,0 +1,17 @@
<?php /* List file names & line numbers for all stack frames;
clicking these links/buttons will display the code view
for that particular frame */ ?>
<?php foreach($v->frames as $i => $frame): ?>
<div class="frame <?php echo ($i == 0 ? 'active' : '') ?>" id="frame-line-<?php echo $i ?>">
<div class="frame-method-info">
<span class="frame-index"><?php echo (count($v->frames) - $i - 1) ?>.</span>
<span class="frame-class"><?php echo $e($frame->getClass() ?: '') ?></span>
<span class="frame-function"><?php echo $e($frame->getFunction() ?: '') ?></span>
</div>
<span class="frame-file">
<?php echo ($frame->getFile(true) ?: '<#unknown>') ?><!--
--><span class="frame-line"><?php echo (int) $frame->getLine() ?></span>
</span>
</div>
<?php endforeach ?>
+4 -22
View File
@@ -10,9 +10,9 @@
<html>
<head>
<meta charset="utf-8">
<title><?php echo $e($v->title) ?></title>
<title><?php echo $tpl->escape($page_title) ?></title>
<style><?php echo $v->pageStyle ?></style>
<style><?php echo $stylesheet ?></style>
</head>
<body>
<div class="container">
@@ -20,27 +20,9 @@
<div class="stack-container">
<div class="frames-container cf <?php echo (!$v->hasFrames ? 'empty' : '') ?>">
<?php /* List file names & line numbers for all stack frames;
clicking these links/buttons will display the code view
for that particular frame */ ?>
<?php foreach($v->frames as $i => $frame): ?>
<div class="frame <?php echo ($i == 0 ? 'active' : '') ?>" id="frame-line-<?php echo $i ?>">
<div class="frame-method-info">
<span class="frame-index"><?php echo (count($v->frames) - $i - 1) ?>.</span>
<span class="frame-class"><?php echo $e($frame->getClass() ?: '') ?></span>
<span class="frame-function"><?php echo $e($frame->getFunction() ?: '') ?></span>
</div>
<span class="frame-file">
<?php echo ($frame->getFile(true) ?: '<#unknown>') ?><!--
--><span class="frame-line"><?php echo (int) $frame->getLine() ?></span>
</span>
</div>
<?php endforeach ?>
<?php $tpl->render($frames_list, array( "v" => $v, "slug" => $slug, "e" => $e)) ?>
</div>
<div class="details-container cf">
<header>