ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
ilObjFile ($a_id=0, $a_call_by_reference=true) | |
Constructor public. | |
create ($a_upload=false) | |
create object | |
createProperties ($a_upload=false) | |
The basic properties of a file object are stored in table object_data. | |
createMetaData () | |
create file object meta data | |
MDUpdateListener ($a_element) | |
Meta data update listener. | |
getDirectory ($a_version=0) | |
createDirectory () | |
raiseUploadError ($a_raise=true) | |
getUploadFile ($a_upload_file, $a_filename) | |
replaceFile ($a_upload_file, $a_filename) | |
replace file with new file | |
addFileVersion ($a_upload_file, $a_filename) | |
copy ($a_source, $a_destination) | |
copy file | |
clearDataDirectory () | |
clear data directory | |
deleteVersions () | |
read () | |
read file properties | |
update () | |
update file | |
updateMetaData () | |
update meta data | |
setFileName ($a_name) | |
set filename | |
getFileName () | |
setFileType ($a_type) | |
getFileType () | |
setFileSize ($a_size) | |
getFileSize () | |
getDiskUsage () | |
Gets the disk usage of the object in bytes. | |
getFile ($a_hist_entry_id=null) | |
setVersion ($a_version) | |
getVersion () | |
setMode ($a_mode) | |
mode is object or filelist | |
getMode () | |
mode is object or filelist | |
_writeFileType ($a_id, $a_format) | |
_lookupFileName ($a_id) | |
_lookupFileSize ($a_id) | |
Lookups the file size of the file in bytes. | |
_lookupVersion ($a_id) | |
lookup version | |
determineFileSize ($a_hist_entry_id=null) | |
Determine File Size. | |
sendFile ($a_hist_entry_id=null) | |
getFileExtension () | |
Returns the extension of the file name converted to lower-case. | |
isInline () | |
Returns true, if this file should be displayed inline in a browser window. | |
isHidden () | |
Returns true, if this file should be hidden in the repository view. | |
guessFileType ($a_file="") | |
Guesses the file type based on the current values returned by getFileType() and getFileExtension(). | |
cloneObject ($a_target_id, $a_copy_id=0) | |
Clone. | |
delete () | |
delete file and all related data | |
export ($a_target_dir) | |
export files of object to target directory note: target directory must be the export target directory, "/objects/il_<inst>_file_<file_id>/..." will be appended to this directory | |
_deleteAllUsages ($a_type, $a_id, $a_usage_hist_nr=0) | |
static delete all usages of | |
_saveUsage ($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0) | |
save usage | |
getUsages () | |
get all usages of file object | |
_getFilesOfObject ($a_type, $a_id, $a_usage_hist_nr=0) | |
get all files of an object | |
getXMLZip () | |
addNewsNotification ($a_lang_var) | |
initFileStorage () | |
init file storage object | |
storeUnzipedFile ($a_upload_file, $a_filename) | |
storeUnzipedFile | |
checkFileExtension ($new_filename, $new_title) | |
Check if the file extension does still exist after an update of the title. | |
Public Member Functions inherited from ilObject | |
ilObject ($a_id=0, $a_reference=true) | |
Constructor public. | |
withReferences () | |
determines wehter objects are referenced or not (got ref ids or not) | |
read ($a_force_db=false) | |
read object data from db into object | |
getId () | |
get object id public | |
setId ($a_id) | |
set object id public | |
setRefId ($a_id) | |
set reference id public | |
getRefId () | |
get reference id public | |
getType () | |
get object type public | |
setType ($a_type) | |
set object type public | |
getPresentationTitle () | |
get presentation title Normally same as title Overwritten for sessions | |
getTitle () | |
get object title public | |
getUntranslatedTitle () | |
get untranslated object title public | |
setTitle ($a_title) | |
set object title | |
getDescription () | |
get object description | |
setDescription ($a_desc) | |
set object description | |
getLongDescription () | |
get object long description (stored in object_description) | |
getImportId () | |
get import id | |
setImportId ($a_import_id) | |
set import id | |
_lookupObjIdByImportId ($a_import_id) | |
getOwner () | |
get object owner | |
getOwnerName () | |
_lookupOwnerName ($a_owner_id) | |
lookup owner name for owner id | |
setOwner ($a_owner) | |
set object owner | |
getCreateDate () | |
get create date public | |
getLastUpdateDate () | |
get last update date public | |
setObjDataRecord ($a_record) | |
set object_data record (note: this method should only be called from the ilObjectFactory class) | |
create () | |
create | |
deleteMetaData () | |
delete meta data entry | |
updateOwner () | |
update owner of object in db | |
_getIdForImportId ($a_import_id) | |
get current object id for import id (static) | |
_getAllReferences ($a_id) | |
get all reference ids of object | |
_lookupOwner ($a_id) | |
lookup object owner | |
_lookupDescription ($a_id) | |
lookup object description | |
_lookupLastUpdate ($a_id, $a_as_string=false) | |
lookup last update | |
_getLastUpdateOfObjects ($a_objs) | |
Get last update for a set of media objects. | |
_setDeletedDate ($a_ref_id) | |
only called in ilTree::saveSubTree | |
_resetDeletedDate ($a_ref_id) | |
only called in ilObjectGUI::insertSavedNodes | |
_lookupDeletedDate ($a_ref_id) | |
only called in ilObjectGUI::insertSavedNodes | |
_writeTitle ($a_obj_id, $a_title) | |
write title to db (static) | |
_writeDescription ($a_obj_id, $a_desc) | |
write description to db (static) | |
_writeImportId ($a_obj_id, $a_import_id) | |
write import id to db (static) | |
_isInTrash ($a_ref_id) | |
checks wether object is in trash | |
_hasUntrashedReference ($a_obj_id) | |
checks wether an object has at least one reference that is not in trash | |
_lookupObjectId ($a_ref_id) | |
lookup object id | |
_getObjectsDataForType ($a_type, $a_omit_trash=false) | |
get all objects of a certain type | |
putInTree ($a_parent_ref) | |
maybe this method should be in tree object!? | |
setPermissions ($a_parent_ref) | |
set permissions of object | |
createReference () | |
creates reference for object | |
countReferences () | |
count references of object | |
initDefaultRoles () | |
init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public | |
createRoleFolder () | |
creates a local role folder | |
notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0) | |
notifys an object about an event occured Based on the event passed, each object may decide how it reacts. | |
setRegisterMode ($a_bool) | |
isUserRegistered ($a_user_id=0) | |
requireRegistration () | |
getHTMLDirectory () | |
appendCopyInfo ($a_target_id, $a_copy_id) | |
Prepend Copy info if object with same name exists in that container. | |
cloneDependencies ($a_target_id, $a_copy_id) | |
Clone object dependencies. | |
cloneMetaData ($target_obj) | |
Copy meta data. |
Static Public Member Functions | |
static | _lookupAbsolutePath ($obj_id, $a_version=null) |
return absolute path for version | |
Static Public Member Functions inherited from ilObject | |
static | _lookupTitle ($a_id) |
lookup object title | |
static | _getIdsForTitle ($title, $type= '', $partialmatch=false) |
static | _lookupObjId ($a_id) |
static | _lookupType ($a_id, $a_reference=false) |
lookup object type | |
_exists ($a_id, $a_reference=false) | |
checks if an object exists in object_data | |
static | _getObjectsByType ($a_obj_type="", $a_owner="") |
Get objects by type. | |
static | _prepareCloneSelection ($a_ref_ids, $new_type) |
Prepare copy wizard object selection. | |
static | _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false) |
Get icon for repository item. |
Data Fields | |
$filename | |
$filetype | |
$filemaxsize = "20000000" | |
$raise_upload_error | |
$mode = "object" | |
Data Fields inherited from ilObject | |
$ilias | |
$lng | |
$id | |
$ref_id | |
$type | |
$title | |
$untranslatedTitle | |
$desc | |
$long_desc | |
$owner | |
$create_date | |
$last_update | |
$import_id | |
$register = false | |
$referenced | |
$objectList | |
$max_title | |
$max_desc | |
$add_dots | |
$obj_data_record | |
object_data record |
Private Attributes | |
$file_storage = null |
Class ilObjFile.
Definition at line 18 of file class.ilObjFile.php.
ilObjFile::_deleteAllUsages | ( | $a_type, | |
$a_id, | |||
$a_usage_hist_nr = 0 |
|||
) |
static delete all usages of
Definition at line 819 of file class.ilObjFile.php.
References $ilDB.
Referenced by ilPageObject\delete(), and ilPageObject\saveFileUsage().
ilObjFile::_getFilesOfObject | ( | $a_type, | |
$a_id, | |||
$a_usage_hist_nr = 0 |
|||
) |
get all files of an object
string | $a_type | object type (e.g. "lm:pg") |
int | $a_id | object id |
Definition at line 878 of file class.ilObjFile.php.
References $ilDB, $q, and $ret.
Referenced by ilObjGlossary\exportHTMLGlossaryTerms(), ilObjContentObject\exportHTMLGlossaryTerms(), ilObjContentObject\exportHTMLPages(), ilPageObject\getLastUpdateOfIncludedElements(), and ilPageObject\update().
|
static |
return absolute path for version
Definition at line 977 of file class.ilObjFile.php.
References $file_storage, $filename, _lookupFileName(), and _lookupVersion().
Referenced by ilObjFolder\recurseFolder().
ilObjFile::_lookupFileName | ( | $a_id | ) |
Definition at line 501 of file class.ilObjFile.php.
References $ilDB, $q, $row, DB_FETCHMODE_OBJECT, and ilUtil\stripSlashes().
Referenced by _lookupAbsolutePath().
ilObjFile::_lookupFileSize | ( | $a_id | ) |
Lookups the file size of the file in bytes.
Definition at line 514 of file class.ilObjFile.php.
Referenced by ilPageObject\addFileSizes(), ilObjFileDAV\getContentLength(), and ilObjFileGUI\infoScreen().
ilObjFile::_lookupVersion | ( | $a_id | ) |
lookup version
Definition at line 523 of file class.ilObjFile.php.
Referenced by _lookupAbsolutePath().
ilObjFile::_saveUsage | ( | $a_mob_id, | |
$a_type, | |||
$a_id, | |||
$a_usage_hist_nr = 0 |
|||
) |
save usage
Definition at line 832 of file class.ilObjFile.php.
References $ilDB.
Referenced by ilPageObject\saveFileUsage().
ilObjFile::_writeFileType | ( | $a_id, | |
$a_format | |||
) |
Definition at line 490 of file class.ilObjFile.php.
References $ilDB, $q, and $res.
Referenced by MDUpdateListener().
ilObjFile::addFileVersion | ( | $a_upload_file, | |
$a_filename | |||
) |
Definition at line 251 of file class.ilObjFile.php.
References ilHistory\_createEntry(), addNewsNotification(), ilObject\getId(), and getUploadFile().
ilObjFile::addNewsNotification | ( | $a_lang_var | ) |
Definition at line 910 of file class.ilObjFile.php.
References ilObject\getDescription(), ilObject\getId(), ilObject\getType(), isHidden(), NEWS_NOTICE, and NEWS_USERS.
Referenced by addFileVersion(), createProperties(), and replaceFile().
ilObjFile::checkFileExtension | ( | $new_filename, | |
$new_title | |||
) |
Check if the file extension does still exist after an update of the title.
Definition at line 995 of file class.ilObjFile.php.
References ilObjFileAccess\_getFileExtension(), and getFileName().
Referenced by MDUpdateListener().
ilObjFile::clearDataDirectory | ( | ) |
clear data directory
Definition at line 278 of file class.ilObjFile.php.
References createDirectory(), ilUtil\delDir(), and getDirectory().
Referenced by deleteVersions().
ilObjFile::cloneObject | ( | $a_target_id, | |
$a_copy_id = 0 |
|||
) |
Clone.
public
int | target id |
int | copy id |
Reimplemented from ilObject.
Definition at line 715 of file class.ilObjFile.php.
References $ilDB, $query, $res, ilHistory\_copyEntriesForObject(), ilObject\cloneMetaData(), getDirectory(), ilObject\getId(), and ilUtil\rCopy().
ilObjFile::copy | ( | $a_source, | |
$a_destination | |||
) |
copy file
Definition at line 270 of file class.ilObjFile.php.
References getDirectory().
ilObjFile::create | ( | $a_upload = false | ) |
create object
bool | upload mode (if enabled no entries in file_data will be done) |
Definition at line 53 of file class.ilObjFile.php.
References ilObject\create(), and createProperties().
ilObjFile::createDirectory | ( | ) |
Definition at line 209 of file class.ilObjFile.php.
References getDirectory(), and ilUtil\makeDirParents().
Referenced by clearDataDirectory().
ilObjFile::createMetaData | ( | ) |
create file object meta data
Reimplemented from ilObject.
Definition at line 117 of file class.ilObjFile.php.
References getFileSize(), getFileType(), ilObject\getId(), and ilObject\getType().
Referenced by createProperties().
ilObjFile::createProperties | ( | $a_upload = false | ) |
The basic properties of a file object are stored in table object_data.
This is not sufficient for a file object. Therefore we create additional properties in table file_data. This method has been put into a separate operation, to allow a WebDAV Null resource (class.ilObjNull.php) to become a file object.
Definition at line 71 of file class.ilObjFile.php.
References $_GET, $ilDB, $q, $res, ilHistory\_createEntry(), ilNewsItem\_getDefaultVisibilityForRefId(), ilBlockSetting\_write(), addNewsNotification(), createMetaData(), getFileName(), getFileSize(), getFileType(), ilObject\getId(), getMode(), and initFileStorage().
Referenced by create().
ilObjFile::delete | ( | ) |
delete file and all related data
public
Reimplemented from ilObject.
Definition at line 753 of file class.ilObjFile.php.
References $ilDB, $q, ilHistory\_removeEntriesForObject(), ilUtil\delDir(), ilObject\deleteMetaData(), getDirectory(), ilObject\getId(), getMode(), and getUsages().
ilObjFile::deleteVersions | ( | ) |
Definition at line 284 of file class.ilObjFile.php.
References $ilDB, ilHistory\_removeEntriesForObject(), clearDataDirectory(), ilObject\getId(), and setVersion().
ilObjFile::determineFileSize | ( | $a_hist_entry_id = null | ) |
Determine File Size.
Definition at line 532 of file class.ilObjFile.php.
References $data, $file, ilHistory\_getEntryByHistoryID(), getDirectory(), getFileName(), getVersion(), and setFileSize().
ilObjFile::export | ( | $a_target_dir | ) |
export files of object to target directory note: target directory must be the export target directory, "/objects/il_<inst>_file_<file_id>/..." will be appended to this directory
string | $a_target_dir | target directory |
Definition at line 801 of file class.ilObjFile.php.
References getDirectory(), ilObject\getId(), getVersion(), ilUtil\makeDir(), and ilUtil\rCopy().
ilObjFile::getDirectory | ( | $a_version = 0 | ) |
Definition at line 190 of file class.ilObjFile.php.
References initFileStorage().
Referenced by clearDataDirectory(), cloneObject(), copy(), createDirectory(), delete(), determineFileSize(), export(), getFile(), getUploadFile(), getXMLZip(), sendFile(), and storeUnzipedFile().
ilObjFile::getDiskUsage | ( | ) |
Gets the disk usage of the object in bytes.
public
Reimplemented from ilObject.
Definition at line 421 of file class.ilObjFile.php.
References ilObjFileAccess\_lookupDiskUsage().
ilObjFile::getFile | ( | $a_hist_entry_id = null | ) |
Definition at line 429 of file class.ilObjFile.php.
References $data, $file, ilHistory\_getEntryByHistoryID(), getDirectory(), getFileName(), and getVersion().
ilObjFile::getFileExtension | ( | ) |
Returns the extension of the file name converted to lower-case.
e.g. returns 'pdf' for 'document.pdf'.
Definition at line 626 of file class.ilObjFile.php.
References ilObjFileAccess\_getFileExtension(), and ilObject\getTitle().
ilObjFile::getFileName | ( | ) |
Definition at line 388 of file class.ilObjFile.php.
References $filename.
Referenced by checkFileExtension(), createProperties(), determineFileSize(), getFile(), getXMLZip(), MDUpdateListener(), sendFile(), and update().
ilObjFile::getFileSize | ( | ) |
Definition at line 411 of file class.ilObjFile.php.
Referenced by createMetaData(), createProperties(), update(), and updateMetaData().
ilObjFile::getFileType | ( | ) |
Definition at line 401 of file class.ilObjFile.php.
References $filetype.
Referenced by createMetaData(), createProperties(), guessFileType(), and updateMetaData().
ilObjFile::getMode | ( | ) |
mode is object or filelist
Definition at line 485 of file class.ilObjFile.php.
References $mode.
Referenced by createProperties(), delete(), and update().
ilObjFile::getUploadFile | ( | $a_upload_file, | |
$a_filename | |||
) |
Definition at line 219 of file class.ilObjFile.php.
References $file, getDirectory(), getVersion(), ilUtil\makeDirParents(), ilUtil\moveUploadedFile(), and setVersion().
Referenced by addFileVersion(), and replaceFile().
ilObjFile::getUsages | ( | ) |
get all usages of file object
Definition at line 852 of file class.ilObjFile.php.
References $ilDB, $q, $ret, and ilObject\getId().
Referenced by delete().
ilObjFile::getVersion | ( | ) |
Definition at line 465 of file class.ilObjFile.php.
Referenced by determineFileSize(), export(), getFile(), getUploadFile(), sendFile(), storeUnzipedFile(), and update().
ilObjFile::getXMLZip | ( | ) |
Reimplemented from ilObject.
Definition at line 898 of file class.ilObjFile.php.
References ilObject\$ilias, ilUtil\escapeShellArg(), getDirectory(), and getFileName().
ilObjFile::guessFileType | ( | $a_file = "" | ) |
Guesses the file type based on the current values returned by getFileType() and getFileExtension().
If getFileType() returns 'application/octet-stream', the file extension is used to guess a more accurate file type.
Definition at line 654 of file class.ilObjFile.php.
References $filename, getFileType(), and ilMimeTypeUtil\getMimeType().
Referenced by sendFile().
ilObjFile::ilObjFile | ( | $a_id = 0 , |
|
$a_call_by_reference = true |
|||
) |
Constructor public.
integer | reference_id or object_id |
boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 35 of file class.ilObjFile.php.
References ilObject\getId(), ilObject\ilObject(), and initFileStorage().
ilObjFile::initFileStorage | ( | ) |
init file storage object
public
Definition at line 945 of file class.ilObjFile.php.
References ilObject\getId().
Referenced by createProperties(), getDirectory(), ilObjFile(), and read().
ilObjFile::isHidden | ( | ) |
Returns true, if this file should be hidden in the repository view.
Definition at line 642 of file class.ilObjFile.php.
References ilObjFileAccess\_isFileHidden(), and ilObject\getTitle().
Referenced by addNewsNotification().
ilObjFile::isInline | ( | ) |
Returns true, if this file should be displayed inline in a browser window.
This is especially useful for PDF documents, HTML pages, and for images which are directly supported by the browser.
Definition at line 635 of file class.ilObjFile.php.
References ilObjFileAccess\_isFileInline(), and ilObject\getTitle().
Referenced by sendFile().
ilObjFile::MDUpdateListener | ( | $a_element | ) |
Meta data update listener.
Important note: Do never call create() or update() method of ilObject here. It would result in an endless loop: update object -> update meta -> update object -> ... Use static _writeTitle() ... methods instead.
string | $a_element |
Reimplemented from ilObject.
Definition at line 143 of file class.ilObjFile.php.
References ilObject\$id, ilObject\$title, _writeFileType(), checkFileExtension(), getFileName(), ilObject\getId(), ilObject\getType(), and setFileType().
ilObjFile::raiseUploadError | ( | $a_raise = true | ) |
Definition at line 214 of file class.ilObjFile.php.
ilObjFile::read | ( | ) |
read file properties
Definition at line 300 of file class.ilObjFile.php.
References $ilDB, $q, $row, DB_FETCHMODE_OBJECT, ilObject\getId(), initFileStorage(), setFileName(), setFileSize(), setFileType(), setMode(), and setVersion().
ilObjFile::replaceFile | ( | $a_upload_file, | |
$a_filename | |||
) |
replace file with new file
Definition at line 236 of file class.ilObjFile.php.
References ilHistory\_createEntry(), addNewsNotification(), ilObject\getId(), and getUploadFile().
ilObjFile::sendFile | ( | $a_hist_entry_id = null | ) |
Definition at line 561 of file class.ilObjFile.php.
References $data, $file, ilHistory\_getEntryByHistoryID(), ilUtil\deliverFile(), getDirectory(), getFileName(), ilObject\getTitle(), getVersion(), guessFileType(), and isInline().
ilObjFile::setFileName | ( | $a_name | ) |
set filename
Definition at line 383 of file class.ilObjFile.php.
Referenced by read().
ilObjFile::setFileSize | ( | $a_size | ) |
Definition at line 406 of file class.ilObjFile.php.
Referenced by determineFileSize(), and read().
ilObjFile::setFileType | ( | $a_type | ) |
Definition at line 393 of file class.ilObjFile.php.
References $ilLog.
Referenced by MDUpdateListener(), and read().
ilObjFile::setMode | ( | $a_mode | ) |
mode is object or filelist
string | $a_mode | mode |
Definition at line 475 of file class.ilObjFile.php.
Referenced by read().
ilObjFile::setVersion | ( | $a_version | ) |
Definition at line 460 of file class.ilObjFile.php.
Referenced by deleteVersions(), getUploadFile(), read(), and storeUnzipedFile().
ilObjFile::storeUnzipedFile | ( | $a_upload_file, | |
$a_filename | |||
) |
storeUnzipedFile
Stores Files unzipped from uploaded archive in filesystem
string | $a_upload_file | |
string | $a_filename |
Definition at line 959 of file class.ilObjFile.php.
References $file, getDirectory(), getVersion(), ilUtil\makeDir(), and setVersion().
ilObjFile::update | ( | ) |
update file
Reimplemented from ilObject.
Definition at line 322 of file class.ilObjFile.php.
References $ilDB, $ilLog, $q, $res, getFileName(), getFileSize(), ilObject\getId(), getMode(), getVersion(), and updateMetaData().
ilObjFile::updateMetaData | ( | ) |
update meta data
Reimplemented from ilObject.
Definition at line 351 of file class.ilObjFile.php.
References getFileSize(), getFileType(), ilObject\getId(), and ilObject\getType().
Referenced by update().
|
private |
Definition at line 26 of file class.ilObjFile.php.
Referenced by _lookupAbsolutePath().
ilObjFile::$filemaxsize = "20000000" |
Definition at line 22 of file class.ilObjFile.php.
ilObjFile::$filename |
Definition at line 20 of file class.ilObjFile.php.
Referenced by _lookupAbsolutePath(), getFileName(), and guessFileType().
ilObjFile::$filetype |
Definition at line 21 of file class.ilObjFile.php.
Referenced by getFileType().
ilObjFile::$mode = "object" |
Definition at line 24 of file class.ilObjFile.php.
Referenced by getMode().
ilObjFile::$raise_upload_error |
Definition at line 23 of file class.ilObjFile.php.