ILIAS
Release_3_10_x_branch Revision 61812
|
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 | |
_sizeToString ($size, $long_info=false) | |
Returns the specified file size value in a human friendly form. | |
_lookupSuffix ($a_id) | |
lookup suffix | |
_getDiskSpaceUsed ($a_id) | |
Returns the number of bytes used on the harddisk by the file object with the specified object id. | |
_getDiskSpaceUsedBy ($user_id, $as_string=false) | |
Returns the number of bytes used on the harddisk by the user with the specified user id. | |
_lookupVersion ($a_id) | |
lookup version | |
_lookupFileSize ($a_id, $a_as_string=false) | |
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, $a_as_string=false, $long_info=false) |
Quickly looks up the file size from the database. | |
static | _lookupFileSizeFromFilesystem ($a_id, $a_as_string=false, $long_info=false) |
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 Private 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 378 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 73 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().
ilObjFileAccess::_getDiskSpaceUsed | ( | $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 260 of file class.ilObjFileAccess.php.
References $dir, and ilUtil\dirsize().
Referenced by _getDiskSpaceUsedBy().
ilObjFileAccess::_getDiskSpaceUsedBy | ( | $user_id, | |
$as_string = false |
|||
) |
Returns the number of bytes used on the harddisk by the user with the specified user id.
int | user id. |
Definition at line 273 of file class.ilObjFileAccess.php.
References $lng, $size, _getDiskSpaceUsed(), _sizeToString(), and DB_FETCHMODE_ASSOC.
|
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 321 of file class.ilObjFileAccess.php.
Referenced by _appendNumberOfCopyToFilename(), _isFileInline(), _lookupSuffix(), ilObjFile\getFileExtension(), ilObjFileListGUI\getProperties(), ilObjFileGUI\saveObject(), and ilObjFileGUI\updateObject().
|
static |
Returns true, if a file with the specified name, is usually hidden from the user.
Definition at line 342 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 296 of file class.ilObjFileAccess.php.
References _getFileExtension().
Referenced by ilObjFileListGUI\getCommandFrame(), ilObjFileListGUI\getIconImageType(), and ilObjFile\isInline().
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 95 of file class.ilObjFileAccess.php.
References DB_FETCHMODE_ASSOC.
Referenced by ilObjFileListGUI\getProperties().
ilObjFileAccess::_lookupFileSize | ( | $a_id, | |
$a_as_string = false |
|||
) |
lookup size
Definition at line 44 of file class.ilObjFileAccess.php.
References $file, $size, _lookupVersion(), and DB_FETCHMODE_OBJECT.
|
static |
Quickly looks up the file size from the database.
Definition at line 123 of file class.ilObjFileAccess.php.
References $size, _sizeToString(), 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 152 of file class.ilObjFileAccess.php.
References $file, $size, _lookupVersion(), _sizeToString(), and DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupSuffix | ( | $a_id | ) |
lookup suffix
Definition at line 239 of file class.ilObjFileAccess.php.
References _getFileExtension(), and DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupVersion | ( | $a_id | ) |
lookup version
Definition at line 30 of file class.ilObjFileAccess.php.
References DB_FETCHMODE_OBJECT.
ilObjFileAccess::_lookupVersion | ( | $a_id | ) |
lookup version
Definition at line 109 of file class.ilObjFileAccess.php.
References DB_FETCHMODE_OBJECT, and ilUtil\stripSlashes().
Referenced by _lookupFileSize(), and _lookupFileSizeFromFilesystem().
ilObjFileAccess::_sizeToString | ( | $size, | |
$long_info = false |
|||
) |
Returns the specified file size value in a human friendly form.
The value returned by this function is the same value that Windows and Mac OS X returns for a file. The value is a GigiBig, MegiBit, KiliBit or byte value based on 1024.
Definition at line 198 of file class.ilObjFileAccess.php.
References $lng, $result, $size, and ilFormat\fmtFloat().
Referenced by ilObjSAHSLearningModuleAccess\_getDiskSpaceUsedBy(), ilObjFileBasedLMAccess\_getDiskSpaceUsedBy(), ilObjMediaCastAccess\_getDiskSpaceUsedBy(), _getDiskSpaceUsedBy(), ilFileDataForum\_getDiskSpaceUsedBy(), ilFileDataMail\_getDiskSpaceUsedBy(), _lookupFileSize(), _lookupFileSizeFromFilesystem(), and ilObjFileListGUI\getProperties().
|
staticprivate |
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.