2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-19 16:52:15 +00:00
Files
website/common/code/boost_display_dir.php
Daniel James d74bcf2a29 Use BoostDocumentation instead of BoostFilterData
Move some of BoostFilterData's member into BoostFilter.
2016-11-30 01:30:36 +00:00

32 lines
846 B
PHP

<?php
// Not strictly a filter, but needs some of the members.
class BoostDisplayDir extends BoostFilter
{
function __construct($data, $dir) {
$handle = opendir($dir);
$title = html_encode("Index listing for {$data->path}");
$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";
parent::__construct($data, $content);
$this->title = $title;
$this->noindex = true;
}
function display() {
$this->display_template($this->template_params($this->content));
}
}