Ignore:
Timestamp:
Apr 13, 2013, 4:53:32 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize update to piwigo 2.5 (fix init)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/main.inc.php

    r22133 r22191  
    11<?php
    22/*
    3 Plugin Name: AutoSize
     3 Plugin Name: AutoSize
    44Version: 3.1.1
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
     
    77Author: cljosse
    88Author URI:http://cljosse.free.fr
    9 */ 
     9*/
    1010/*****************************************
    11 *Ajouter .contentWithMenu{ margin-left:0 } dans themes montblanc
     11 *Ajouter .contentWithMenu{ margin-left:0 } dans themes montblanc
    1212*
    1313*****************************************/
    1414if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    15 if (!defined('AUTOSIZE_PATH')) 
    16 define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
    17 if (!defined('ROOT_URL')) 
    18 define(  'ROOT_URL',  get_root_url().'/' );
    19  
    20 if (!defined('AUTOSIZE_PATH_ABS')) 
    21 define(
    22   'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/"
    23 );
     15if (!defined('AUTOSIZE_PATH'))
     16        define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
     17if (!defined('ROOT_URL'))
     18        define(  'ROOT_URL',  get_root_url().'/' );
     19
     20if (!defined('AUTOSIZE_PATH_ABS'))
     21        define(
     22                        'AUTOSIZE_PATH_ABS',  realpath(AUTOSIZE_PATH)."/"
     23        );
    2424
    2525global $conf ;
    26   if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
    27       $DEBUG_autosize="";
    28   }else{
    29     $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
    30     $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
    31     $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;   
    32     }
    33 
    34 if(preg_match("|NO|", $DEBUG_autosize, $val)) { 
     26//================================================================
     27global $DEBUG_autosize;
     28if( isset($_GET['cl_debug']) && $_GET['cl_debug'] =='false') {
     29        $DEBUG_autosize="";
     30}else{
     31        $DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "" ;
     32        $DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] :  $DEBUG_autosize ;
     33        $DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug']."," . $DEBUG_autosize : $DEBUG_autosize ;
     34        //===============================================================
     35}
     36if(preg_match("|NO|", $DEBUG_autosize, $val)) {
    3537
    3638}else{
    37 //==================================================================
    38         include(AUTOSIZE_PATH."include/constants.php");           
     39        //==================================================================
     40        include(AUTOSIZE_PATH."include/constants.php");
    3941        include_once(AUTOSIZE_PATH.'autosize.inc.php');
    40 //==================================================================
    41 global $page,$autosize_ctrl;
    42 if (!isset( $page['start'])) {
    43  $page['start']=0;
    44  }
    45 $autosize_ctrl = new autosize_ctrl();
    46 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_ctrl,'cl_autosize_admin')  );
    47 
    48 //===============================================================
    49 if(!preg_match("|NO|", $DEBUG_autosize, $val)) { 
    50  // EVENT_HANDLER_PRIORITY_NEUTRAL=80
    51     add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2);
    52     add_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'),EVENT_HANDLER_PRIORITY_NEUTRAL-9,2);
    53     add_event_handler('render_element_content',  array(&$autosize_ctrl,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
    54     add_event_handler('render_element_content',  array(&$autosize_ctrl,'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
    55     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1') );
    56     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')  );
    57     add_event_handler('loc_after_page_header',array(&$autosize_ctrl, 'cl_autosize_script_3')  );
    58     add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
    59     if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$autosize_ctrl, 'init_3'), EVENT_HANDLER_PRIORITY_NEUTRAL+6);
    60     }
     42        //==================================================================
     43        global $page,$autosize_ctrl;
     44        if (!isset( $page['start'])) {
     45                $page['start']=0;
     46        }
     47        $autosize_ctrl = new autosize_ctrl();
     48        add_event_handler('get_admin_plugin_menu_links', array(&$autosize_ctrl,'cl_autosize_admin')  );
     49        //===============================================================
     50        if(!preg_match("|NO|", $DEBUG_autosize, $val)) {
     51                // EVENT_HANDLER_PRIORITY_NEUTRAL=80
     52                global $autosize_ctrl;
     53                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'),EVENT_HANDLER_PRIORITY_NEUTRAL-11,2);
     54                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'),EVENT_HANDLER_PRIORITY_NEUTRAL-9,2);
     55                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2  );
     56                                add_event_handler('render_element_content', array(&$autosize_ctrl, 'init2'),EVENT_HANDLER_PRIORITY_NEUTRAL+1,2  );
     57                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1') );
     58                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2')  );
     59                                add_event_handler('loc_after_page_header',  array(&$autosize_ctrl, 'cl_autosize_script_3')  );
     60                                add_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL +21    );
     61                        if(!isset($_GET['slideshow'])) add_event_handler('loc_begin_picture', array(&$autosize_ctrl, 'init_3'), EVENT_HANDLER_PRIORITY_NEUTRAL+6);
     62        }
    6163} ;
    6264
    63      
     65
    6466
    6567
Note: See TracChangeset for help on using the changeset viewer.