Changeset 7912
- Timestamp:
- Nov 28, 2010, 4:36:17 PM (13 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/admin_autosize.php
r7899 r7912 92 92 93 93 $path = AUTOSIZE_PATH; 94 $plg_data = implode( '', file($path.'main.inc.php') ); 95 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 96 { 97 $plugin['name'] = trim( $val[1] ); 98 } 99 if (preg_match("|Version: (.*)|", $plg_data, $val)) 100 { 101 $plugin['version'] = trim($val[1]); 102 } 103 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 104 { 105 $plugin['uri'] = trim($val[1]); 106 } 107 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 108 { 109 $plugin['description'] = trim($desc); 110 } 111 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 112 { 113 $plugin['description'] = trim($val[1]); 114 } 115 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 116 { 117 $plugin['author'] = trim($val[1]); 118 } 119 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 120 { 121 $plugin['author uri'] = trim($val[1]); 122 } 123 if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) 124 { 125 list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); 126 if (is_numeric($extension)) $plugin['extension'] = $extension; 127 } 128 // IMPORTANT SECURITY ! 129 $plugin = array_map('htmlspecialchars', $plugin); 94 130 95 131 96 $version = $plugin['version'] ; -
extensions/Autosize/admin/template/admin.tpl
r7725 r7912 5 5 var thumbnail = '{$thumbnail}'; 6 6 var theme = '{$theme}'; 7 var version = '{$version}';7 var cl_version = '{$cl_version}'; 8 8 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut 9 9 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut … … 69 69 {/if} 70 70 <div class="titrePage"> 71 <h2>{'Autosize'|translate} {'version'|translate}{$ version}</h2>71 <h2>{'Autosize'|translate} {'version'|translate}{$cl_version}</h2> 72 72 </div> 73 73 <span>{'cl_autosize_Howto'|translate}</span> -
extensions/Autosize/autosize.inc.php
r7899 r7912 134 134 static public function cl_autosize_script_3($content) 135 135 { 136 global $template,$user,$conf,$picture ,$page,$cl_version, $cl_plugin;137 138 139 136 global $template,$user,$conf,$picture ,$page,$cl_plugin; 137 //userDefManage ?? 138 $my_path = basename(dirname(__FILE__)).'/' ; 139 $my_path = dirname(__FILE__).'/'; 140 140 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 141 141 $cl_conflit = isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ; 142 142 143 $ThePicture = $template->get_template_vars('current');144 $tpl_name = $user['theme'] ;145 if ( !empty($content) ) { return $content; }146 if ($ThePicture['is_picture'] <> 1 ) { return $content; ; }147 148 $autosizejs = '<script type="text/javascript" charset="utf-8" src="';149 150 151 143 $ThePicture = $template->get_template_vars('current'); 144 $tpl_name = $user['theme'] ; 145 if ( !empty($content) ) { return $content; } 146 if ($ThePicture['is_picture'] <> 1 ) { return $content; ; } 147 148 $autosizejs = '<script type="text/javascript" id="jquery" charset="utf-8" src="'; 149 $autocss = $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n"; 150 $template->append('head_elements',$autocss); 151 152 152 $autocss="<script type='text/javascript'> 153 153 jQuery('#theImage').css({opacity:'0.0'}); 154 154 </script>"; 155 155 156 $template->append('footer_elements',"\n".$autocss); 157 158 159 156 $template->append('footer_elements',"\n".$autocss); 160 157 return $content ; 161 162 158 163 159 }// function cl_autosize_script_3 … … 165 161 static public function cl_autosize_script_2() 166 162 { 167 global $template,$user,$conf,$picture ,$page, $cl_version,$cl_plugin ;163 global $template,$user,$conf,$picture ,$page, $cl_plugin ; 168 164 //userDefManage ?? 169 165 $my_path = basename(dirname(__FILE__)).'/' ; … … 174 170 $template->assign( 175 171 array( 176 'cl_ plugin' => $cl_version['id'] ,177 ' version' => $cl_version['version'] ,172 'cl_version' => $cl_plugin['version'] , 173 'name' => $cl_plugin['name'] , 178 174 'ma_page' => $page['body_id'], 179 175 'cl_conflit' => $cl_conflit , 180 176 'theme' => $theme , 181 177 'DEBUG' => $debug , 182 'AUTOSIZE_PATH' => AUTOSIZE_PATH) 178 'AUTOSIZE_PATH' => AUTOSIZE_PATH 179 ) 183 180 ); 184 global $cl_plugin; 185 181 186 182 $autoscript="<script type='text/javascript'> 187 183 if (typeof (save_framework) == 'function') … … 189 185 </script>"; 190 186 $template->append('footer_elements',$autoscript); 191 return ; 192 $template->set_filenames( 193 array('autosize_init'=>$my_path. "template/cl_conflit.tpl" 194 ) 195 ); 196 if( $page['body_id'] == 'theAdminPage' ) return ; 197 198 return $template->parse( 'autosize_init', false); 187 return ; 199 188 200 189 }// function cl_autosize_script_2 … … 205 194 static public function cl_autosize_script() 206 195 { 207 global $template,$user,$conf,$picture ,$page, $cl_version,$cl_plugin ;196 global $template,$user,$conf,$picture ,$page, $cl_plugin ; 208 197 $my_path = basename(dirname(__FILE__)).'/' ; 209 198 $my_path = dirname(__FILE__).'/'; … … 215 204 $template->assign( 216 205 array( 217 'cl_ plugin' => $cl_version['id'] ,218 ' version' => $cl_version['version'] ,206 'cl_version' => $cl_plugin['version'] , 207 'name' => $cl_plugin['name'] , 219 208 'cl_conflit' => $cl_conflit , 220 209 'theme' => $theme , -
extensions/Autosize/include/affiche.php
r7899 r7912 1 1 <?php 2 3 2 4 3 5 $visible=(isset($visible))?$visible:false; 4 6 $img_width=isset($picture['current']['width'])?$picture['current']['width']:480; 5 7 $img_height=isset($picture['current']['height'])?$picture['current']['height']:320; 6 7 $version=isset($version)?$version:""; 8 $cl_plugin=isset($cl_plugin)?$cl_plugin:""; 8 $cl_version=isset($cl_version)?$cl_version:""; 9 9 $theme=$user['theme']; 10 10 $user_status = $user['status'] ; 11 11 12 12 $template->assign( 13 array( 14 ' version' => $version,13 array( 14 'cl_version' => $cl_version, 15 15 'cl_plugin' => $cl_plugin, 16 16 -
extensions/Autosize/include/constants.php
r6912 r7912 2 2 global $prefixeTable; 3 3 if (!defined('CL_AUTOSIZE_TABLE')) define('CL_AUTOSIZE_TABLE', $prefixeTable.'cl_autosize'); 4 $path = AUTOSIZE_PATH; 5 $plg_data = implode( '', file($path.'main.inc.php') ); 6 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 7 { 8 $conflit_plugin['name'] = trim( $val[1] ); 9 } 10 if (preg_match("|Version: (.*)|", $plg_data, $val)) 11 { 12 $conflit_plugin['version'] = trim($val[1]); 13 } 14 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 15 { 16 $conflit_plugin['uri'] = trim($val[1]); 17 } 18 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 19 { 20 $conflit_plugin['description'] = trim($desc); 21 } 22 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 23 { 24 $conflit_plugin['description'] = trim($val[1]); 25 } 26 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 27 { 28 $conflit_plugin['author'] = trim($val[1]); 29 } 30 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 31 { 32 $conflit_plugin['author uri'] = trim($val[1]); 33 } 34 if (!empty($conflit_plugin['uri']) and strpos($conflit_plugin['uri'] , 'extension_view.php?eid=')) 35 { 36 list( , $extension) = explode('extension_view.php?eid=', $conflit_plugin['uri']); 37 if (is_numeric($extension)) $conflit_plugin['extension'] = $extension; 38 } 39 // IMPORTANT SECURITY ! 40 $conflit_plugin = array_map('htmlspecialchars', $conflit_plugin); 41 42 global $cl_plugin, $cl_version; 43 $cl_version = $conflit_plugin['version'] ; 44 $cl_plugin = $conflit_plugin; 45 4 46 ?> -
extensions/Autosize/js/conflit.js
r7899 r7912 184 184 185 185 info_image = jQuery(Parent).infos(); 186 if (info_image.height==0) {187 Parent = "#theImageBox";188 }189 190 191 186 p0 = jQuery(Parent); 192 193 if (p0.length > 0) { 194 195 187 if (p0.length > 0) { 188 196 189 //====================================================== 197 190 if (theme.match("gally", "gi")) … … 199 192 if (typeof (currentTab) == "undefined") inittoolbar(); 200 193 else initializeImageMode("resize"); 201 };194 202 195 203 196 if (info_image.position != "static") { … … 206 199 jQuery(Parent).css({ position: "static" } ); 207 200 jQuery("#imageToolBar").css({ position: "relative", top: "0px" }); 201 }; 208 202 } 209 203 } … … 429 423 } 430 424 //window_1290934905697_top 431 if (fn.match(RegExp("window_ |WindowUtilities", "gi"))) {425 if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) { 432 426 states.push('rv_gmaps'); 433 427 break; … … 583 577 function save_framework(page) { 584 578 try { 585 Conflit = { version: Version, name: cl_plugin };579 Conflit = { version: cl_version, name: cl_plugin }; 586 580 } catch (e) { 587 581 -
extensions/Autosize/js/jquery.dimensions.js
r7899 r7912 31 31 var torl = name == 'Height' ? 'Top' : 'Left', 32 32 borr = name == 'Height' ? 'Bottom' : 'Right'; 33 options = jQuery.extend({ margin: false }, 34 options || {}); 33 options = options || false; 34 options = jQuery.extend({ margin: options } ); 35 35 36 var val = this.is(':visible') ? this[0]['offset' + name] : 36 37 num(this, … … 39 40 num(this, 'border' + borr + 'Width') + 40 41 num(this, 'padding' + torl) + 41 num(this, 'padding' + borr); 42 num(this, 'padding' + borr) 43 44 ; 42 45 return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0); 43 46 }; -
extensions/Autosize/main.inc.php
r7899 r7912 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 1. 0.04 Version: 1.3.8.0 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 … … 13 13 //================================================================================= 14 14 $path = AUTOSIZE_PATH; 15 //================================================================== 16 global $cl_version , $cl_plugin ; 17 $cl_version = $plugin; 18 $cl_plugin = $plugin; 19 include_once(AUTOSIZE_PATH.'autosize.inc.php'); 15 //============================================================================ 16 include($path."include/constants.php"); 17 include_once(AUTOSIZE_PATH.'autosize.inc.php'); 20 18 //================================================================== 21 19 $autosize_controler = new autosize_controler(); -
extensions/Autosize/template/autosize.tpl
r7899 r7912 8 8 <script type="text/javascript"> 9 9 var visible = '{$visible}'; 10 11 var DEBUG = '{$DEBUG}';12 var theme = '{$theme}';13 var Version = '{$version}';14 var cl_plugin = '{$cl_plugin}';15 16 10 var fade_in = '{$fade_in}'; 17 11 var cl_visible = "{$cl_visible}" =="true"; 18 19 12 var thumbnail = '{$thumbnail}'; 20 21 22 23 13 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut 24 14 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut -
extensions/Autosize/template/cl_conflit.tpl
r7816 r7912 7 7 <!--- {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) ---> 8 8 9 9 <!---FIN {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) ---> -
extensions/Autosize/template/conflit.tpl
r7899 r7912 11 11 var DEBUG = '{$DEBUG}'; 12 12 var theme = '{$theme}'; 13 var Version = '{$version}';14 var cl_plugin = '{$ cl_plugin}';13 var cl_version = '{$cl_version}'; 14 var cl_plugin = '{$name}'; 15 15 </script> 16 16 <!---FIN Autosize/template/confilt.tpl (/head) ---> 17 17 {/html_head} 18 18 <!--- Autosize/template/confilt.tpl (body) ---> 19 20 19 21 <!---FIN Autosize/template/confilt.tpl (body) --->
Note: See TracChangeset
for help on using the changeset viewer.