Changeset 17678


Ignore:
Timestamp:
08/31/12 15:33:44 (7 years ago)
Author:
mistic100
Message:

remove Autosize on video pages, fix overlap problem with Stripped

Location:
extensions/gvideo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/include/gvideo.inc.php

    r17626 r17678  
    11<?php 
    22if (!defined('GVIDEO_PATH')) die('Hacking attempt!'); 
     3 
     4/** 
     5 * some stuff at the begining of picture.php 
     6 */ 
     7function gvideo_prepare_picture($picture) 
     8{ 
     9  if ($picture['current']['is_gvideo']) 
     10  { 
     11    // remove default parser 
     12    remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL); 
     13   
     14    // remove autosize 
     15    global $pwg_loaded_plugins, $autosize_controler; 
     16     
     17    if ( isset($pwg_loaded_plugins['Autosize']) and isset($autosize_controler) ) 
     18    { 
     19      remove_event_handler('render_element_content', array(&$autosize_controler, 'init'), EVENT_HANDLER_PRIORITY_NEUTRAL); 
     20      remove_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'), 40);  
     21      remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL); 
     22      remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL); 
     23      remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL); 
     24      remove_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21); 
     25    } 
     26  } 
     27   
     28  return $picture; 
     29} 
    330 
    431/** 
     
    1643  $conf['gvideo'] = unserialize($conf['gvideo']); 
    1744   
    18   remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL); 
    1945   
    2046  $query = ' 
     
    5076    $video['config']['dailymotion']['color'] = $colors[ $video['config']['dailymotion']['color'] ]; 
    5177  } 
     78   
    5279  $template->assign('GVIDEO', $video); 
     80   
     81  global $user; 
     82  if (strpos('stripped', $user['theme']) !== false) 
     83  { 
     84    $template->append('head_elements', '<style type="text/css">.hideTabs{display:none;}</style>'); 
     85  } 
    5386 
    5487  $template->set_filename('gvideo_content', dirname(__FILE__).'/../template/video_'.$video['type'].'.tpl'); 
  • extensions/gvideo/main.inc.php

    r17661 r17678  
    2020 
    2121add_event_handler('init', 'gvideo_init'); 
     22add_event_handler('picture_pictures_data', 'gvideo_prepare_picture'); 
    2223add_event_handler('render_element_content', 'gvideo_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2); 
    2324 
Note: See TracChangeset for help on using the changeset viewer.