restore($tmp); }else{ $this->fetch_datas(); cms_cache::set_at_cms_cache($this); } } protected function restore($cms_object){ foreach(get_object_vars($cms_object) as $propertieName=>$propertieValue){ $this->{$propertieName}=$propertieValue; } } protected function fetch_datas(){ parent::fetch_datas(); if($this->id){ //récupération des utilisations $query = "select * from cms_documents_links where document_link_num_document = ".$this->id; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)){ while($row=pmb_mysql_fetch_object($result)){ if(!isset($this->used[$row->document_link_type_object]) || !$this->used[$row->document_link_type_object]) $this->used[$row->document_link_type_object] = array(); $this->used[$row->document_link_type_object][] = $row->document_link_num_object; } } } } public function get_item_form($selected = false,$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().")" : "")."