Line | |
---|
1 | <?php |
---|
2 | if (!defined('_ECRIRE_INC_VERSION')) return; |
---|
3 | |
---|
4 | /** |
---|
5 | * Fonction de callback utiliser par le filtre |iframe_responsive |
---|
6 | * A chaque iFrame, on encadre de div.flex-video. |
---|
7 | * Si vimeo est détecté, on ajoute la class vimeo |
---|
8 | * @param string $matches iframe |
---|
9 | * @return string iframe encadrée |
---|
10 | */ |
---|
11 | function responsive($matches) { |
---|
12 | // Dans le cas de vimeo, il faut ajouter une classe |
---|
13 | if (strpos($matches[0], 'vimeo')) $vimeo = ' vimeo'; |
---|
14 | else $vimeo = ''; |
---|
15 | |
---|
16 | // On inclu les filtres, au cas ou |
---|
17 | include_spip('inc/filtres'); |
---|
18 | |
---|
19 | // On revoie la bonne structure html d'iframe. |
---|
20 | return wrap($matches[0], '<div class="flex-video'.$vimeo.'">');; |
---|
21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.