Commit a1beb9ee authored by Simon Welsh's avatar Simon Welsh

Consistent namespacing of the tags

git-svn-id: svn+ssh://lsgn/var/logbot-www@60 5f99df0c-6b0a-442a-b40a-040688e84a9d
parent 9b45f77d
<?php
require 'xhp/init.php';
require 'tags/calendar.php';
require 'tags/document.php';
require 'tags/foot.php';
require 'tags/form.php';
require 'tags/head.php';
......
......@@ -15,11 +15,11 @@ if(isset($_GET['date']) && preg_match('#^20[0-9]{2}-[01][0-9]-[0-3][0-9]$#', $_G
$day = date('j', $time);
if(isset($dates[$year][$month][$day])) {
$head = <log:head robots="index,nofollow" />;
$body->appendChild(<log:info>
$head = <logs:head robots="index,nofollow" />;
$body->appendChild(<logs:info>
<h2>IRC log for {date('j F Y', $time)}</h2>
<a href="index.php">Index</a>
</log:info>);
</logs:info>);
$body->appendChild(<logs:timezone />);
......@@ -32,29 +32,21 @@ if(isset($_GET['date']) && preg_match('#^20[0-9]{2}-[01][0-9]-[0-3][0-9]$#', $_G
header('Location: index.php');
exit;
} else {
$head = <log:head />;
$head = <logs:head />;
if(count($dates) > 1) {
$body->appendChild(<log:info>
<log:years years={array_keys($dates)} />
</log:info>);
$body->appendChild(<logs:info>
<logs:years years={array_keys($dates)} />
</logs:info>);
} else {
$body->appendChild(<log:info />);
$body->appendChild(<logs:info />);
}
$thisMonth = mktime(0, 0, 0, date('n'), 1, date('Y'));
foreach($dates as $year => $months) {
$body->appendChild(<log:year year={$year} months={$months} />);
$body->appendChild(<logs:year year={$year} months={$months} />);
}
}
$foot = <log:foot />;
echo <x:doctype><html>
{$head}
<body>
{$body}
{$foot}
</body>
</html></x:doctype>;
echo <logs:document head={$head} body={$body} />;
......@@ -9,7 +9,7 @@ if(empty($_GET['q']) || !trim($_GET['q'])) {
exit;
}
$head = <log:head robots="noindex,nofollow" />;
$head = <logs:head robots="noindex,nofollow" />;
$term = $_GET['q'];
$order = isset($_GET['s']) ? $_GET['s'] : null;
......@@ -29,10 +29,10 @@ if($order) {
$header->appendChild(strtolower($order));
}
$body->appendChild(<log:info>
$body->appendChild(<logs:info>
{$header}
<a href="index.php">Index</a>
</log:info>);
</logs:info>);
$body->appendChild(<logs:timezone />);
if(empty($results)) {
......@@ -46,12 +46,4 @@ if(empty($results)) {
$body->appendChild(<logs:logs logs={$results} format={['d/m/Y H:i:s', 'd/m/Y H:i']} />);
}
$foot = <log:foot />;
echo <x:doctype><html>
{$head}
<body>
{$body}
{$foot}
</body>
</html></x:doctype>;
echo <logs:document head={$head} body={$body} />;
<?php
class :log:calendar extends :x:element {
class :logs:calendar extends :x:element {
attribute
int year @required,
string month @required,
......
<?php
class :logs:document extends :x:element {
attribute
xhp_logs__head head @required,
xhp_x__base body @required;
protected function render() {
return <x:doctype>
<html>
{$this->getAttribute('head')}
<body>
{$this->getAttribute('body')}
<logs:foot />
</body>
</html>
</x:doctype>;
}
}
<?php
class :log:foot extends :x:element {
class :logs:foot extends :x:element {
attribute
string nick = 'ss-log',
string channel = '#silverstripe',
......
<?php
class :log:search extends :x:element {
class :logs:search extends :x:element {
protected function render() {
$val = isset($_GET['q']) ? $_GET['q'] : '';
return <form id="searchform" method="get" action="search.php">
......
<?php
class :log:head extends :x:element {
class :logs:head extends :x:element {
attribute
string channel = '#silverstripe',
string server = 'irc.freenode.net',
......
<?php
class :log:info extends :x:element {
class :logs:info extends :x:element {
attribute string channel = '#silverstripe';
protected function render() {
$div = <div class="info">
<h1>{$this->getAttribute('channel')} IRC Log</h1>
<log:search />
<logs:search />
</div>;
$div->appendChild($this->getChildren());
return $div;
......
<?php
class :log:month extends :x:element {
class :logs:month extends :x:element {
attribute
int year @required,
string month @required,
......@@ -13,7 +13,7 @@ class :log:month extends :x:element {
return <div class="month">
<h4><a name={$year . '_' . $month}>{$month}</a></h4>
<log:calendar month={$month} year={$year} days={$days} />
<logs:calendar month={$month} year={$year} days={$days} />
</div>;
}
}
<?php
class :log:year extends :x:element {
class :logs:year extends :x:element {
attribute
int year @required,
array months @required;
......@@ -24,7 +24,7 @@ class :log:year extends :x:element {
</div>;
foreach($months as $month => $days) {
$div->appendChild(<log:month year={$year} month={$month} days={$days} />);
$div->appendChild(<logs:month year={$year} month={$month} days={$days} />);
}
$div->appendChild(<div class="clear"> </div>);
......
<?php
class :log:years extends :x:element {
class :logs:years extends :x:element {
attribute array years;
protected function render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment