Skip to content

Commit

Permalink
Added getListedPath() function and used it to set the page header
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Feb 6, 2012
1 parent d1a6522 commit 8075b25
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -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" />
Expand All @@ -17,8 +19,6 @@

<body>

<?php include('resources/DirectoryLister.php'); $lister = new DirectoryLister(); ?>

<div class="container">

<div class="breadcrumb-wrapper">
Expand Down
19 changes: 19 additions & 0 deletions resources/DirectoryLister.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,25 @@ public function listBreadcrumbs($directory = NULL) {
// 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;
}


/**
Expand Down

0 comments on commit 8075b25

Please sign in to comment.