protected function fetch_datas() { if ($this->id) { $query = "select document_title,document_description,document_filename,document_mimetype,document_filesize,document_vignette,document_url,document_path,document_create_date,document_num_storage,document_type_object,document_num_object from cms_documents where id_document = " . $this->id; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); $this->title = $row->document_title; $this->description = $row->document_description; $this->filename = $row->document_filename; $this->mimetype = $row->document_mimetype; $this->filesize = $row->document_filesize; $this->vignette = $row->document_vignette; $this->url = $row->document_url; $this->path = $row->document_path; $this->create_date = $row->document_create_date; $this->num_storage = $row->document_num_storage; $this->type_object = $row->document_type_object; $this->num_object = $row->document_num_object; } if ($this->num_storage) { $this->storage = storages::get_storage_class($this->num_storage); } } }
public function get_form($class) { global $base_path, $include_path, $class_path; if ($class == $this->class_name) { //on a la classe déjà déclaré $obj = storages::get_storage_class($this->id); } else { require_once $class_path . "/storages/" . $class . ".class.php"; $obj = new $class($id); } return $obj->get_params_form(); }
protected function fetch_datas() { if ($this->id) { $query = "select document_title,document_description,document_filename,document_mimetype,document_filesize,document_vignette,document_url,document_path,document_create_date,document_num_storage,document_type_object,document_num_object from cms_documents where id_document = " . $this->id; $result = mysql_query($query); if (mysql_num_rows($result)) { $row = mysql_fetch_object($result); $this->title = $row->document_title; $this->description = $row->document_description; $this->filename = $row->document_filename; $this->mimetype = $row->document_mimetype; $this->filesize = $row->document_filesize; $this->vignette = $row->document_vignette; $this->url = $row->document_url; $this->path = $row->document_path; $this->create_date = $row->document_create_date; $this->num_storage = $row->document_num_storage; $this->type_object = $row->document_type_object; $this->num_object = $row->document_num_object; } if ($this->num_storage) { $this->storage = storages::get_storage_class($this->num_storage); } //récupération des utilisations $query = "select * from cms_documents_links where document_link_num_document = " . $this->id; $result = mysql_query($query); if (mysql_num_rows($result)) { while ($row = mysql_fetch_object($result)) { if (!$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_form($form_link = "") { global $cms_collection_form; global $msg, $charset; if (!$form_link) { $form_link = "./cms.php?categ=collection&sub=collection&action=save"; } //lien pour la soumission du formulaire $form = str_replace("!!action!!", $form_link, $cms_collection_form); //id $form = str_replace("!!id!!", htmlentities($this->id, ENT_QUOTES, $charset), $form); //titre $form = str_replace("!!label!!", htmlentities($this->title, ENT_QUOTES, $charset), $form); //description $form = str_replace("!!comment!!", htmlentities($this->description, ENT_QUOTES, $charset), $form); //bouton supprimer if ($this->id) { $form = str_replace("!!form_title!!", $msg['cms_collection_edit'], $form); $form = str_replace("!!bouton_supprimer!!", "<input type='button' class='bouton' value=' " . $msg[63] . " ' onclick='confirmation_delete(\"&action=delete&id=" . $this->id . "\",\"" . htmlentities($this->title, ENT_QUOTES, $charset) . "\")' />", $form); $form .= confirmation_delete($form_link); } else { $form = str_replace("!!form_title!!", $msg['cms_collection_add'], $form); $form = str_replace("!!bouton_supprimer!!", "", $form); } $storages = new storages(); $form = str_replace("!!storage_form!!", $storages->get_item_form($this->num_storage), $form); return $form; }
// +-------------------------------------------------+ // © 2002-2010 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: storage.inc.php,v 1.2 2014-02-06 15:30:20 arenou Exp $ require_once $class_path . "/storages/storages.class.php"; switch ($sub) { case "upload": $storage = storages::get_storage_class($id); if ($storage) { $success = $storage->upload_process(); } if ($success) { switch ($type) { case 'collection': require_once $class_path . "/cms/cms_collections.class.php"; $collection = new cms_collection($id_collection); print $collection->add_document($storage->get_uploaded_fileinfos(), true, $from); break; } } break; default: switch ($action) { case "get_params_form": $storages = new storages(); print $storages->get_params_form($class_name, $id); break; } break; }
// +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: main.inc.php,v 1.3 2014-09-16 13:51:36 dgoron Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } switch ($sub) { case 'rep': $admin_layout = str_replace('!!menu_sous_rub!!', $msg["upload_repertoire"], $admin_layout); print $admin_layout; include "./admin/upload/folders.inc.php"; break; case "storages": require_once $class_path . "/storages/storages.class.php"; $admin_layout = str_replace('!!menu_sous_rub!!', $msg["storage_menu"], $admin_layout); print $admin_layout; $storages = new storages(); $storages->process($action, $id); break; case "statut": $admin_layout = str_replace('!!menu_sous_rub!!', $msg["admin_menu_docnum_statut"], $admin_layout); print $admin_layout; include "./admin/upload/statut.inc.php"; break; default: $admin_layout = str_replace('!!menu_sous_rub!!', "", $admin_layout); print $admin_layout; echo window_title($database_window_title . $msg[131] . $msg[1003] . $msg[1001]); break; }