Maxscape::DirectoryTree Package
Member Functions
- changeFile
- checkDoubleDot
- checkFileName
- copyFile
- createFile
- createFolder
- displayDirectories
- displayDirectoryTree
- displayFile
- displayPath
- escapeTextAreaBug
- execFormInContext
- execHREFinContext
- FileExtension
- getNodeContents
- Message
- new
- printFile
- removeFile
- removeFolder
- renameFile
- setDisplay
- showFile
- showMessage
- unescapeTextAreaBug
Synopsis
use Maxscape::DirectoryTree;
Description
The Maxscape::DirectoryTree package provides an interface to the file system of the server.
new
Synopsis
use Maxscape::DirectoryTree; my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot, PathLinkTrailor => qq%/%, FontSize => $Page->{Layout}{SmallFontSize}, );
Examples
Description
Creates a new '$DirectoryTree' object.
Message
Synopsis
my $Message = $DirectoryTree->Message ('MessageId', $Parameter, '...');
Description
Returns a message, depending on the supported languages.
Examples
my $Message = $DirectoryTree->Message ('FileCreated', $FileName);
showMessage
Synopsis
my $Text = $DirectoryTree->showMessage ();
Description
Display a message from a member function.
Examples
$Text .= $DirectoryTree->showMessage ();
checkDoubleDot
Synopsis
my $realPath = $DirectoryTree->checkDoubleDot ($Path);
Description
Checks if a file/directory path contains a double dot '..'. Returns an empty string, if a double dot is found.
Examples
my $realPath = $DirectoryTree->checkDoubleDot ($Path); # return '' on error
checkFileName
Synopsis
my $Text = $DirectoryTree->name=checkFileName ($Filename);
Description
Checks a file name for allowed characters.
Examples
$DirectoryTree->checkFileName (FileName => "File");
createFile
Synopsis
my $Text = $DirectoryTree->createFile (FileName => 'foo');
Description
Creates a file.
Examples
showFile
Synopsis
my $Text = $DirectoryTree->showFile ($Filename);
Description
Retruns the content of a file, escaping ${::TEXTAREA} HTML tags.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, ); $Text .= $DirectoryTree->showFile (FileName => 'someFile');
changeFile
Synopsis
my $Text = $DirectoryTree->changeFile ($Filename);
Description
Changes a file's content.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, ); $Text .= $DirectoryTree->changeFile (FileName => $Directory);
renameFile
Synopsis
my $Text = $DirectoryTree->renameFile ($Filename);
Description
Renames a file.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, PathLinkTrailor => qq%/%, FontSize => $Page->{Layout}{SmallFontSize},); $Text .= $DirectoryTree->renameFile (FileName => $Directory);
copyFile
Synopsis
my $Text = $DirectoryTree->copyFile ($Filename);
Description
Copies a file.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, ); $Text .= $DirectoryTree->copyFile (FileName => 'file', 'newfile');
removeFile
Synopsis
my $Text = $DirectoryTree->removeFile ($Filename);
Description
Removes a file.
Examples
$Text = $DirectoryTree->removeFile (FileName => $Directory);
createFolder
Synopsis
my $Text = $DirectoryTree->createFolder ($Filename);
Description
Creates a folder.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, PathLinkTrailor => qq%/%, FontSize => $Page->{Layout}{SmallFontSize},); $Text .= $DirectoryTree->createFolder (FileName => $Directory);
removeFolder
Synopsis
my $Text = $DirectoryTree->removeFolder ($Filename);
Description
Removes a folder.
Examples
my $DirectoryTree = Maxscape::DirectoryTree->new ( DocumentRoot => $DocumentRoot . $currentPath, ); $Text .= $DirectoryTree->removeFolder (FileName => $Directory);
displayDirectories
Synopsis
my $Text = $DirectoryTree->displayDirectories ( %P );
Description
Displays the sub-directores relative to a root directory with a given display depth.
Examples
displayDirectoryTree
Synopsis
my $Text = $DirectoryTree->displayDirectoryTree ( ... );
Description
Displays the sub-directores relative to a root directory with a given display depth.
Examples
getNodeContents
Synopsis
my $Text = $DirectoryTree->getNodeContents ();
Description
Gets the content of the current directory.
Examples
displayFile
Synopsis
my $Text = $DirectoryTree->displayFile ( $File );
Description
Displays a file by its mime type and the provided file node callbacks.
Examples
FileExtension
Synopsis
my $Extension = $DirectoryTree->FileExtension ($FileName);
Description
Returns the file extension.
Examples
displayPath
Synopsis
my $Path = $DirectoryTree->displayPath ( RootPathName => '/Home/', RootPathFolderImage => 'folder.open.gif', );
Description
Displays the current path.
Examples
execHREFinContext
Synopsis
my $Text = $DirectoryTree->execHREFinContext ( ... );
Description
Examples
execFormInContext
Synopsis
my $Text = $DirectoryTree->execFormInContext ( ... );
Description
Examples
escapeTextAreaBug
Synopsis
my $Text = $DirectoryTree->escapeTextAreaBug($Text);
Description
Escapes an HTML '${::TEXTAREA}' tag within a '${::TEXTAREA}' field.
Examples
unescapeTextAreaBug
Synopsis
my $Text = $DirectoryTree->unescapeTextAreaBug($Text);
Description
Unescapes an HTML '${::TEXTAREA}' tag within a '${::TEXTAREA}' field.
Examples
setDisplay
Synopsis
my $Text = $DirectoryTree->setDisplay();
Description
Returns a form to configure the display mode.
Examples
printFile
Synopsis
my $Text = $DirectoryTree->printFile ();
Description
Returns the content of a file.
Examples
$Text = $DirectoryTree->printFile ({ type => 'text/plain', # 'text/html', File' => "$CategoryName/$PageName", });