ILIAS
Release_4_0_x_branch Revision 61816
|
Access class for file objects. More...
Public Member Functions | |
_getCommands () | |
get commands | |
_checkGoto ($a_target) | |
check whether goto script will succeed | |
_lookupFileData ($a_id) | |
looks up the file_data for the file object with the specified object id | |
_lookupVersion ($a_id) | |
lookup version | |
_lookupSuffix ($a_id) | |
lookup suffix | |
_lookupDiskUsage ($a_id) | |
Returns the number of bytes used on the harddisk by the file object with the specified object id. | |
_lookupVersion ($a_id) | |
lookup version | |
_lookupFileSize ($a_id) | |
lookup size | |
Public Member Functions inherited from ilObjectAccess | |
_checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="") | |
Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) | |
_checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id=0) | |
check condition |
Static Public Member Functions | |
static | _lookupFileSize ($a_id) |
Quickly looks up the file size from the database and returns the number of bytes. | |
static | _lookupFileSizeFromFilesystem ($a_id) |
Looks up the file size by retrieving it from the filesystem. | |
static | _isFileInline ($a_file_name) |
Returns true, if the specified file shall be displayed inline in the browser. | |
static | _getFileExtension ($a_file_name) |
Gets the file extension of the specified file name. | |
static | _isFileHidden ($a_file_name) |
Returns true, if a file with the specified name, is usually hidden from the user. | |
static | _appendNumberOfCopyToFilename ($a_file_name, $nth_copy=null) |
Appends the text " - Copy" to a filename in the language of the current user. |
Static Protected Attributes | |
static | $_inlineFileExtensionsArray |
Contains an array of extensions separated by space. |
Access class for file objects.
Definition at line 34 of file class.ilObjFileAccess.php.
|
static |
Appends the text " - Copy" to a filename in the language of the current user.
If the provided $nth_copy parameter is greater than 1, then is appended in round brackets. If $nth_copy parameter is null, then the function determines the copy number on its own.
If this function detects, that the filename already ends with " - Copy", or with "- Copy ($nth_copy), it only appends the number of the copy to the filename.
This function retains the extension of the filename.
Examples:
Definition at line 288 of file class.ilObjFileAccess.php.
References $lng, and _getFileExtension().
Referenced by ilObject\appendCopyInfo(), and ilContainerGUI\pasteObject().
ilObjFileAccess::_checkGoto | ( | $a_target | ) |
check whether goto script will succeed
Reimplemented from ilObjectAccess.
Definition at line 72 of file class.ilObjFileAccess.php.
ilObjFileAccess::_getCommands | ( | ) |
get commands
this method returns an array of all possible commands/permission combinations
example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );
Reimplemented from ilObjectAccess.
Definition at line 59 of file class.ilObjFileAccess.php.
Referenced by ilObjFileListGUI\init().
|
static |
Gets the file extension of the specified file name.
The file name extension is converted to lower case before it is returned.
For example, for the file name "HELLO.MP3", this function returns "mp3".
A file name extension can have multiple parts. For the file name "hello.tar.gz", this function returns "gz".
string | $a_file_name | The file name |
Definition at line 231 of file class.ilObjFileAccess.php.
Referenced by _appendNumberOfCopyToFilename(), _isFileInline(), _lookupSuffix(), ilObjFile\checkFileExtension(), ilObjFile\getFileExtension(), ilObjFileListGUI\getProperties(), and ilObjFileGUI\saveObject().
|
static |
Returns true, if a file with the specified name, is usually hidden from the user.
Definition at line 252 of file class.ilObjFileAccess.php.
Referenced by ilCourseContentGUI\displayRow(), ilContainer\getSubItems(), and ilObjFile\isHidden().
|
static |
Returns true, if the specified file shall be displayed inline in the browser.
Definition at line 208 of file class.ilObjFileAccess.php.
References _getFileExtension().
Referenced by ilObjFileListGUI\getCommandFrame(), ilObjFileListGUI\getIconImageType(), and ilObjFile\isInline().
ilObjFileAccess::_lookupDiskUsage | ( | $a_id | ) |
Returns the number of bytes used on the harddisk by the file object with the specified object id.
int | object id of a file object. |
Definition at line 196 of file class.ilObjFileAccess.php.
References $dir, and ilUtil\dirsize().
Referenced by ilObjFile\getDiskUsage().
ilObjFileAccess::_lookupFileData | ( | $a_id | ) |
looks up the file_data for the file object with the specified object id
as an associative array.
Definition at line 94 of file class.ilObjFileAccess.php.
References $ilDB, $q, $row, and DB_FETCHMODE_ASSOC.
Referenced by ilObjFileListGUI\getProperties().
ilObjFileAccess::_lookupFileSize | ( | $a_id | ) |
lookup size
Definition at line 44 of file class.ilObjFileAccess.php.
References $file, $ilDB, $q, $row, $size, _lookupVersion(), and DB_FETCHMODE_OBJECT.
|
static |
Quickly looks up the file size from the database and returns the number of bytes.
Definition at line 123 of file class.ilObjFileAccess.php.
References $ilDB, $q, $row, $size, and DB_FETCHMODE_OBJECT.
|
static |
Looks up the file size by retrieving it from the filesystem.
This function runs much slower than _lookupFileSize()! Use this function only, to update the data in the database. For example, if the file size in the database has become inconsistent for some reason.
Definition at line 142 of file class.ilObjFileAccess.php.
References $file, $ilDB, $q, $row, $size, _lookupVersion(), and DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupSuffix | ( | $a_id | ) |
lookup suffix
Definition at line 176 of file class.ilObjFileAccess.php.
References $ilDB, $q, $row, _getFileExtension(), and DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupVersion | ( | $a_id | ) |
lookup version
Definition at line 30 of file class.ilObjFileAccess.php.
References $ilDB, $q, $row, and DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupVersion | ( | $a_id | ) |
lookup version
Definition at line 108 of file class.ilObjFileAccess.php.
References $ilDB, $q, $row, DB_FETCHMODE_OBJECT, and ilUtil\stripSlashes().
Referenced by _lookupFileSize(), and _lookupFileSizeFromFilesystem().
|
staticprotected |
Contains an array of extensions separated by space.
Since this array is needed for every file object displayed on a repository page, we only create it once, and cache it here.
Definition at line 43 of file class.ilObjFileAccess.php.