source: spip-zone/_plugins_/desactiver_flash/desactiver_flash.php @ 87449

Last change on this file since 87449 was 5548, checked in by fil@…, 13 years ago

rangement des plugins celbataires : comarquage/1_9_0/ console/1_9_0/ csv_import/1_9_0/ desactiver_cache/1_9_0/ desactiver_flash/1_9_0/ dewplayer/1_9_0/ ecard/1_9_1/ marqueur_stats/1_9_0/ modeles_liste/1_9_1/ orientation/1_9_0/ phpmyvisites/1_9_0/ pim_agenda/1_9_0/ profil_etendu/1_9_1/ push/1_9_0/ recherche_etendue/1_9_0/ sitemap/1_9_0/ smallcaps/1_9_0/ spip-lettres/1_9_0/ squelette_profil/1_9_0/ squelettes_par_mots_cle/1_9_0/ squelettes_update/1_9_0/ switcher/1_9_0/ timeline/1_9_0/ toutmulti/1_9_0/ tri_auteurs/1_9_0/ tri_mots/1_9_0/ version_texte/1_9_0/ widget_calendar/1_9_0/

File size: 887 bytes
Line 
1<?php
2
3function InhibeFlash_affichage_final($flux){
4        $code = "";
5        // regarder si jquery deja la ou non
6        if (strpos($flux,"jquery.js")===FALSE)
7                $code .= '<script src="'.find_in_path('jquery.js').'" type="text/javascript"></script>';
8        $code .=<<<jscode
9<script type="text/javascript"><!--
10var code;
11$(document).ready(function(){
12  $('object').each(function(){
13        $('param',this).remove();
14  }).wrap("<div class='noflash'></div>");
15  $('div.noflash').each(function(){
16        var code = this.innerHTML;
17        // ajouter les attributs juste avant la fermeture de la balise object
18        var reg=new RegExp("(<object [^>]*>)", "i");
19        code = code.replace(reg,"");
20        var reg=new RegExp("(<\/object>)", "i");
21        code = code.replace(reg,"");
22        this.innerHTML=code;
23  })
24});
25//--></script>
26jscode;
27        $flux = str_replace("</body>",$code."</body>",$flux);
28        return $flux;
29}
30
31?>
Note: See TracBrowser for help on using the repository browser.