Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/images/images.php
Show All 17 Lines | |||||
/** | /** | ||||
* Deletes the record from database | * Deletes the record from database | ||||
* | * | ||||
* @param int $id | * @param int $id | ||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function Delete($id) | public function Delete($id = null) | ||||
{ | { | ||||
$this->Load($id); | $this->Load($id); | ||||
$local_path = FULL_PATH . $this->GetDBField('LocalPath'); | $local_path = FULL_PATH . $this->GetDBField('LocalPath'); | ||||
$thumb_path = FULL_PATH . $this->GetDBField('ThumbPath'); | $thumb_path = FULL_PATH . $this->GetDBField('ThumbPath'); | ||||
if ( file_exists($local_path) ) { | if ( file_exists($local_path) ) { | ||||
unlink($local_path); | unlink($local_path); | ||||
} | } | ||||
if ( file_exists($thumb_path) ) { | if ( file_exists($thumb_path) ) { | ||||
unlink($thumb_path); | unlink($thumb_path); | ||||
} | } | ||||
return parent::Delete($id); | return parent::Delete($id); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |