Ignore:
Timestamp:
Aug 31, 2012, 3:33:44 PM (12 years ago)
Author:
mistic100
Message:

remove Autosize on video pages, fix overlap problem with Stripped

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