<?php
/*
Plugin Name: AutoSize
Version: 3.0.3
Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
Author: cljosse
Author URI:http://cljosse.free.fr
*/ 
/*****************************************
*Ajouter .contentWithMenu{ margin-left:0 } dans themes montblanc
*
*****************************************/
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
if (!defined('AUTOSIZE_PATH')) 
define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
if (!defined('ROOT_URL')) 
define(  'ROOT_URL',  get_root_url().'/' );
 
if (!defined('AUTOSIZE_PATH_ABS')) 
define(
  'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/"
);

global $conf ;
  if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
      $DEBUG_autosize="";
  }else{
    $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
    $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
    $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;    
    }

if(preg_match("|NO|", $DEBUG_autosize, $val)) {  

}else{
//==================================================================
	include(AUTOSIZE_PATH."include/constants.php"); 	   
	include_once(AUTOSIZE_PATH.'autosize.inc.php');
//==================================================================
global $page,$autosize_ctrl;
if (!isset( $page['start'])) {
 $page['start']=0;
 }
$autosize_ctrl = new autosize_ctrl();
add_event_handler('get_admin_plugin_menu_links', array(&$autosize_ctrl,'cl_autosize_admin')  );

//===============================================================
if(!preg_match("|NO|", $DEBUG_autosize, $val)) {  
    add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2); 
    add_event_handler('render_element_content',  array(&$autosize_ctrl,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
    add_event_handler('render_element_content',  array(&$autosize_ctrl,'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
    add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1') );
    add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')  );
    add_event_handler('loc_after_page_header',array(&$autosize_ctrl, 'cl_autosize_script_3')  );
    add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
    }
} ;

     
       

?>