Changeset 18115
- Timestamp:
- Sep 21, 2012, 10:54:57 AM (12 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r17545 r18115 37 37 // header ('X-UA-Compatible: IE=Edge') ; 38 38 global $template,$version,$icon_path,$page,$picture,$conf; 39 40 $current = $template->get_template_vars('current'); 41 42 $model= $_COOKIE['picture_deriv'] ; 39 40 $current = $template->get_template_vars('current'); 43 41 $has_pamoorama=isset($template->files['pamooramics_content']); 44 42 //==================================================================== 45 43 $pictureDeriv = pwg_get_session_var('picture_deriv',$conf['derivative_default_size']); 46 44 $SRC_IMG=""; 47 $selected_derivative = $current['derivatives'][$pictureDeriv]; 48 if (!isset($current['selected_derivative'])){ 45 if(isset($current['derivatives']['Autosize'])) 46 $_COOKIE['picture_deriv']="Autosize"; 47 if(isset( $_COOKIE['picture_deriv'])) 48 $model= $_COOKIE['picture_deriv'] ; 49 else 50 $model= $pictureDeriv ; 51 52 $selected_derivative = $current['derivatives'][$model]; 53 if (!isset($current['selected_derivative'])){ 54 55 $_COOKIE['picture_deriv']="Autosize"; 56 $model= $_COOKIE['picture_deriv'] ; 57 $current['SelMaxi']=ImageStdParams::get_custom(900,900); 58 $current['derivatives'][$model]=ImageStdParams::get_custom($_COOKIE['theImageWidth'], $_COOKIE['theImageHeight']); 59 60 61 $selected_derivative=$current['derivatives'][$model]; 62 $selected_derivative->type="Autosize"; 49 63 $template->append('current', array( 50 64 'selected_derivative' => $selected_derivative … … 53 67 $current = $template->get_template_vars('current'); 54 68 } 55 69 56 70 if(isset($current['derivatives'][$model])) { 57 71 $selected_derivative = $current['derivatives'][$model]; … … 60 74 $current = $template->get_template_vars('current'); 61 75 } 62 76 63 77 return $content; 64 78 … … 85 99 } 86 100 $current = $template->get_template_vars('current'); 87 101 if (!isset($current)) return ; 88 102 //=============================================================== 89 103 $derivative = $current['src_image'] ; … … 95 109 $picture['current']['image_url']=$SRC_IMG; 96 110 //=============================================================== 97 111 98 112 $user_status = $user['status'] ; 99 113 $autosize_parametres = cl_autosize_Get_Options(); … … 130 144 $model=$conf['derivative_default_size'] ; 131 145 } 132 $derivative=$current['derivatives'][$model] ;146 $derivative=$current['derivatives'][$model] ; 133 147 $img_all= $derivative->get_all($derivative->src_image); 134 148 $maxi_img=""; … … 143 157 144 158 145 159 $window_width = pwg_get_session_var('theMainImageWidth',$imgSizeWH[0]); 146 160 $window_height = pwg_get_session_var('theMainImageHeight',$imgSizeWH[1]); 147 161 148 162 if (!isset($_COOKIE['theMainImageHeight'])) setcookie('theMainImageHeight', $window_height ); 149 163 if (!isset($_COOKIE['theMainImageWidth'])) setcookie('theMainImageWidth',$window_width); 150 164 151 //echo "<div style='background-color:black;color:white' >$select_type w: $window_width x h: $window_height </div>";165 //echo "<div style='background-color:black;color:white' >$select_type w: $window_width x h: $window_height </div>"; 152 166 153 167 $last_defined=ImageStdParams::get_defined_type_map(); 168 154 169 foreach ($img_all as $img_select){ 155 170 $img_type = $img_select->get_type(); 156 171 if ($img_type=="square" || $img_type=="thumb" ) continue ; 157 172 if (!isset($last_img)) $last_img=$img_select; 158 173 $img_url = $img_select->get_url(); 159 174 $imgSizeWH = $img_select->get_size(); -
extensions/Autosize/js/Affiche_script.js
r17545 r18115 352 352 width: infos_theImage.general.width, 353 353 height: zheight, 354 margesWidth: infos_window.width - infos_theImage.width + (options.marge_droite + options.marge_gauche)354 margesWidth: infos_window.width - infos_theImage.width 355 355 } 356 356 } … … 411 411 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos(); // Cadre general 412 412 //============================================================= 413 if (Zone_image.container.margesWidth) { 414 Zone_image.container.width = infos_window.width - Zone_image.container.margesWidth; 415 } 413 416 Zone_image.container = { 414 417 height: infos_window.height - (infos_theImage.top), 415 418 width: Zone_image.container.width, 416 margesWidth: infos_window.width - infos_theImage.width419 margesWidth: Zone_image.container.margesWidth || infos_window.width - infos_theImage.width 417 420 }; 418 421 … … 1954 1957 //_______________________ init_gen _______________________ 1955 1958 1956 }); // ready1959 }); // ready 1957 1960 1958 1961 -
extensions/Autosize/main.inc.php
r17680 r18115 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 2.064 Version: auto 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448 … … 22 22 23 23 24 25 24 //================================================================== 26 25 include(AUTOSIZE_PATH."include/constants.php"); 27 26 include_once(AUTOSIZE_PATH.'autosize.inc.php'); 28 27 //================================================================== 29 global $page ;28 global $page,$autosize_controler; 30 29 if (!isset( $page['start'])) { 31 30 $page['start']=0; 32 31 } 33 34 global $autosize_controler;35 32 $autosize_controler = new autosize_controler(); 36 33 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin') ); … … 40 37 41 38 42 add_event_handler('render_element_content', array(&$autosize_controler,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL ,2 );39 add_event_handler('render_element_content', array(&$autosize_controler,'init'),EVENT_HANDLER_PRIORITY_NEUTRAL-1,2 ); 43 40 44 41 //avant pamooramics
Note: See TracChangeset
for help on using the changeset viewer.