public function process($action = "") { global $id; switch ($action) { case "edit": $collection = new cms_collection($id); print $collection->get_form(); break; case "delete": $collection = new cms_collection($id); $collection->delete(); $this->fetch_datas(); print $this->get_table(); break; case "save": $collection = new cms_collection(); $collection->save_form(); $this->fetch_datas(); print $this->get_table(); break; case "list": default: print $this->get_table(); break; } }
<?php // +-------------------------------------------------+ // © 2002-2011 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: cms_collection.inc.php,v 1.1 2013-07-04 12:55:50 arenou Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } //echo window_title($database_window_title.$msg["cms_menu_editorial_sections"].$msg[1003].$msg[1001]); require_once $class_path . "/cms/cms_collections.class.php"; switch ($sub) { case 'documents': $cms_layout = str_replace('!!menu_sous_rub!!', " > documents >" . $msg["cms_menu_editorial_sections_list"], $cms_layout); print $cms_layout; $collection = new cms_collection($collection_id); print $collection->get_documents_list(); break; case "collection": default: $cms_layout = str_replace('!!menu_sous_rub!!', " > " . $msg["cms_menu_editorial_sections_list"], $cms_layout); print $cms_layout; $collections = new cms_collections(); $collections->process($action); break; }
public function format_datas() { $collection = new cms_collection($this->num_object); $datas = array('id' => $this->id, 'name' => $this->title, 'description' => $this->description, 'filename' => $this->filename, 'mimetype' => $this->mimetype, 'filesize' => array('human' => $this->get_human_size(), 'value' => $this->filesize), 'url' => $this->get_document_url(), 'create_date' => $this->create_date, 'thumbnails_url' => $this->get_vignette_url()); $datas['collection'] = $collection->get_infos(); return $datas; }
// +-------------------------------------------------+ // © 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; }