Location: PHPKode > scripts > File Display > file-display/manual.txt
*****   Manual for FileDisplayClass   *****

Note: This information used to be contained in the FileDisplayClass.inc.php

	Change Log
	*** added 15th Nov 2003 ***
	$extallow - A comma delimited string of file extensions that are permitted
	to be displayed.  By setting this to "", all files will be displayed.
	NB. Take care with extensions such as jpg & jpeg - both variations must be
	included in the string.  The comparison is case insensitive so as far as case,
	anything goes.
	*** changed 30th Dec 2003
	Radical changes to methods, small bug fixes and general clean-up.  
	Put filesystem data into an array and display is now sorted according to
	type, filename and size.  Now uses more system overhead, but results are nice!
	-Eliminated PrintFolderInfo method.  The same job is now done by the PrintFileInfo
	+Added aasort method (see below for origin of this method)
	+Added maketablecell method - To eliminate repetetive html and make the class easier
	to read.
	+Added make tableheader method - For the same reason as
	+Added arrsortkeys member variable - used by aasort()

	Public Properties

	These properties may be referenced directly from your scripts
	$rootdir - The default start directory
	$showsize - Display a column showing file size.  Options: true/false
	$showtype - Display a column showing file type.  Options: true/false
	$showmodified - Display a column showing date last modified.  Options: true/false

	Private Properties
	These properties should not be accessed directly from your scripts
	$colnum - Calculates the total number of columns for the table based on other variables.
	$arrsortkeys - Array of keys on which to sort by.

	Public Methods
	FileDisplay( $rootdir)
	This function sets the root directory.  The $rootdir string is optional.
	showContents( $targetdir )
	This function shows the contents of the target directory ($targetdir)
	If not specified, the root directory is shown.
	This function just makes the column headers and opens and close the table.
	In between, it calls the getDirContents method.
	Private Methods
	getDirContents($docroot, $targetdir)
	This function loops through the contents of the directory. 
	Writes a table row with file information.

	This is so the colspan html tags have the correct values depending on which
	columns are chosen. 
	A brilliant function for sorting multi-dimensional associative arrays.
	Borrowed from http://www.zend.com/codex.php?id=501&single=1
	Converts the output from the fileperms function to a more readable Unix (?) style
	permissions string.
  	function convertFileSize($inbytes)
  	Formats the output of the filesize function.
  	function checkext($inputstr)
  	Checks the extension to see if the file is permitted.
  	See the explanation for $extallow above for more details.
  	function dirlinks($indirlinks) *** added 15th Nov 2003 ***
  	Takes the directory path and returns a string in html which includes hyperlinks
  	to each directory in the path string (displayed where it says 'current directory').
	function selectfileicon($inputstr) 	
	Based on the file extension, this function chooses an appropriate icon.
	To add different file types, just uncomment the commented code in the switch
	and repeat for however many different icons you have.	

Return current item: File Display