2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-24 06:22:15 +00:00
Files
website/common/code/boost_display_dir.php
Daniel James d810ac06b2 Move display_template into BoostArchives.
Also remove 'template' from $params.
2014-08-07 20:34:31 +01:00

31 lines
818 B
PHP

<?php
// Not strictly a filter, but needs some of the members.
class BoostDisplayDir extends BoostFilters
{
function display($dir) {
$handle = opendir($dir);
$title = html_encode("Index listing for {$this->params['key']}");
$this->title = $title;
$this->params['noindex'] = true;
$content = "<h3>$title</h3>\n<ul>\n";
while (($file = readdir($handle)) !== false)
{
if (substr($file, 0, 1) == '.') continue;
if (is_dir("$dir$file")) $file .= '/';
$file = html_encode($file);
$content .= "<li><a rel='nofollow' href='$file'>$file</a></li>\n";
}
$content .= "</ul>\n";
$this->params['content'] = $content;
$this->display_template($this->template_params($content));
}
}