id = $id * 1; $this->fetch_datas_cache(); } protected function fetch_datas_cache() { $this->fetch_datas(); } protected function fetch_datas() { if ($this->id) { $query = "select " . static::$prefix . "_title as title, " . static::$prefix . "_description as description, " . static::$prefix . "_filename as filename, " . static::$prefix . "_mimetype as mimetype, " . static::$prefix . "_filesize as filesize, " . static::$prefix . "_vignette as vignette, " . static::$prefix . "_url as url, " . static::$prefix . "_path as path, " . static::$prefix . "_create_date as create_date, " . static::$prefix . "_num_storage as num_storage, " . static::$prefix . "_type_object as type_object, " . static::$prefix . "_num_object as num_object from " . static::$table . " where id_" . static::$prefix . " = " . $this->id; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); $this->title = $row->title; $this->description = $row->description; $this->filename = $row->filename; $this->mimetype = $row->mimetype; $this->filesize = $row->filesize; $this->vignette = $row->vignette; $this->url = $row->url; $this->path = $row->path; $this->create_date = $row->create_date; $this->num_storage = $row->num_storage; $this->type_object = $row->type_object; $this->num_object = $row->num_object; } if ($this->num_storage) { $this->storage = storages::get_storage_class($this->num_storage); } } } public function get_item_render($edit_js_function = "openEditDialog") { global $msg, $charset; $item = "
" . htmlentities(($this->title ? $this->title : $this->filename), ENT_QUOTES, $charset) . "
" . htmlentities($this->mimetype, ENT_QUOTES, $charset) . ($this->filesize ? " - (" . $this->get_human_size() . ")" : "") . "
" . htmlentities(($this->title ? $this->title : $this->filename), ENT_QUOTES, $charset) . "
" . htmlentities($this->mimetype, ENT_QUOTES, $charset) . ($this->filesize ? " - (" . $this->get_human_size() . ")" : "") . "