Ignore:
Timestamp:
Jul 2, 2009, 5:06:49 PM (15 years ago)
Author:
flop25
Message:

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

File:
1 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];
Note: See TracChangeset for help on using the changeset viewer.