Skip to content

Commit

Permalink
Mostly documentation updates... also changed some functions access.
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed May 9, 2013
1 parent 93977c0 commit 0b1b2e5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 34 deletions.
2 changes: 0 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@
} else {
die('ERROR: Failed to initialize theme');
}

?>
76 changes: 44 additions & 32 deletions resources/DirectoryLister.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public function __construct() {
* Creates the directory listing and returns the formatted XHTML
*
* @param string $path Relative path of directory to list
* @return array Array of directory being listed
* @access public
*/
public function listDirectory($directory) {

Expand All @@ -83,9 +85,10 @@ public function listDirectory($directory) {


/**
* Description...
* Parses and returns an array of breadcrumbs
*
* @param string $directory Path to be breadcrumbified
* @return array Array of breadcrumbs
* @access public
*/
public function listBreadcrumbs($directory = null) {
Expand Down Expand Up @@ -139,10 +142,10 @@ public function listBreadcrumbs($directory = null) {


/**
* Gets path of the listed directory
* Get path of the listed directory
*
* @return string Pat of the listed directory
* @acces public
* @return string Path of the listed directory
* @access public
*/
public function getListedPath() {

Expand All @@ -161,17 +164,20 @@ public function getListedPath() {
/**
* Returns the theme name.
*
* @return string Theme name
* @access public
*/
public function getThemeName() {
// Return the theme name
return $this->_config['theme_name'];
}


/**
* Returns the path to the chosen theme directory.
* Returns the path to the chosen theme directory
*
* @param bool $absolute Wether or not the path returned is absolute (default = false).
* @return string Path to theme
* @access public
*/
public function getThemePath($absolute = false) {
Expand All @@ -191,9 +197,9 @@ public function getThemePath($absolute = false) {


/**
* Get an array of error messages or false when empty.
* Get an array of error messages or false when empty
*
* @return array Array of error messages
* @return array|bool Array of error messages or false
* @access public
*/
public function getSystemMessages() {
Expand All @@ -209,7 +215,7 @@ public function getSystemMessages() {
* Returns array of file hash values
*
* @param string $path Path to file
* @return string Array of file hashes
* @return array Array of file hashes
* @access public
*/
public function getFileHash($filePath) {
Expand Down Expand Up @@ -248,13 +254,16 @@ public function getFileHash($filePath) {
* Set directory path variable
*
* @param string $path Path to directory
* @return string Sanitizd path to directory
* @access public
*/
public function setDirectoryPath($path = null) {

// Set the directory global variable
$this->_directory = $this->_setDirecoryPath($path);

return $this->_directory;

}


Expand All @@ -263,6 +272,7 @@ public function setDirectoryPath($path = null) {
*
* @param string $type The type of message (ie - error, success, notice, etc.)
* @param string $message The message to be displayed to the user
* @return bool true on success
* @access public
*/
public function setSystemMessage($type, $text) {
Expand All @@ -285,10 +295,11 @@ public function setSystemMessage($type, $text) {
/**
* Validates and returns the directory path
*
* @param string @dir Directory path
* @return string Directory path to be listed
* @access private
* @access protected
*/
private function _setDirecoryPath($dir) {
protected function _setDirecoryPath($dir) {

// Check for an empty variable
if (empty($dir) || $dir == '.') {
Expand Down Expand Up @@ -345,10 +356,12 @@ private function _setDirecoryPath($dir) {
* Loop through directory and return array with file info, including
* file path, size, modification time, icon and sort order.
*
* @return array An array of the directory contents
* @access private
* @param string $directory Directory path
* @param @sort Sort method (default = natcase)
* @return array Array of the directory contents
* @access protected
*/
private function _readDirectory($directory, $sort = 'natcase') {
protected function _readDirectory($directory, $sort = 'natcase') {

// Initialize array
$directoryArray = array();
Expand Down Expand Up @@ -449,15 +462,15 @@ private function _readDirectory($directory, $sort = 'natcase') {


/**
* Sorts an array by the provided sort method.
*
* @param array $array Array to be sorted
* @param string $sort Sorting method (acceptable inputs: natsort, natcasesort, etc.)
* @param boolen $reverse Reverse the sorted array order (default = false)
* @return array
* @access private
*/
private function _arraySort($array, $sortMethod, $reverse = false) {
* Sorts an array by the provided sort method.
*
* @param array $array Array to be sorted
* @param string $sortMethod Sorting method (acceptable inputs: natsort, natcasesort, etc.)
* @param boolen $reverse Reverse the sorted array order if true (default = false)
* @return array
* @access protected
*/
protected function _arraySort($array, $sortMethod, $reverse = false) {
// Create empty arrays
$sortedArray = array();
$finalArray = array();
Expand Down Expand Up @@ -549,12 +562,13 @@ private function _arraySort($array, $sortMethod, $reverse = false) {


/**
* Determines if a file is supposed to be hidden
* Determines if a file is specified as hidden
*
* @param string $filePath Path to be checked if hidden
* @access private
* @param string $filePath Path to file to be checked if hidden
* @return boolean Returns true if file is in hidden array, false if not
* @access protected
*/
private function _isHidden($filePath) {
protected function _isHidden($filePath) {

// Define the OS specific directory separator
if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
Expand Down Expand Up @@ -601,9 +615,9 @@ private function _isHidden($filePath) {
* Builds the root application URL from server variables.
*
* @return string The application URL
* @access private
* @access protected
*/
private function _getAppUrl() {
protected function _getAppUrl() {

// Get the server protocol
if (!empty($_SERVER['HTTPS'])) {
Expand Down Expand Up @@ -643,9 +657,9 @@ private function _getAppUrl() {
* @param string $fromPath Starting path
* @param string $toPath Ending path
* @return string $relativePath Relative path from $fromPath to $toPath
* @access private
* @access protected
*/
private function _getRelativePath($fromPath, $toPath) {
protected function _getRelativePath($fromPath, $toPath) {

// Define the OS specific directory separator
if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
Expand Down Expand Up @@ -718,5 +732,3 @@ private function _getRelativePath($fromPath, $toPath) {
}

}

?>

0 comments on commit 0b1b2e5

Please sign in to comment.