Changeset 39717 in spip-zone


Ignore:
Timestamp:
Aug 8, 2010, 8:02:27 PM (9 years ago)
Author:
prigent.yohann@…
Message:

insert_head_css ici aussi

Location:
_plugins_/Lecteur_multimedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/Lecteur_multimedia/player_fonctions.php

    r35897 r39717  
    1212}
    1313
    14 function Player_head(){
    15        
    16         $player_ = ($p = $GLOBALS['meta']['player']) ? $p : _PLAYER_MP3_LECTEUR_DEFAULT;
    17        
     14function Player_call_js() {
    1815        $flux = "\n"
    19                 . "<!-- Player -->\n"
     16                . "<!-- Player JS -->\n"
    2017                . '<script type="text/javascript" src="'.find_in_path('soundmanager/soundmanager2.js').'"></script>'
    2118                . '<script type="text/javascript"><!--' . "\n"
     
    3229                . '<script type="text/javascript" src="'._DIR_PLUGIN_PLAYER.'javascript/jscroller.js"></script>'."\n"
    3330                . '<script type="text/javascript" src="'._DIR_PLUGIN_PLAYER.'player_enclosure.js"></script>'."\n"
    34                 . '<link rel="stylesheet" href="'.find_in_path('player.css').'" type="text/css" media="all" />'."\n"
    3531                ;
     32        return $flux;
     33}
     34
     35function Player_call_css() {
     36        $flux = '<link rel="stylesheet" href="'.find_in_path('player.css').'" type="text/css" media="all" />'."\n";
     37        return $flux;
     38}
     39
     40function Player_head(){
     41       
     42        $player_ = ($p = $GLOBALS['meta']['player']) ? $p : _PLAYER_MP3_LECTEUR_DEFAULT;
     43       
     44        $flux = Player_call_js();
     45        $flux .= Player_call_css();
     46
     47        return $flux;
     48}
     49
     50function Player_insert_head_css($flux){
     51        static $done = false;
     52        if (!$done) {
     53                $done = true;
     54                if (!defined('_PLAYER_AFFICHAGE_FINAL') OR !_PLAYER_AFFICHAGE_FINAL)
     55                {
     56                        $flux .= Player_call_css();
     57                }
     58        }
    3659        return $flux;
    3760}
     
    4063        if (!defined('_PLAYER_AFFICHAGE_FINAL') OR !_PLAYER_AFFICHAGE_FINAL)
    4164        {
    42                 $flux .= Player_head();
     65                $flux = Player_insert_head_css($flux);
     66                $flux .= Player_call_js();
    4367        }
    4468        return $flux;
  • _plugins_/Lecteur_multimedia/plugin.xml

    r37160 r39717  
    5555        </pipeline>
    5656        <pipeline>
     57                <nom>insert_head_css</nom>
     58        </pipeline>
     59        <pipeline>
    5760                <nom>insert_head</nom>
    5861        </pipeline>
Note: See TracChangeset for help on using the changeset viewer.