mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-16 14:01:34 +00:00
check if $object is set
This commit is contained in:
parent
5471c17b0f
commit
02307528ba
|
@ -98,6 +98,9 @@ class SeedDMS_Preview_Previewer {
|
||||||
* @return string file name of preview image
|
* @return string file name of preview image
|
||||||
*/
|
*/
|
||||||
protected function getFileName($object, $width) { /* }}} */
|
protected function getFileName($object, $width) { /* }}} */
|
||||||
|
if(!$object)
|
||||||
|
return false;
|
||||||
|
|
||||||
$document = $object->getDocument();
|
$document = $object->getDocument();
|
||||||
$dir = $this->previewDir.'/'.$document->getDir();
|
$dir = $this->previewDir.'/'.$document->getDir();
|
||||||
switch(get_class($object)) {
|
switch(get_class($object)) {
|
||||||
|
@ -173,6 +176,9 @@ class SeedDMS_Preview_Previewer {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
public function createPreview($object, $width=0) { /* {{{ */
|
public function createPreview($object, $width=0) { /* {{{ */
|
||||||
|
if(!$object)
|
||||||
|
return false;
|
||||||
|
|
||||||
if($width == 0)
|
if($width == 0)
|
||||||
$width = $this->width;
|
$width = $this->width;
|
||||||
else
|
else
|
||||||
|
@ -248,6 +254,9 @@ class SeedDMS_Preview_Previewer {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
public function hasPreview($object, $width=0) { /* {{{ */
|
public function hasPreview($object, $width=0) { /* {{{ */
|
||||||
|
if(!$object)
|
||||||
|
return false;
|
||||||
|
|
||||||
if($width == 0)
|
if($width == 0)
|
||||||
$width = $this->width;
|
$width = $this->width;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user