11 require_once
'./Services/FileSystem/classes/class.ilFileData.php';
28 $this->pobject_id = $a_pobject_id;
40 $result = $this->db->queryf(
'SELECT image FROM payment_objects WHERE pobject_id = %s',
41 array(
'integer'),array($this->pobject_id));
43 while($record = $this->db->fetchAssoc(
$result))
45 $this->image_current = $record[
'image'];
52 if($this->image_current !=
'' &&
63 if($this->image_current !=
"" &&
74 if(is_writable($this->
getPath()))
87 if(is_writable($this->shop_path) && is_readable($this->shop_path))
93 $this->ilias->raiseError(
'Shop directory is not readable/writable by webserver', $this->ilias->error_obj->FATAL);
99 if($this->image_current !=
'') $this->
unlinkFile($this->image_current);
101 if(isset($a_http_post_file) && $a_http_post_file[
'size'])
104 $this->shop_path.
'/'.$a_http_post_file[
'name']))
106 ilUtil::resizeImage(
'"'.$this->shop_path.
'/'.$a_http_post_file[
'name'].
'"',
'"'.$this->shop_path.
'/'.$a_http_post_file[
'name'].
'"', 100, 75);
107 return $this->image_new = $a_http_post_file[
'name'];
117 $statement = $this->db->manipulateF(
118 'UPDATE payment_objects
121 WHERE pobject_id = %s',
122 array(
'text',
'integer'),
123 array($this->image_new, $this->pobject_id));
133 $statement = $this->db->manipulateF(
134 'UPDATE payment_objects
137 WHERE pobject_id = %s',
138 array(
'text',
'integer'),
140 array(NULL, $this->pobject_id));
142 if($this->image_current !=
'') $this->
unlinkFile($this->image_current);
144 $this->image_current =
'';
152 if(file_exists($this->shop_path.
'/'.$a_filename))
154 return unlink($this->shop_path.
'/'.$a_filename);
162 foreach($a_files as
$file)
164 if(!file_exists($this->shop_path.
'/'.$file))