Ignore:
Timestamp:
07/02/09 17:06:49 (11 years ago)
Author:
flop25
Message:

activation of the option "hightlight the player with a menu block"
clean code
add/place icon

Location:
extensions/music_player
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/music_player/class.inc.php

    r3329 r3500  
    1111    $this->plugin_name = $plugin_name; 
    1212    $this->plugin_path = $plugin_path; 
    13     // handler 
    14    // $this->initialize_event_handler(); 
    1513  } 
    16   /* 
    17   function loading_lang() 
    18   { 
    19     global $lang; 
    20     //include(get_language_filepath('plugin.lang.php', $this->plugin_path)); 
    21         load_language('plugin.lang', $this->plugin_path); 
    22   }  */ 
    2314  function var_template() 
    2415  { 
     
    3425   return $r; 
    3526  } 
    36   /*function remove_code($tlp_handle, $str_begin, $str_end) 
    37   { 
    38       global $template; 
    39   
    40       $template->loadfile($tlp_handle); 
    41   
    42       $p_beg = strpos($template->uncompiled_code[$tlp_handle], $str_begin); 
    43       $p_end = strpos($template->uncompiled_code[$tlp_handle], $str_end) + strlen($str_end); 
    44       $s = substr($template->uncompiled_code[$tlp_handle], $p_beg, $p_end - $p_beg); 
    45   
    46       $template->uncompiled_code[$tlp_handle] =  
    47       substr_replace($template->uncompiled_code[$tlp_handle], '', $p_beg, $p_end - $p_beg); 
    48   
    49       return $s; 
    50   } 
    51    
    52   function add_before_code($tlp_handle, $insert_before, $code) 
    53   { 
    54       global $template; 
    55   
    56       $template->loadfile($tlp_handle); 
    57       $template->uncompiled_code[$tlp_handle] = str_replace($insert_before, $code.$insert_before, $template->uncompiled_code[$tlp_handle]); 
    58   }  
    59   function add_after_code($tlp_handle, $insert_after, $code) 
    60   { 
    61     global $template; 
    62   
    63     $template->loadfile($tlp_handle); 
    64     $template->uncompiled_code[$tlp_handle] = str_replace($insert_after, $insert_after.$code, $template->uncompiled_code[$tlp_handle]); 
    65   }*/ 
    6627   function register_mp_menubar_blocks($menu_ref_arr) { 
    6728    $menu = & $menu_ref_arr[0]; 
     
    7031    $menu->register_block(new RegisteredBlock('mbMusicPlayer', 'Music player', 'MP')); 
    7132  } 
    72  
     33  function placer_icon() 
     34  { 
     35        global $conf, $template; 
     36        $conf_plugin = explode("," , $conf['mp_plugin']); 
     37         if (isset($conf_plugin)) { 
     38                $template->concat( 'PLUGIN_INDEX_ACTIONS', 
     39                  '<li><a href="javascript:void(0)" onClick="window.open(\''.get_root_url().'plugins/'.$this->plugin_name.'/lecteur.php\',\'musique\',\'width='.$conf_plugin[4].',height='.$conf_plugin[3].',top=400,left=400,menubar=no,resizable=yes,toolbar=no,status=no,alwaysRaised=yes\')" ><img src="'.get_root_url().'plugins/'.$this->plugin_name.'/template/icon/icon32.png" alt="Music Player" title="Play Music" class="button" /></a></li>'); 
     40          } 
     41  } 
    7342 
    7443  function placer_lien($menu_ref_arr) 
     
    7645 
    7746///////////////////////[début de l'affichage lien]//////////////////// 
    78     //$this->loading_lang(); 
    7947         
    8048    global $lang, $conf, $template; 
    8149         
    82     /*$conf_plugin = explode("," , $conf['mp_plugin']); 
    83  
    84     $this->add_before_code('menubar','<!-- END quick_search -->','<ul> 
    85         <li><img src="plugins/'.$this->plugin_name.'/template/audio.png" /> <a name="{lang:lien_expl}" href="javascript:void(0)" onClick="window.open(\''.get_root_url().'plugins/'.$this->plugin_name.'/lecteur.php\',\'musique\',\'width='.$conf_plugin[4].',height='.$conf_plugin[3].',top=400,left=400,menubar=no,resizable=yes,toolbar=no,status=no,alwaysRaised=yes\')" >{lang:lien_titre}</a></li> 
    86 </ul> 
    87         ');*/ 
    8850         
    8951          $menu = & $menu_ref_arr[0]; 
  • extensions/music_player/main.inc.php

    r3329 r3500  
    2727add_event_handler('get_admin_plugin_menu_links', array(&$m_p, 'mp_lien_menu') ); 
    2828 
    29 //add_event_handler('loc_end_menubar', array(&$m_p, 'placer_lien'), 70 );  
    30 //add_event_handler('blockmanager_apply', array(&$m_p, 'placer_lien'), 70 );  
    3129 
    32 add_event_handler('blockmanager_apply', array(&$m_p, 'placer_block')); 
    33 add_event_handler('blockmanager_register_blocks', array(&$m_p, 'register_mp_menubar_blocks')); 
     30add_event_handler('loc_end_index', array(&$m_p, 'placer_icon') ); 
     31 
     32global $conf; 
     33$conf_plugin = explode("," , $conf['mp_plugin']); 
     34if (isset($conf_plugin[0]) and $conf_plugin[0]=="true") 
     35{ 
     36        add_event_handler('blockmanager_apply', array(&$m_p, 'placer_block')); 
     37        add_event_handler('blockmanager_register_blocks', array(&$m_p, 'register_mp_menubar_blocks')); 
     38} 
    3439 
    3540add_event_handler('loc_begin_page_header', array(&$m_p, 'add_css') ); 
  • extensions/music_player/template/admin.tpl

    r3329 r3500  
    5151<form action="" method="post" name="option_plugin"> 
    5252  <input type="checkbox" name="evidence" value="true" {$MP_EVIDENCE} /> 
    53   {'mp_admin_2_opt1'|@translate}// !!Inactive option !! <br /> 
     53  {'mp_admin_2_opt1'|@translate}<br /> 
    5454  <input type="checkbox" name="head" value="true" {$MP_HEAD} /> 
    5555  {'mp_admin_2_opt2'|@translate}<br /> 
  • extensions/music_player/template/block.tpl

    r3329 r3500  
    33#block_mp li a {literal}{{/literal} 
    44        display: block ; 
    5         background: transparent url({$PLG_path}/template/icon/fond1.png) left top no-repeat ; 
     5        background: transparent url({$PLG_path}/template/icon/fond_fus.png) left bottom no-repeat ; 
    66        padding: 4px ; 
    77        text-align: center ; 
     
    1010        {literal}}{/literal} 
    1111#block_mp li a:hover, #block_mp li a:focus, #block_mp li a:active {literal}{{/literal} 
    12         background: transparent url({$PLG_path}/template/icon/fond2.png) left top no-repeat ; 
     12        background: transparent url({$PLG_path}/template/icon/fond_fus.png) left top no-repeat ; 
    1313        {literal}}{/literal} 
    1414#block_mp li{literal}{{/literal} 
Note: See TracChangeset for help on using the changeset viewer.