Changeset 19460 for extensions/Panoramas
- Timestamp:
- Dec 16, 2012, 8:19:28 PM (11 years ago)
- Location:
- extensions/Panoramas
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Panoramas/AS_Panorama.php
r6533 r19460 12 12 global $conf, $template, $page; 13 13 $asp = & $conf['AS_panorama']; 14 if ( !stristr($image['name'], $asp['in_mode_360']) 15 and !stristr($image['name'], $asp['in_mode_180']) ) return $content; 16 if (!isset($image['image_url'])) return $content; 17 if ( isset($page['slideshow']) and $page['slideshow'] ) return $content; 18 if (isset($image['width']) and $image['width'] < $asp['min_viewport_width']) return $content; 19 $asp['image_name'] = $image['name']; 20 $asp['width'] = $image['width']; 21 $asp['height'] = $image['height']; 22 if (stristr($image['name'], $asp['in_mode_180'])) { 23 $asp['mode_360'] = 'false'; 24 $asp['name'] = str_replace($asp['in_mode_180'],'', $image['name']); 25 } 26 else { 27 $asp['name'] = str_replace($asp['in_mode_360'],'', $image['name']); 28 } 29 $template->set_filenames( 30 array('AS_panorama_content' => dirname(__FILE__) . '/template/AS_panorama_content.tpl') ); 31 $asp['Path'] = embellish_url($template->get_template_vars('ROOT_URL').ASP_PATH); 32 $asp['content'] = $content; 33 $template->assign( array( 'ASP' => $asp, ) ); 34 return $template->parse('AS_panorama_content', true); 35 } 36 } 14 //echo "<pre>"; print_r($template); echo "</pre>"; exit; 15 16 if (isset($template->files['slideshow'])) return $content; 17 if ( !stristr($image['name'], $asp['in_mode_360']) and !stristr($image['name'], $asp['in_mode_180']) ) return $content; 18 if (!isset($image['path'])) return $content; 19 if ( isset($page['slideshow']) and $page['slideshow'] ) return $content; 20 if (isset($image['width']) and $image['width'] < $asp['min_viewport_width']) return $content; 21 22 $divtag = "<img src=\""; 23 $divtag.= str_replace( "./", "", $image['path'])."\" width=\"".$image['width']."\" "; 24 $divtag.= "height=\"".$image['height']."\" "; 25 $divtag.= "alt=\"".$image['file']."\" id=\"theMainImage\" "; 26 27 if ($image['height'] > $asp['viewport_height']) { 28 $ratio = $image['width'] / $image['height']; 29 $image['height'] = $asp['viewport_height']; 30 $image['width'] = $asp['viewport_height'] * $ratio; 31 } 32 33 $asp['image_name'] = $image['name']; 34 $asp['width'] = $image['width']; 35 $asp['height'] = $image['height']; 36 if (stristr($image['name'], $asp['in_mode_180'])) { 37 $asp['mode_360'] = 'false'; 38 $asp['name'] = str_replace($asp['in_mode_180'],'', $image['name']); 39 } 40 else { 41 $asp['name'] = str_replace($asp['in_mode_360'],'', $image['name']); 42 } 43 44 $template->set_filenames( 45 array('AS_panorama_content' => dirname(__FILE__) . '/template/AS_panorama_content.tpl') ); 46 $asp['Path'] = embellish_url($template->get_template_vars('ROOT_URL').ASP_PATH); 47 $asp['content'] = $divtag; 48 $template->assign( array( 'ASP' => $asp, ) ); 49 return $template->parse('AS_panorama_content', true); 50 } 51 } 37 52 } 38 53 39 54 if ( !function_exists( 'AS_panorama_title' ) ) { 40 41 42 43 44 45 46 47 48 49 50 51 52 53 55 if ( $conf['AS_panorama']['In_name_display_removal'] ) { 56 add_event_handler('loc_end_picture', 'AS_panorama_title'); 57 function AS_panorama_title() 58 { 59 global $conf, $template; 60 $asp = & $conf['AS_panorama']; 61 $picture = $template->get_template_vars('current'); 62 if ( isset($asp['name']) ) { 63 $picture['TITLE'] = $asp['name']; 64 $template->assign('current', $picture); 65 $template->assign( array( 'ASP' => $asp, ) ); 66 } 67 } 68 } 54 69 } 55 70 … … 57 72 if ( defined('IN_ADMIN') and IN_ADMIN ) { 58 73 add_event_handler('get_admin_plugin_menu_links', 'AS_panorama_menu'); 59 60 61 62 63 64 65 66 67 68 69 74 function AS_panorama_menu($menu) 75 { 76 array_push($menu, 77 array( 78 'NAME' => 'Panoramas', 79 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/AS_Panorama_admin.php') 80 ) 81 ); 82 return $menu; 83 } 84 } 70 85 } 71 86 ?> -
extensions/Panoramas/AS_Panorama_admin.php
r6533 r19460 19 19 $nsp = array_merge($asp, $_POST); 20 20 if ( $nsp['viewport_width']=='' or !is_numeric($nsp['viewport_width']) or $nsp['viewport_width'] < 50 or $nsp['viewport_width'] > 100 ) 21 array_push($errors, l10n('Viewport width ratio is out of range (Correct range: 50-100).')); 21 array_push($errors, l10n('Viewport width ratio is out of range (Correct range: 50-100).')); 22 if ( $nsp['viewport_height']=='' or !is_numeric($nsp['viewport_height']) or $nsp['viewport_height'] < 500 or $nsp['viewport_height'] > 800 ) 23 array_push($errors, l10n('Viewport height is out of range (Correct range: 500/+).')); 22 24 if ( $nsp['min_viewport_width']=='' or !is_numeric($nsp['min_viewport_width']) or $nsp['min_viewport_width'] < 320 ) 23 25 array_push($errors, l10n('Minimal Viewport width is out of range (Correct range: 320/+).')); -
extensions/Panoramas/AS_Panorama_default.php
r6530 r19460 2 2 $default = array( 3 3 'viewport_width' => 100, 4 'viewport_height' => 500, 4 5 'min_viewport_width' => 720, 5 6 'max_viewport_width' => 1500, -
extensions/Panoramas/language/fr_FR/plugin.lang.php
r6533 r19460 27 27 $lang['Viewport maximal width [pixels >= minimal width]'] = 'Largeur maximale de la partie visible [pixels >= largeur minimale]'; 28 28 $lang['Viewport minimal width [pixels > 320]'] = 'Largeur minimale de la partie visible [pixels > 320]'; 29 $lang['Viewport height [pixels > 500]'] = 'Hauteur de la partie visible [pixels > 300]'; 29 30 $lang['Viewport width [% between 50-100]'] = 'Largeur relative de la partie visible [% between 50-100]'; 30 31 $lang['Viewport width ratio is out of range (Correct range: 50-100).'] = 'La largeur relative de la partie visible est incorrecte (Valeurs acceptables: 50-100).'; -
extensions/Panoramas/main.inc.php
r7478 r19460 1 1 <?php /* 2 2 Plugin Name: Panoramas 3 Version: auto3 Version: 2.4.5 4 4 Description: A simple panorama viewer based on jQuery 5 Plugin URI: http:// fr.piwigo.org/ext/extension_view.php?eid=2075 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=207 6 6 Author: Piwigo team & OpenStudio 7 7 Author URI: http://www.vdigital.org … … 17 17 18 18 History 19 2012-12-15 2.4.5 20 New: Add Viewport height parameter 21 Upgrade for Piwigo 2.4.5 19 22 2010-05-27 2.1.a 20 23 New: jQuery function replacement -
extensions/Panoramas/template/AS_Panorama_admin.tpl
r7840 r19460 15 15 <legend>{'Panoramas configuration'|@translate}</legend> 16 16 <table id="table"> 17 <tr> 18 <td class="label">{'Viewport height [pixels > 500]'|@translate}</td> 19 <td><input type="text" class="field" name="viewport_height" value="{$ASP.viewport_height}" size="20" maxlength="3"/></td> 20 </tr> 21 17 22 <tr> 18 23 <td class="label">{'Viewport width [% between 50-100]'|@translate}</td>
Note: See TracChangeset
for help on using the changeset viewer.