3 class mw_sourceml extends mw_plugin{
9 function description(){
10 return "Publication de sources musicales";
15 $env->set_link("admin/sourceml", $env->url("admin/sourceml"), "SourceML", 50);
16 $env->set_link("admin/sourceml/licences", $env->url("admin/licences"), "Licences", 10);
17 $env->set_link("admin/sourceml/cache", $env->url("admin/cache"), "Cache", 20);
18 $env->set_link("admin/sourceml/maintenance", $env->url("admin/maintenance"), "Maintenance", 30);
20 $env->set_link("users/authors", $env->url("users/groupes"), "Groupes", 30);
21 $env->set_link("users/albums", $env->url("users/albums"), "Albums", 31);
22 $env->set_link("users/morceaux", $env->url("users/morceaux"), "Morceaux", 32);
23 $env->set_link("users/pistes", $env->url("users/pistes"), "Sources", 33);
25 $invitations_title = "Invitations";
26 if($nb_invitations = $this->nb_invitations($env)) $invitations_title .= " (".$nb_invitations.")";
27 $env->set_link("users/sources_invitations", $env->url("users/sources_invitations"), $invitations_title, 34);
29 $env->set_link("menu_top/groupes", $env->url("sources/groupe"), "Groupes", 10);
30 $env->set_link("menu_top/albums", $env->url("sources/album"), "Albums", 11);
31 $env->set_link("menu_top/morceaux", $env->url("sources/morceau"), "Morceaux", 12);
32 $env->set_link("menu_top/pistes", $env->url("sources/piste"), "Sources", 13);
37 function nb_invitations($env){
38 if($user = $env->user()){
40 if($groupes = $data->groupes($user["id"])){
41 if($invitations = $data->sources_invitations($groupes["list"], $user["id"])){
42 return $invitations["total"];
49 function enable($env){
53 function disable($env){
57 // ---------------------------------------------------------------------------------
61 function install($env){
63 $env->bdd("sgbd") == "mysql"
64 || $env->bdd("sgbd") == "pdo_mysql"
65 ) return $this->install_mysql($env);
67 $env->bdd("sgbd") == "pdo_sqlite"
68 ) return $this->install_sqlite($env);
70 $env->bdd("sgbd") == "xml"
71 ) return $this->install_xml($env);
72 return "Mode de stockage pour Mtweb (".$env->bdd("sgbd").") non supporté par SourceML";
75 function install_mysql($env){
77 $sgbd = $data->sgbd();
80 $sgbd->table_exists("#--sml_authors")
81 || $sgbd->table_exists("#--sml_classes")
82 || $sgbd->table_exists("#--sml_licences")
83 || $sgbd->table_exists("#--sml_sources")
84 || $sgbd->table_exists("#--sml_sources_access")
85 || $sgbd->table_exists("#--sml_sources_authors")
86 || $sgbd->table_exists("#--sml_sources_infos")
87 || $sgbd->table_exists("#--sml_source_cache")
88 || $sgbd->table_exists("#--sml_source_compositions")
89 || $sgbd->table_exists("#--sml_source_derivations")
90 || $sgbd->table_exists("#--sml_source_documents")
91 || $sgbd->table_exists("#--sml_sources_invitations");
94 return "impossible de savoir si les tables existent deja";
97 return "des tables existent deja en base. installation annulee";
101 "SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\"";
105 "CREATE TABLE `#--sml_authors`("
106 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
107 ." `id_user` int(11) NOT NULL,"
108 ." `nom` varchar(255) NOT NULL,"
109 ." `image` varchar(255) DEFAULT NULL,"
110 ." `description` text,"
111 ." `email` varchar(255) NOT NULL,"
112 ." `contact_form` tinyint(4) NOT NULL,"
113 ." `captcha` tinyint(4) NOT NULL,"
114 ." PRIMARY KEY (`id`),"
115 ." KEY `id_user` (`id_user`)"
116 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
120 "CREATE TABLE `#--sml_classes`("
121 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
122 ." `nom` varchar(255) NOT NULL,"
123 ." PRIMARY KEY (`id`)"
124 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
128 "CREATE TABLE `#--sml_licences`("
129 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
130 ." `nom` varchar(255) NOT NULL,"
131 ." `url` varchar(255) NOT NULL,"
132 ." PRIMARY KEY (`id`)"
133 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
137 "CREATE TABLE `#--sml_sources`("
138 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
139 ." `id_class` int(11) NOT NULL,"
140 ." `reference` varchar(255) DEFAULT NULL,"
141 ." `titre` varchar(255) DEFAULT NULL,"
142 ." `licence` int(11) DEFAULT NULL,"
143 ." `date_creation` date DEFAULT NULL,"
144 ." `date_inscription` datetime NOT NULL,"
145 ." PRIMARY KEY (`id`),"
146 ." KEY `id_class` (`id_class`),"
147 ." KEY `licence` (`licence`)"
148 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
152 "CREATE TABLE `#--sml_sources_access`("
153 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
154 ." `nom` varchar(255) NOT NULL,"
155 ." `intitule` varchar(255) NOT NULL,"
156 ." PRIMARY KEY (`id`)"
157 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
161 "CREATE TABLE `#--sml_sources_authors`("
162 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
163 ." `id_source` int(11) NOT NULL,"
164 ." `id_author` int(11) NOT NULL,"
165 ." `id_sources_access` int(11) NOT NULL,"
166 ." PRIMARY KEY (`id`),"
167 ." KEY `id_object` (`id_source`),"
168 ." KEY `id_author` (`id_author`),"
169 ." KEY `id_sources_access` (`id_sources_access`)"
170 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
174 "CREATE TABLE `#--sml_sources_infos`("
175 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
176 ." `id_source` int(11) NOT NULL,"
177 ." `key` varchar(255) NOT NULL,"
178 ." `value` text NOT NULL,"
179 ." PRIMARY KEY (`id`),"
180 ." KEY `id_source` (`id_source`)"
181 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
185 "CREATE TABLE `#--sml_source_cache`("
186 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
187 ." `url` varchar(255) NOT NULL,"
188 ." `id_source` int(11) NOT NULL,"
189 ." `last_update` datetime NOT NULL,"
190 ." PRIMARY KEY (`id`)"
191 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
195 "CREATE TABLE `#--sml_source_compositions`("
196 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
197 ." `id_source` int(11) NOT NULL,"
198 ." `id_composition` int(11) NOT NULL,"
199 ." PRIMARY KEY (`id`),"
200 ." KEY `id_source` (`id_source`),"
201 ." KEY `id_composition` (`id_composition`)"
202 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
206 "CREATE TABLE `#--sml_source_derivations`("
207 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
208 ." `id_source` int(11) NOT NULL,"
209 ." `derivation` varchar(255) NOT NULL,"
210 ." PRIMARY KEY (`id`),"
211 ." KEY `derivation` (`derivation`)"
212 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
216 "CREATE TABLE `#--sml_source_documents`("
217 ." `id` int(11) NOT NULL AUTO_INCREMENT,"
218 ." `id_source` int(11) NOT NULL,"
219 ." `nom` varchar(255) NOT NULL,"
220 ." `url` varchar(255) NOT NULL,"
221 ." PRIMARY KEY (`id`),"
222 ." KEY `id_source` (`id_source`)"
223 .") DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";
227 "CREATE TABLE `#--sml_sources_invitations`("
228 ." `id` INT(11) NOT NULL AUTO_INCREMENT,"
229 ." `id_user` INT(11) NOT NULL,"
230 ." `id_source` INT(11) NOT NULL,"
231 ." `id_author` INT(11) NOT NULL,"
232 ." `id_sources_access` INT(11) NOT NULL,"
233 ." `date_invitation` datetime NOT NULL,"
234 ." PRIMARY KEY (`id`)"
240 return "imposible de creer les tables en base";
244 "INSERT INTO `#--sml_licences` (`id`, `nom`, `url`) VALUES"
245 ."(1, 'Creative commons by-sa 2.0', 'http://creativecommons.org/licenses/by-sa/2.0/deed.fr'),"
246 ."(2, 'Creative Commons by-nc-nd 2.5', 'http://creativecommons.org/licenses/by-nc-nd/2.5/'),"
247 ."(3, 'Creative Commons by-nc-sa 2.5', 'http://creativecommons.org/licenses/by-nc-sa/2.5/'),"
248 ."(4, 'Creative Commons by-nc 2.5', 'http://creativecommons.org/licenses/by-nc/2.5/'),"
249 ."(5, 'Creative Commons by-nd 2.5', 'http://creativecommons.org/licenses/by-nd/2.5/'),"
250 ."(6, 'Creative Commons by-sa 2.5', 'http://creativecommons.org/licenses/by-sa/2.5/'),"
251 ."(7, 'Creative Commons by 2.5', 'http://creativecommons.org/licenses/by/2.5/'),"
252 ."(8, 'Licence Art Libre', 'http://artlibre.org/licence/lal/'),"
253 ."(9, 'Licence C Reaction', 'http://morne.free.fr/Necktar7/creactionfr.htm'),"
254 ."(10, 'Yellow OpenMusic License', 'http://openmusic.linuxtag.org/yellow.html'),"
255 ."(11, 'Green OpenMusic License', 'http://openmusic.linuxtag.org/green.html')";
259 "INSERT INTO `#--sml_classes` (`id`, `nom`) VALUES"
266 "INSERT INTO `#--sml_sources_access` (`id`, `nom`, `intitule`) VALUES"
\r
267 ."(1, 'admin', 'administrateur'),"
\r
268 ."(2, 'editeur', 'éditeur'),"
\r
269 ."(3, 'contributeur', 'contributeur')";
274 return "les tables ont ete ajoutees en base mais impossible d'y enregistrer les valeurs par defaut.";
279 function install_sqlite($env){
280 $data = $env->data();
281 $sgbd = $data->sgbd();
284 $sgbd->table_exists("#--sml_authors")
285 || $sgbd->table_exists("#--sml_classes")
286 || $sgbd->table_exists("#--sml_licences")
287 || $sgbd->table_exists("#--sml_sources")
288 || $sgbd->table_exists("#--sml_sources_access")
289 || $sgbd->table_exists("#--sml_sources_authors")
290 || $sgbd->table_exists("#--sml_sources_infos")
291 || $sgbd->table_exists("#--sml_source_cache")
292 || $sgbd->table_exists("#--sml_source_compositions")
293 || $sgbd->table_exists("#--sml_source_derivations")
294 || $sgbd->table_exists("#--sml_source_documents")
295 || $sgbd->table_exists("#--sml_sources_invitations");
298 return "impossible de savoir si les tables existent deja";
301 return "des tables existent deja en base. installation annulee";
306 "CREATE TABLE #--sml_authors("
307 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
308 ." `id_user` INTEGER NOT NULL,"
309 ." `nom` TEXT NOT NULL,"
310 ." `image` TEXT DEFAULT NULL,"
311 ." `description` TEXT,"
312 ." `email` TEXT NOT NULL,"
313 ." `contact_form` INTEGER NOT NULL,"
314 ." `captcha` INTEGER NOT NULL"
319 "CREATE TABLE #--sml_classes("
320 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
321 ." `nom` TEXT NOT NULL"
326 "CREATE TABLE #--sml_licences("
327 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
328 ." `nom` TEXT NOT NULL,"
329 ." `url` TEXT NOT NULL"
334 "CREATE TABLE #--sml_sources("
335 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
336 ." `id_class` INTEGER NOT NULL,"
337 ." `reference` TEXT DEFAULT NULL,"
338 ." `titre` TEXT DEFAULT NULL,"
339 ." `licence` INTEGER DEFAULT NULL,"
340 ." `date_creation` TEXT DEFAULT NULL,"
341 ." `date_inscription` TEXT NOT NULL"
346 "CREATE TABLE #--sml_sources_access("
347 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
348 ." `nom` TEXT NOT NULL,"
349 ." `intitule` TEXT NOT NULL"
354 "CREATE TABLE #--sml_sources_authors("
355 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
356 ." `id_source` INTEGER NOT NULL,"
357 ." `id_author` INTEGER NOT NULL,"
358 ." `id_sources_access` INTEGER NOT NULL"
363 "CREATE TABLE #--sml_sources_infos("
364 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
365 ." `id_source` INTEGER NOT NULL,"
366 ." `key` TEXT NOT NULL,"
367 ." `value` TEXT NOT NULL"
372 "CREATE TABLE #--sml_source_cache("
373 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
374 ." `url` TEXT NOT NULL,"
375 ." `id_source` INTEGER NOT NULL,"
376 ." `last_update` TEXT NOT NULL"
381 "CREATE TABLE #--sml_source_compositions("
382 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
383 ." `id_source` INTEGER NOT NULL,"
384 ." `id_composition` INTEGER NOT NULL"
389 "CREATE TABLE #--sml_source_derivations("
390 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
391 ." `id_source` INTEGER NOT NULL,"
392 ." `derivation` TEXT NOT NULL"
397 "CREATE TABLE #--sml_source_documents("
398 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
399 ." `id_source` INTEGER NOT NULL,"
400 ." `nom` TEXT NOT NULL,"
401 ." `url` TEXT NOT NULL"
406 "CREATE TABLE #--sml_sources_invitations("
407 ." `id` INTEGER PRIMARY KEY AUTOINCREMENT,"
408 ." `id_user` INTEGER NOT NULL,"
409 ." `id_source` INTEGER NOT NULL,"
410 ." `id_author` INTEGER NOT NULL,"
411 ." `id_sources_access` INTEGER NOT NULL,"
412 ." `date_invitation` TEXT NOT NULL"
418 return "imposible de creer les tables en base";
422 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
423 ." VALUES(1, 'Creative commons by-sa 2.0', 'http://creativecommons.org/licenses/by-sa/2.0/deed.fr')";
427 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
428 ." VALUES (2, 'Creative Commons by-nc-nd 2.5', 'http://creativecommons.org/licenses/by-nc-nd/2.5/')";
432 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
433 ." VALUES (3, 'Creative Commons by-nc-sa 2.5', 'http://creativecommons.org/licenses/by-nc-sa/2.5/')";
437 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
438 ." VALUES (4, 'Creative Commons by-nc 2.5', 'http://creativecommons.org/licenses/by-nc/2.5/')";
442 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
443 ." VALUES (5, 'Creative Commons by-nd 2.5', 'http://creativecommons.org/licenses/by-nd/2.5/')";
447 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
448 ." VALUES (6, 'Creative Commons by-sa 2.5', 'http://creativecommons.org/licenses/by-sa/2.5/')";
452 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
453 ." VALUES (7, 'Creative Commons by 2.5', 'http://creativecommons.org/licenses/by/2.5/')";
457 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
458 ." VALUES (8, 'Licence Art Libre', 'http://artlibre.org/licence/lal/')";
462 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
463 ." VALUES (9, 'Licence C Reaction', 'http://morne.free.fr/Necktar7/creactionfr.htm')";
467 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
468 ." VALUES (10, 'Yellow OpenMusic License', 'http://openmusic.linuxtag.org/yellow.html')";
472 "INSERT INTO #--sml_licences(`id`, `nom`, `url`)"
473 ." VALUES (11, 'Green OpenMusic License', 'http://openmusic.linuxtag.org/green.html')";
477 "INSERT INTO `#--sml_classes` (`id`, `nom`) VALUES (1, 'album')";
481 "INSERT INTO `#--sml_classes` (`id`, `nom`) VALUES (2, 'morceau')";
485 "INSERT INTO `#--sml_classes` (`id`, `nom`) VALUES (3, 'piste')";
489 "INSERT INTO `#--sml_sources_access` (`id`, `nom`, `intitule`) VALUES (1, 'admin', 'administrateur')";
\r
493 "INSERT INTO `#--sml_sources_access` (`id`, `nom`, `intitule`) VALUES (2, 'editeur', 'éditeur')";
497 "INSERT INTO `#--sml_sources_access` (`id`, `nom`, `intitule`) VALUES (3, 'contributeur', 'contributeur')";
502 return "les tables ont ete ajoutees en base mais impossible d'y enregistrer les valeurs par defaut.";
507 function install_xml($env){
508 $data = $env->data();
509 $sgbd = $data->sgbd();
512 $res = $sgbd->data_exists("sml_authors"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
513 $res = $sgbd->data_exists("sml_classes"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
514 $res = $sgbd->data_exists("sml_licences"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
515 $res = $sgbd->data_exists("sml_sources"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
516 $res = $sgbd->data_exists("sml_sources_access"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
517 $res = $sgbd->data_exists("sml_sources_authors"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
518 $res = $sgbd->data_exists("sml_sources_infos"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
519 $res = $sgbd->data_exists("sml_source_cache"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
520 $res = $sgbd->data_exists("sml_source_compositions"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
521 $res = $sgbd->data_exists("sml_source_derivations"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
522 $res = $sgbd->data_exists("sml_source_documents"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
523 $res = $sgbd->data_exists("sml_sources_invitations"); if(isset($res)){ if($res) $RES = 1; } else $RES = -1;
525 if($RES === -1) return "impossible de savoir si les tables existent deja. installation annulee";
526 if($RES === 1) return "des tables existent deja en base. installation annulee";
528 if(!$sgbd->create_data("sml_authors")) return "impossible de creer la table sml_authors";
529 if(!$sgbd->create_data("sml_classes")) return "impossible de creer la table sml_classes";
530 if(!$sgbd->create_data("sml_licences")) return "impossible de creer la table sml_licences";
531 if(!$sgbd->create_data("sml_sources")) return "impossible de creer la table sml_sources";
532 if(!$sgbd->create_data("sml_sources_access")) return "impossible de creer la table sml_sources_access";
533 if(!$sgbd->create_data("sml_sources_authors")) return "impossible de creer la table sml_sources_authors";
534 if(!$sgbd->create_data("sml_sources_infos")) return "impossible de creer la table sml_sources_infos";
535 if(!$sgbd->create_data("sml_source_cache")) return "impossible de creer la table sml_source_cache";
536 if(!$sgbd->create_data("sml_source_compositions")) return "impossible de creer la table sml_source_compositions";
537 if(!$sgbd->create_data("sml_source_derivations")) return "impossible de creer la table sml_source_derivations";
538 if(!$sgbd->create_data("sml_source_documents")) return "impossible de creer la table sml_source_documents";
539 if(!$sgbd->create_data("sml_sources_invitations")) return "impossible de creer la table sml_sources_invitations";
543 // ------------------------------------ sml_licences
549 "nom" => "Creative commons by-sa 2.0",
550 "url" => "http://creativecommons.org/licenses/by-sa/2.0/deed.fr"
558 "nom" => "Creative Commons by-nc-nd 2.5",
559 "url" => "http://creativecommons.org/licenses/by-nc-nd/2.5/"
567 "nom" => "Creative Commons by-nc-sa 2.5",
568 "url" => "http://creativecommons.org/licenses/by-nc-sa/2.5/"
576 "nom" => "Creative Commons by-nc 2.5",
577 "url" => "http://creativecommons.org/licenses/by-nc/2.5/"
585 "nom" => "Creative Commons by-nd 2.5",
586 "url" => "http://creativecommons.org/licenses/by-nd/2.5/"
594 "nom" => "Creative Commons by-sa 2.5",
595 "url" => "http://creativecommons.org/licenses/by-sa/2.5/"
603 "nom" => "Creative Commons by 2.5",
604 "url" => "http://creativecommons.org/licenses/by/2.5/"
612 "nom" => "Licence Art Libre",
613 "url" => "http://artlibre.org/licence/lal/"
621 "nom" => "Licence C Reaction",
622 "url" => "http://morne.free.fr/Necktar7/creactionfr.htm"
630 "nom" => "Yellow OpenMusic License",
631 "url" => "http://openmusic.linuxtag.org/yellow.html"
639 "nom" => "Green OpenMusic License",
640 "url" => "http://openmusic.linuxtag.org/green.html"
645 // ------------------------------------ sml_classes
672 // ------------------------------------ sml_sources_access
676 "sml_sources_access",
679 "intitule" => "administrateur"
685 "sml_sources_access",
688 "intitule" => "éditeur"
694 "sml_sources_access",
696 "nom" => "contributeur",
697 "intitule" => "contributeur"
703 return "les tables ont ete ajoutees en base mais impossible d'y enregistrer les valeurs par defaut.";
709 // ---------------------------------------------------------------------------------
713 function uninstall($env){
715 $env->bdd("sgbd") == "mysql"
716 || $env->bdd("sgbd") == "pdo_mysql"
717 || $env->bdd("sgbd") == "pdo_sqlite"
718 ) return $this->uninstall_sql($env);
720 $env->bdd("sgbd") == "xml"
721 ) return $this->uninstall_xml($env);
722 return "Mode de stockage pour Mtweb (".$env->bdd("sgbd").") non supporté par SourceML";
725 function uninstall_sql($env){
726 $data = $env->data();
727 $sgbd = $data->sgbd();
728 if(!$this->disable($env)) return "impossible de desactiver le plugin";
730 $sgbd->query("DROP TABLE #--sml_authors");
733 return "impossible de supprimer la table #--sml_authors";
736 $sgbd->query("DROP TABLE #--sml_classes");
739 return "impossible de supprimer la table #--sml_classes";
742 $sgbd->query("DROP TABLE #--sml_licences");
745 return "impossible de supprimer la table #--sml_licences";
748 $sgbd->query("DROP TABLE #--sml_sources");
751 return "impossible de supprimer la table #--sml_sources";
754 $sgbd->query("DROP TABLE #--sml_sources_access");
757 return "impossible de supprimer la table #--sml_sources_access";
760 $sgbd->query("DROP TABLE #--sml_sources_authors");
763 return "impossible de supprimer la table #--sml_sources_authors";
766 $sgbd->query("DROP TABLE #--sml_sources_infos");
769 return "impossible de supprimer la table #--sml_sources_infos";
772 $sgbd->query("DROP TABLE #--sml_source_cache");
775 return "impossible de supprimer la table #--sml_source_cache";
778 $sgbd->query("DROP TABLE #--sml_source_compositions");
781 return "impossible de supprimer la table #--sml_source_compositions";
784 $sgbd->query("DROP TABLE #--sml_source_derivations");
787 return "impossible de supprimer la table #--sml_source_derivations";
790 $sgbd->query("DROP TABLE #--sml_source_documents");
793 return "impossible de supprimer la table #--sml_source_documents";
796 $sgbd->query("DROP TABLE #--sml_sources_invitations");
799 return "impossible de supprimer la table #--sml_sources_invitations";
804 function uninstall_xml($env){
805 $data = $env->data();
806 $sgbd = $data->sgbd();
807 if(!$this->disable($env)) return "impossible de desactiver le plugin";
811 if(!$ERROR) if(!$sgbd->remove_data("sml_authors")) $ERROR = true;
812 if(!$ERROR) if(!$sgbd->remove_data("sml_classes")) $ERROR = true;
813 if(!$ERROR) if(!$sgbd->remove_data("sml_licences")) $ERROR = true;
814 if(!$ERROR) if(!$sgbd->remove_data("sml_sources")) $ERROR = true;
815 if(!$ERROR) if(!$sgbd->remove_data("sml_sources_access")) $ERROR = true;
816 if(!$ERROR) if(!$sgbd->remove_data("sml_sources_authors")) $ERROR = true;
817 if(!$ERROR) if(!$sgbd->remove_data("sml_sources_infos")) $ERROR = true;
818 if(!$ERROR) if(!$sgbd->remove_data("sml_source_cache")) $ERROR = true;
819 if(!$ERROR) if(!$sgbd->remove_data("sml_source_compositions")) $ERROR = true;
820 if(!$ERROR) if(!$sgbd->remove_data("sml_source_derivations")) $ERROR = true;
821 if(!$ERROR) if(!$sgbd->remove_data("sml_source_documents")) $ERROR = true;
822 if(!$ERROR) if(!$sgbd->remove_data("sml_sources_invitations")) $ERROR = true;
826 return "erreur lors de la suppression des tables";