Added getListedPath() function and used it to set the page header

This commit is contained in:
Chris Kankiewicz
2012-02-05 22:14:43 -07:00
parent d1a6522877
commit 8075b251a2
2 changed files with 22 additions and 3 deletions

View File

@@ -1,8 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php include('resources/DirectoryLister.php'); $lister = new DirectoryLister(); ?>
<head>
<title>Directory listing of &lt;DIRECTORY&gt;</title>
<title>Directory listing of <?php echo $lister->getListedPath(); ?></title>
<link rel="shortcut icon" href="resources/img/icons/folder.png" />
<link rel="stylesheet" type="text/css" href="resources/css/bootstrap.min.css" />
@@ -17,8 +19,6 @@
<body>
<?php include('resources/DirectoryLister.php'); $lister = new DirectoryLister(); ?>
<div class="container">
<div class="breadcrumb-wrapper">

View File

@@ -200,6 +200,25 @@ class DirectoryLister {
// Return the breadcrumb array
return $breadcrumbsArray;
}
/**
* Gets path of the listed directory
*
* @return string Pat of the listed directory
* @acces public
*/
public function getListedPath() {
// Build the path
if ($this->_directory == '.') {
$path = $this->_appURL;
} else {
$path = $this->_appURL . $this->_directory;
}
// Return the path
return $path;
}
/**