Ignore:
Timestamp:
Oct 23, 2012, 3:04:22 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (rv map)

File:
1 edited

Legend:

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

    r18723 r18725  
    9191*********************/
    9292static public function init($content,$element_info){
    93  
    94 
    9593  global  $template,$version,$icon_path,$page,$picture,$conf;
    9694  global $user,$Css,$css_slideshow,$css_display,$liste_type;
     
    176174  if($has_pamoorama=="true"){
    177175  if($DEBUG_autosize == "c1") echo  $theImageWidth . "x" . $theImageHeight ;
    178  
    179  $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width:  '.$theImageWidth.' ,';
    180  
     176      $pattern[0] = '/width\:(.*)(\d+),/';$replacement[0] = 'width:  '.$theImageWidth.' ,'; 
    181177      if(($theImageWidth!=0)){     
    182178            $content=  preg_replace($pattern, $replacement, $content);
     
    188184      return  $content;
    189185  }
    190 
     186if(isset($_GET['map'])){
     187return  $content;
     188}
    191189 $pattern[0] = '/width\:(.*)(\d+)px/';$replacement[0] = 'width:100% ';
    192190 $pattern[1] = '/height\:(.*)(\d+)px/';$replacement[1] = 'height:100% ';
     
    195193
    196194if ( preg_match("|charlie|", $content, $val) ){   
    197 
    198 
    199195  $ncount=1;   
    200196  $content=str_replace( "<object" ,  "<object id='theMainImage' name='theMainImage' "  ,$content,$ncount);
    201197  $content=str_replace( "<embed" ,  "<embed id='theMainImage' name='theMainImage' "  ,$content,$ncount);
    202198  $content=  preg_replace($pattern, "", $content);
    203 
    204199  $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px' >". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
    205200 $content= "<style>#theImageAndInfos{height:auto;width:auto;border:1px solid red;position:relative}
    206201  #theImage{height:auto;border:1px solid blue;align:center;text-align:center;width:100%;position:relative}
    207   #theMainImage{height:auto;border:10px solid blue;align:center;text-align:center;position:static}
    208  
    209  
     202  #theMainImage{height:auto;border:10px solid blue;align:center;text-align:center;position:static}   
    210203 </style>".$content;
    211 
    212 
    213204return  $content;
    214205 }
    215206
    216207 $content=  preg_replace($pattern, "", $content);
    217  
     208  return  $content;
    218209}//INIT
    219210
Note: See TracChangeset for help on using the changeset viewer.