// install
//
- function mw_sourceml_install_xml($plugin, $env){
+ public function mw_sourceml_install_xml($plugin, $env){
$sgbd = $this->sgbd();
$RES = true;
- $res = $sgbd->data_exists("sml_authors"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_classes"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_licences"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_sources"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_sources_access"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_sources_authors"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_sources_infos"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_source_cache"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_source_compositions"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_source_derivations"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_source_documents"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
- $res = $sgbd->data_exists("sml_sources_invitations"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
+ $res = $sgbd->data_exists("sml_authors");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_classes");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_licences");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_sources");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_sources_access");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_sources_authors");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_source_cache");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_source_compositions");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_source_derivations");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
+ $res = $sgbd->data_exists("sml_sources_invitations");
+ if(isset($res)){
+ if($res) $RES = 1;
+ }
+ else $RES = -1;
if($RES === -1) return "impossible de savoir si les tables existent deja. installation annulee";
if($RES === 1) return "des tables existent deja en base. installation annulee";
if(!$sgbd->create_data("sml_sources")) return "impossible de creer la table sml_sources";
if(!$sgbd->create_data("sml_sources_access")) return "impossible de creer la table sml_sources_access";
if(!$sgbd->create_data("sml_sources_authors")) return "impossible de creer la table sml_sources_authors";
- if(!$sgbd->create_data("sml_sources_infos")) return "impossible de creer la table sml_sources_infos";
if(!$sgbd->create_data("sml_source_cache")) return "impossible de creer la table sml_source_cache";
if(!$sgbd->create_data("sml_source_compositions")) return "impossible de creer la table sml_source_compositions";
if(!$sgbd->create_data("sml_source_derivations")) return "impossible de creer la table sml_source_derivations";
- if(!$sgbd->create_data("sml_source_documents")) return "impossible de creer la table sml_source_documents";
if(!$sgbd->create_data("sml_sources_invitations")) return "impossible de creer la table sml_sources_invitations";
$ERROR = false;
// uninstall
//
- function mw_sourceml_uninstall_xml($plugin, $env){
+ public function mw_sourceml_uninstall_xml($plugin, $env){
$sgbd = $this->sgbd();
if(!$plugin->disable($env)) return "impossible de desactiver le plugin";
if(!$ERROR) if(!$sgbd->remove_data("sml_sources")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_sources_access")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_sources_authors")) $ERROR = true;
- if(!$ERROR) if(!$sgbd->remove_data("sml_sources_infos")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_source_cache")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_source_compositions")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_source_derivations")) $ERROR = true;
- if(!$ERROR) if(!$sgbd->remove_data("sml_source_documents")) $ERROR = true;
if(!$ERROR) if(!$sgbd->remove_data("sml_sources_invitations")) $ERROR = true;
if(!$ERROR) if(