Changeset 19844


Ignore:
Timestamp:
Jan 5, 2013, 4:14:21 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix bug crop

Location:
extensions/Autosize
Files:
3 edited

Legend:

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

    r19764 r19844  
    6666    }
    6767    if(preg_match("|test|", $DEBUG_autosize, $val)) {
    68     $infos_message .= "#65 autosize_calcContent: <br>";
    69        if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
     68        $infos_message .= "#65 autosize_calcContent: <br>";
     69        if ( isset($_COOKIE['pwg_id']) ) unset ($_COOKIE['pwg_id']) ;
    7070        $infos_message .=  "SESSION:"  . cl_print_var($_SESSION) ;
    7171        $infos_message .=  "COOKIE:"  . cl_print_var($_COOKIE) ;
     
    8080          self::Fin_php("#80 autosize_calcContent:" . $DEBUG_autosize );
    8181        }
    82         self::reload("#82");
    83         self::Fin_php("#83 autosize_calcContent:" + $DEBUG_autosize);
    84     } 
    85 
    86 
    87    if (!isset($_COOKIE['autosize_reload'])  ){ 
    88            if(preg_match("|test_2|", $DEBUG_autosize, $val)) {
    89           $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>";
    90            echo $infos_message;
    91           self::Fin_php("#91 autosize_calcContent:" . $DEBUG_autosize);
     82        unset($_COOKIE['autosize_reload']);
     83    }
     84    if (!isset($_COOKIE['autosize_reload'])  ){ 
     85        if(preg_match("|test_2|", $DEBUG_autosize, $val)) {
     86          $infos_message .= "not COOKIE['autosize_reload'] -> reload(): <br>";           
     87          self::Fin_php("#87 autosize_calcContent:" . $DEBUG_autosize);
    9288        }
    93           self::reload("#93");
    94           self::Fin_php("#94 autosize_calcContent:" + $DEBUG_autosize);
     89          self::reload("#89");
     90      //  self::Fin_php("#90 autosize_calcContent:" + $DEBUG_autosize);
    9591
    9692    } 
     
    120116* INIT
    121117*********************/
    122 
     118static public function init_3(){
     119 
     120}
    123121static public function init_1($content, $image)
    124122                {
     
    128126       if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content;
    129127
    130        $windowWidth=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
    131        $windowHeight=$_COOKIE['windowHeight']-130 ;
     128      $asp['min_viewport_width']=$_COOKIE['windowWidth'] -$_COOKIE['theImageLeft']-$_COOKIE['theImageRight'];
     129          $asp['viewport_height']=$_COOKIE['windowHeight']-130 ;
    132130
    133131      $asp['start_position']= 10;     
    134            $asp['min_viewport_width']= $windowWidth;     
    135             $asp['viewport_height']= $windowHeight;     
     132 
    136133      }
    137 
     134/*********************/
    138135static public function init($content,$element_info){
    139136  global  $template,$version,$icon_path,$page,$picture,$conf;
     
    914911//================= Liste =========================   
    915912  $ok= 0 ;
    916   $nofile=0 ; 
     913  $nofile=0 ;      global $max_crop;
    917914  //=============================================
    918915  // Liste mini maxi
    919916  //=============================================
    920917    foreach ($img_all as $img_select){
     918
    921919            $img_type  =  $img_select->get_type();     
    922920            $img_url  = $img_select->get_path();     
    923             $imgWH  =  $img_select->get_size();   
     921              $max_crop = 0 ;
     922            $imgWH  =  self::Get_Size($img_select);       
    924923            if ($img_type=="square" || $img_type=="thumb" ) continue ;   
    925924            if($img_type=="Autosize" || $img_type=="SelMaxi"){
     
    934933            }         
    935934             if(preg_match("|get_minfos|", $DEBUG_autosize, $val))
    936                       $infos_message .=$img_url . " -> " . $img_type ."<br >";
     935                      $infos_message .=$img_url . " " . $max_crop ." -> " . $img_type . " " . print_r($imgWH,true). " <br >";
    937936
    938937          if(file_exists(PHPWG_ROOT_PATH.$img_url)){    } // if file       
     
    10481047
    10491048  }
     1049  //=================================================================
     1050
     1051static public function Get_Size($Img_Select){
     1052      global  $max_crop;
     1053             $imgWH  =  $Img_Select->get_size();         
     1054            $img_type  =  $Img_Select->get_type();         
     1055              $smaller = ImageStdParams::get_by_type($img_type);   
     1056              $max_crop=0;
     1057              if($smaller->sizing->max_crop==1){
     1058                $imgWH  =$smaller->sizing->min_size;
     1059                 $max_crop=1;
     1060          }     
     1061          return $imgWH ;
     1062      }
    10501063//==================================================================
    10511064static public  function  cl_autosize_nofile($img_all){
  • extensions/Autosize/include/affiche.php

    r19030 r19844  
    5252    foreach ($defined_types as $type_size){
    5353      $value = $type_size;
     54      if($type_size != "square" && $type_size != "thumb" )
    5455      $options[$value] = $type_size;   
    5556    } 
  • extensions/Autosize/main.inc.php

    r19764 r19844  
    5757    add_event_handler('loc_after_page_header',array(&$autosize_ctrl, 'cl_autosize_script_3')  );
    5858    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);
    5960    }
    6061} ;
    6162
    6263     
    63        
     64
    6465
    6566?>
Note: See TracChangeset for help on using the changeset viewer.