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);
         }
     }
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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;
             }
         }
     }
 }
Esempio n. 4
0
<?php

// +-------------------------------------------------+
// © 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;