|
| |
1 |
|
<?php |
|
| |
2 |
|
|
|
| |
3 |
|
|
|
| |
4 |
|
|
|
| |
5 |
|
|
|
| |
6 |
|
|
|
| |
7 |
|
|
|
| |
8 |
|
|
|
| |
9 |
|
|
|
| |
10 |
|
|
|
| |
11 |
|
|
|
| |
12 |
|
|
|
| |
13 |
|
|
|
| |
14 |
|
defined('FULL_PATH') or die('restricted access!'); |
|
| |
15 |
|
|
|
| |
16 |
|
class FilesItem extends kDBItem { |
|
| |
17 |
|
|
|
| |
18 |
|
function Delete($id) |
|
| |
19 |
|
{ |
|
| |
20 |
|
$this->Load($id); |
|
| |
21 |
|
$upload_dir = $this->Fields['FilePath']['upload_dir']; |
|
| |
22 |
|
$file_path = FULL_PATH.$upload_dir.$this->GetDBField('FilePath'); |
|
| |
23 |
|
if(file_exists($file_path)) |
|
| |
24 |
|
{ |
|
| |
25 |
|
unlink($file_path); |
|
| |
26 |
|
} |
|
| |
27 |
|
return parent::Delete($id); |
|
| |
28 |
|
} |
|
| |
29 |
|
} |