Class cGuiFileOverview
The class cGuiFileOverview is a cGuiPage displaying files. It is meant to be used but in the left bottom frame. As for now it is used to display HTML, CSS & JS files.
<strong>Usage</strong>
// path to directory where files to display are located $path = $cfgClient[$client]['tpl']['path']; // basename of file to mark as selected $mark = stripslashes($_REQUEST['file']); // build page to display files $page = new cGuiFileOverview($path, $mark, 'html'); // optionally set extension(s) to filter files $page->setFileExtension(array('html', 'tpl')); // render page $page->render();
<strong>Directory</strong> Only files in the directory defined by the given path are displayed.
<strong>Extension</strong> If set via setFileExtension(array) only files of the given extensions are displayed. By default all extensions are considered.
<strong>Order of files</strong> The files to be displayed are sorted alphabetically.
<strong>Marking files</strong> When initializing the class the name of a file to mark can be given. This feature is totally optional.
<strong>Additional file information</strong> When initializing the class the name of a file information type to display can be given. This feature is totally optional.
- cGuiPage
- cGuiFileOverview
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Mischa Holz
Todo: This feature does not work at the moment. <strong>Template</strong> This class is bound to the template generic_file_overview in a hardcoded manner (template,generic_file_overview.html).
Todo: This prevents this class to be used with other views. <strong>Editing a file</strong> When editing a file
- the right top frame is opened with the URL: main.php ?area={AREA} &frame=3 &file={FILENAME} &contenido=1
- whereas the right bottom frame is opened with the URL: main.php ?area={AREA} &frame=4 &action={ACTION} &file={FILENAME} &tmp_file={FILENAME} &contenido=1
Todo: Why the parameter contenido is set to 1 is to be clarified. IMHO it should be the current value of the global contenido variable.
Todo: Why the parameter file and tmp_file are both set is to be clarified. <strong>Deleting a file</strong> A delete icon is provided for each file. When deleting a file
- the right bottom frame is opened with the URL: main.php ?area={AREA} &action={ACTION} &frame=4 &delfile={FILENAME}
Todo: Why the parameter contenido is not set is to be clarified.
Todo: Why the URL is generated via JS is to be clarified. If the effective setting client/readonly is "true" or the current user has no privileges for the action $area . "_delete" of the current area this icon will be inactive though.
Todo: This prevents this class to be used in other areas.
Located at classes/gui/class.fileoverview.php
public
|
#
__construct( string $dir, string $markedFile = '', string $fileInfoType = '' )
Constructor to create an instance of this class. |
public
|
#
setFileExtension( array|string $extension )
Sets extension(s) to filter files that should be displayed. |
public
string|
|
protected
string
|
$_directory |
|
#
Path to the directory directory where files to display are located. |
protected
string
|
$_markedFile |
|
#
Basename of file that will be marked as selected. |
protected
string
|
$_fileInfoType |
|
#
Type of additional file information that should be displayed as description. |
protected
string
|
$_fileExtension |
|
#
Selected file extension. |
$_abort,
$_bodyClassNames,
$_contentTemplate,
$_error,
$_filesDirectory,
$_info,
$_markScript,
$_metaTags,
$_objects,
$_ok,
$_pageBase,
$_pageName,
$_pageTemplate,
$_pluginName,
$_scripts,
$_skipTemplateCheck,
$_styles,
$_subnav,
$_warning
|