ILIAS
release_8 Revision v8.19-1-g4e8f2f9140c
|
Public Member Functions | |
__construct (int $a_obj_id, string $a_type="") | |
Creates a new ilPreview. More... | |
exists () | |
Determines whether the preview exists or not. More... | |
create (\ilObject $a_obj, bool $a_force=false) | |
Creates the preview. More... | |
delete () | |
Deletes the preview. More... | |
getImages () | |
Gets an array of preview images. More... | |
save () | |
Saves the preview data to the database. More... | |
getObjId () | |
Gets the id of the object the preview is for. More... | |
getObjType () | |
Gets the type of the object the preview is for. More... | |
getStoragePath () | |
Gets the path where the previews are stored relative to the web directory. More... | |
getAbsoluteStoragePath () | |
Gets the absolute path where the previews are stored. More... | |
getFilePathFormat () | |
Gets the absolute file path for preview images that contains a placeholder in the file name ('%02d') to be formatted with the preview number (use 'sprintf' for that). More... | |
getRenderDate () | |
setRenderDate (string $a_date) | |
getRenderStatus () | |
Gets the status of the rendering process. More... | |
setRenderStatus (string $a_status) | |
Sets the status of the rendering process. More... | |
getStorage () | |
Gets the storage object for the preview. More... | |
Static Public Member Functions | |
static | createPreview (\ilObject $a_obj, bool $a_force=false) |
Creates the preview for the object with the specified id. More... | |
static | deletePreview (int $a_obj_id) |
Deletes the preview for the object with the specified id. More... | |
static | copyPreviews (int $a_src_id, int $a_dest_id) |
Copies the preview images from one preview to a new preview object. More... | |
static | hasPreview (int $a_obj_id, string $a_type="") |
Determines whether the object with the specified reference id has a preview. More... | |
static | lookupRenderStatus (int $a_obj_id) |
Gets the render status for the object with the specified id. More... | |
Data Fields | |
const | RENDER_STATUS_NONE = "none" |
const | RENDER_STATUS_PENDING = "pending" |
const | RENDER_STATUS_CREATED = "created" |
const | RENDER_STATUS_FAILED = "failed" |
Protected Member Functions | |
doCreate () | |
Create entry in database. More... | |
doRead () | |
Read data from database. More... | |
doUpdate () | |
Update data in database. More... | |
doDelete () | |
Delete data from database. More... | |
Protected Attributes | |
ilRendererFactory | $factory |
Private Member Functions | |
init () | |
Initializes the preview object. More... | |
Private Attributes | |
const | FILENAME_FORMAT = "preview_%02d.jpg" |
int | $obj_id = null |
The object id. More... | |
string | $obj_type = null |
The type of the object. More... | |
ilFSStoragePreview | $storage = null |
The file storage instance. More... | |
bool | $exists = false |
Defines whether the preview exists. More... | |
string | $render_date = null |
The timestamp when the preview was rendered. More... | |
string | $render_status = self::RENDER_STATUS_NONE |
The status of the rendering process. More... | |
Definition at line 28 of file class.ilPreview.php.
ilPreview::__construct | ( | int | $a_obj_id, |
string | $a_type = "" |
||
) |
Creates a new ilPreview.
int | $a_obj_id | The object id. |
string | $a_type | The type of the object. |
Definition at line 75 of file class.ilPreview.php.
References init().
|
static |
Copies the preview images from one preview to a new preview object.
int | $a_src_id | The id of the object to copy from. |
int | $a_dest_id | The id of the object to copy to. |
Definition at line 113 of file class.ilPreview.php.
References ilPreviewSettings\isPreviewEnabled(), and ilFileUtils\rCopy().
ilPreview::create | ( | \ilObject | $a_obj, |
bool | $a_force = false |
||
) |
Creates the preview.
ilObject | $a_obj | The object to create the preview for. |
bool | $a_force | true, to force the creation of the preview; false, to create the preview only if needed. |
Definition at line 192 of file class.ilPreview.php.
References ilObject\getLastUpdateDate(), getRenderDate(), ilRendererFactory\getRenderer(), getRenderStatus(), getStorage(), ilPreviewSettings\isPreviewEnabled(), and save().
|
static |
Creates the preview for the object with the specified id.
ilObject | $a_obj | The object to create the preview for. |
bool | $a_force | true, to force the creation of the preview; false, to create the preview only if needed. |
Definition at line 90 of file class.ilPreview.php.
References $preview, ilObject\getId(), and ilObject\getType().
Referenced by ilObjFileAbstractProcessor\createFileObj(), and ilDclFileuploadRecordRepresentation\getHTML().
ilPreview::delete | ( | ) |
Deletes the preview.
Definition at line 236 of file class.ilPreview.php.
References doDelete(), exists(), and getStorage().
|
static |
Deletes the preview for the object with the specified id.
int | $a_obj_id | The id of the object to create the preview for. |
Definition at line 101 of file class.ilPreview.php.
References $preview.
|
protected |
Create entry in database.
Definition at line 308 of file class.ilPreview.php.
References $DIC, $ilDB, exists(), getObjId(), getRenderDate(), and getRenderStatus().
Referenced by save().
|
protected |
Delete data from database.
Definition at line 366 of file class.ilPreview.php.
References $DIC, $ilDB, and getObjId().
Referenced by delete().
|
protected |
Read data from database.
Definition at line 327 of file class.ilPreview.php.
References $DIC, $ilDB, exists(), getObjId(), setRenderDate(), and setRenderStatus().
Referenced by init().
|
protected |
Update data in database.
Definition at line 348 of file class.ilPreview.php.
References $DIC, $ilDB, getObjId(), getRenderDate(), and getRenderStatus().
Referenced by save().
ilPreview::exists | ( | ) |
Determines whether the preview exists or not.
Definition at line 180 of file class.ilPreview.php.
References $exists.
Referenced by delete(), doCreate(), doRead(), and save().
ilPreview::getAbsoluteStoragePath | ( | ) |
Gets the absolute path where the previews are stored.
Definition at line 418 of file class.ilPreview.php.
References CLIENT_ID, and ILIAS_WEB_DIR.
Referenced by getFilePathFormat(), and getImages().
ilPreview::getFilePathFormat | ( | ) |
Gets the absolute file path for preview images that contains a placeholder in the file name ('%02d') to be formatted with the preview number (use 'sprintf' for that).
Definition at line 429 of file class.ilPreview.php.
References $path, getAbsoluteStoragePath(), and ilFileUtils\removeTrailingPathSeparators().
Referenced by ilPreviewRenderer\render().
ilPreview::getImages | ( | ) |
Gets an array of preview images.
Definition at line 256 of file class.ilPreview.php.
References $path, getAbsoluteStoragePath(), ilUtil\getHtmlPath(), and getRenderStatus().
ilPreview::getObjId | ( | ) |
Gets the id of the object the preview is for.
Definition at line 383 of file class.ilPreview.php.
References $obj_id.
Referenced by doCreate(), doDelete(), doRead(), doUpdate(), getObjType(), and ilFilePreviewRenderer\supports().
ilPreview::getObjType | ( | ) |
Gets the type of the object the preview is for.
Definition at line 393 of file class.ilPreview.php.
References $obj_type, ilObject\_lookupType(), and getObjId().
Referenced by ilPreviewRenderer\supports().
ilPreview::getRenderDate | ( | ) |
Definition at line 435 of file class.ilPreview.php.
References $render_date.
Referenced by create(), doCreate(), and doUpdate().
ilPreview::getRenderStatus | ( | ) |
Gets the status of the rendering process.
Definition at line 450 of file class.ilPreview.php.
References $render_status.
Referenced by create(), doCreate(), doUpdate(), and getImages().
ilPreview::getStorage | ( | ) |
Gets the storage object for the preview.
Definition at line 470 of file class.ilPreview.php.
References $storage.
Referenced by create(), delete(), and getStoragePath().
ilPreview::getStoragePath | ( | ) |
Gets the path where the previews are stored relative to the web directory.
Definition at line 408 of file class.ilPreview.php.
References getStorage().
|
static |
Determines whether the object with the specified reference id has a preview.
int | $a_obj_id | The id of the object to check. |
string | $a_type | The type of the object to check. |
Definition at line 148 of file class.ilPreview.php.
References $preview, ilRendererFactory\getRenderer(), and ilPreviewSettings\isPreviewEnabled().
Referenced by ilDclFileuploadRecordRepresentation\getHTML(), ilObjFileGUI\infoScreenForward(), and ilObjectListGUI\insertTitle().
|
private |
Initializes the preview object.
Definition at line 482 of file class.ilPreview.php.
References doRead().
Referenced by __construct().
|
static |
Gets the render status for the object with the specified id.
int | $a_obj_id | The id of the object to get the status for. |
Definition at line 169 of file class.ilPreview.php.
References $preview.
Referenced by ilDclFileuploadRecordRepresentation\getHTML(), and ilObjectListGUI\insertTitle().
ilPreview::save | ( | ) |
Saves the preview data to the database.
Definition at line 296 of file class.ilPreview.php.
References doCreate(), doUpdate(), and exists().
Referenced by create(), and ilPreviewRenderer\render().
ilPreview::setRenderDate | ( | string | $a_date | ) |
Definition at line 440 of file class.ilPreview.php.
Referenced by doRead(), and ilPreviewRenderer\render().
ilPreview::setRenderStatus | ( | string | $a_status | ) |
Sets the status of the rendering process.
string | $a_status | The status to set. |
Definition at line 460 of file class.ilPreview.php.
Referenced by doRead(), and ilPreviewRenderer\render().
|
private |
Defines whether the preview exists.
Definition at line 56 of file class.ilPreview.php.
Referenced by exists().
|
protected |
Definition at line 67 of file class.ilPreview.php.
|
private |
|
private |
The type of the object.
Definition at line 46 of file class.ilPreview.php.
Referenced by getObjType().
|
private |
The timestamp when the preview was rendered.
Definition at line 61 of file class.ilPreview.php.
Referenced by getRenderDate().
|
private |
The status of the rendering process.
Definition at line 66 of file class.ilPreview.php.
Referenced by getRenderStatus().
|
private |
The file storage instance.
Definition at line 51 of file class.ilPreview.php.
Referenced by getStorage().
|
private |
Definition at line 36 of file class.ilPreview.php.
const ilPreview::RENDER_STATUS_CREATED = "created" |
Definition at line 33 of file class.ilPreview.php.
Referenced by ilPreviewGUI\getInlineHTML(), and ilPreviewRenderer\render().
const ilPreview::RENDER_STATUS_FAILED = "failed" |
Definition at line 34 of file class.ilPreview.php.
Referenced by ilPreviewGUI\getInlineHTML(), ilPreviewGUI\getPreviewHTML(), and ilPreviewRenderer\render().
const ilPreview::RENDER_STATUS_NONE = "none" |
Definition at line 31 of file class.ilPreview.php.
Referenced by ilDclFileuploadRecordRepresentation\getHTML(), ilPreviewGUI\getInlineHTML(), ilPreviewGUI\getJSCall(), and ilObjectListGUI\insertTitle().
const ilPreview::RENDER_STATUS_PENDING = "pending" |
Definition at line 32 of file class.ilPreview.php.
Referenced by ilPreviewGUI\getPreviewHTML(), and ilPreviewRenderer\render().