Changeset 7912


Ignore:
Timestamp:
Nov 28, 2010, 4:36:17 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] setup cl_conflit

Location:
extensions/Autosize
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/admin/admin_autosize.php

    r7899 r7912  
    9292
    9393        $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 
    13095
    13196$version = $plugin['version'] ;
  • extensions/Autosize/admin/template/admin.tpl

    r7725 r7912  
    55     var thumbnail = '{$thumbnail}';
    66     var theme = '{$theme}';
    7      var version = '{$version}';
     7 var cl_version = '{$cl_version}';
    88     var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut
    99     var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
     
    6969{/if}
    7070<div class="titrePage">
    71                 <h2>{'Autosize'|translate} {'version'|translate}{$version}</h2>
     71                <h2>{'Autosize'|translate} {'version'|translate}{$cl_version}</h2>
    7272</div>
    7373  <span>{'cl_autosize_Howto'|translate}</span>
  • extensions/Autosize/autosize.inc.php

    r7899 r7912  
    134134 static public function cl_autosize_script_3($content)
    135135 {
    136            global  $template,$user,$conf,$picture ,$page,$cl_version, $cl_plugin ;
    137            //userDefManage ??
    138                 $my_path =  basename(dirname(__FILE__)).'/' ;
    139             $my_path = dirname(__FILE__).'/';
     136                global  $template,$user,$conf,$picture ,$page,$cl_plugin;
     137                //userDefManage ??
     138                $my_path =  basename(dirname(__FILE__)).'/' ;
     139                $my_path = dirname(__FILE__).'/';
    140140                $debug = isset($conf['debug']) ? $conf['debug'] : false ;
    141141                $cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
    142142
    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               $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n";
    150                   $template->append('head_elements',$autocss);
    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 
    152152                $autocss="<script type='text/javascript'>
    153153jQuery('#theImage').css({opacity:'0.0'});
    154154</script>";
    155155
    156 $template->append('footer_elements',"\n".$autocss);
    157 
    158 
    159 
     156                $template->append('footer_elements',"\n".$autocss);
    160157                return $content ;
    161 
    162158
    163159 }// function cl_autosize_script_3
     
    165161 static public function cl_autosize_script_2()
    166162 {
    167            global  $template,$user,$conf,$picture ,$page,$cl_version, $cl_plugin ;
     163           global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    168164           //userDefManage ??
    169165                        $my_path =  basename(dirname(__FILE__)).'/' ;
     
    174170                        $template->assign(
    175171                                        array(
    176                                         'cl_plugin' => $cl_version['id'] ,
    177                                         'version' => $cl_version['version'] ,
     172                                        'cl_version' => $cl_plugin['version'] ,
     173                                        'name' => $cl_plugin['name'] ,
    178174                                        'ma_page' =>    $page['body_id'],
    179175                                        'cl_conflit' => $cl_conflit  ,
    180176                                        'theme' => $theme  ,
    181177                                        'DEBUG' => $debug   ,
    182                                         'AUTOSIZE_PATH' => AUTOSIZE_PATH)
     178                                        'AUTOSIZE_PATH' => AUTOSIZE_PATH
     179                                        )
    183180                                                );
    184                                                  global $cl_plugin;
    185  
     181                                                 
    186182$autoscript="<script type='text/javascript'>
    187183if (typeof (save_framework) == 'function')
     
    189185</script>";
    190186                         $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 ;
    199188
    200189 }// function cl_autosize_script_2
     
    205194 static public function cl_autosize_script()
    206195        {
    207            global  $template,$user,$conf,$picture ,$page,$cl_version, $cl_plugin ;
     196           global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    208197                $my_path =  basename(dirname(__FILE__)).'/' ;
    209198            $my_path = dirname(__FILE__).'/';
     
    215204                $template->assign(
    216205                                                array(
    217                                                 'cl_plugin' => $cl_version['id'] ,
    218                                                 'version' => $cl_version['version'] ,
     206                                                'cl_version' => $cl_plugin['version'] ,
     207                                                'name' => $cl_plugin['name'] ,
    219208                                                'cl_conflit' => $cl_conflit  ,
    220209                                                'theme' => $theme  ,
  • extensions/Autosize/include/affiche.php

    r7899 r7912  
    11<?php 
     2
     3       
    24
    35$visible=(isset($visible))?$visible:false;
    46$img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
    57$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:"";
    99$theme=$user['theme'];
    1010$user_status = $user['status'] ;
    1111
    1212        $template->assign(
    13                                         array( 
    14                                         'version' => $version,
     13                                        array(
     14                                        'cl_version' => $cl_version,
    1515                                        'cl_plugin' => $cl_plugin,
    1616
  • extensions/Autosize/include/constants.php

    r6912 r7912  
    22global $prefixeTable;
    33if (!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
     42global $cl_plugin, $cl_version;
     43 $cl_version = $conflit_plugin['version'] ;
     44 $cl_plugin  = $conflit_plugin;
     45 
    446?>
  • extensions/Autosize/js/conflit.js

    r7899 r7912  
    184184
    185185            info_image = jQuery(Parent).infos();
    186             if (info_image.height==0) {
    187                 Parent = "#theImageBox";
    188             }
    189 
    190 
    191186            p0 = jQuery(Parent);
    192 
    193             if (p0.length > 0) {
    194              
    195  
     187            if (p0.length > 0) {   
     188
    196189                //======================================================
    197190                if (theme.match("gally", "gi"))
     
    199192                        if (typeof (currentTab) == "undefined") inittoolbar();
    200193                        else initializeImageMode("resize");
    201                     };
     194                   
    202195
    203196                    if (info_image.position != "static") {
     
    206199                    jQuery(Parent).css({ position: "static" } );
    207200                    jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
     201                    };
    208202                }
    209203            }
     
    429423          }
    430424          //window_1290934905697_top
    431           if (fn.match(RegExp("window_|WindowUtilities", "gi"))) {
     425          if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) {
    432426              states.push('rv_gmaps');
    433427              break;
     
    583577function save_framework(page) {
    584578    try {
    585         Conflit = { version: Version, name: cl_plugin };
     579        Conflit = { version: cl_version, name: cl_plugin };
    586580    } catch (e) {
    587581
  • extensions/Autosize/js/jquery.dimensions.js

    r7899 r7912  
    3131                    var torl = name == 'Height' ? 'Top' : 'Left',
    3232                        borr = name == 'Height' ? 'Bottom' : 'Right';
    33                     options = jQuery.extend({ margin: false },
    34                                                 options || {});
     33                    options = options || false;
     34                    options = jQuery.extend({ margin: options } );
     35
    3536                    var val = this.is(':visible') ? this[0]['offset' + name] :
    3637                        num(this,
     
    3940                        num(this, 'border' + borr + 'Width') +
    4041                        num(this, 'padding' + torl) +
    41                         num(this, 'padding' + borr);
     42                        num(this, 'padding' + borr)
     43
     44                        ;
    4245                    return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
    4346                };
  • extensions/Autosize/main.inc.php

    r7899 r7912  
    22/*
    33Plugin Name: AutoSize
    4 Version: 1.0.0
     4Version: 1.3.8.0
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
     
    1313//=================================================================================
    1414        $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');
    2018//==================================================================
    2119$autosize_controler = new autosize_controler();
  • extensions/Autosize/template/autosize.tpl

    r7899 r7912  
    88 <script type="text/javascript">
    99    var visible = '{$visible}';
    10 
    11     var DEBUG = '{$DEBUG}';
    12     var theme = '{$theme}';
    13     var Version = '{$version}';
    14     var cl_plugin = '{$cl_plugin}';
    15 
    1610    var fade_in = '{$fade_in}';
    1711    var cl_visible = "{$cl_visible}" =="true";
    18    
    1912    var thumbnail = '{$thumbnail}';
    20  
    21 
    22 
    2313    var scaled_width =  '{$SCALED_WIDTH}'; // valeur par defaut
    2414    var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
  • extensions/Autosize/template/cl_conflit.tpl

    r7816 r7912  
    77<!--- {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
    88 
    9     <!---FIN  {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
     9<!---FIN  {$AUTOSIZE_PATH} template/cl_confilt.tpl (body) --->
  • extensions/Autosize/template/conflit.tpl

    r7899 r7912  
    1111    var DEBUG = '{$DEBUG}';
    1212    var theme = '{$theme}';
    13     var Version = '{$version}';
    14     var cl_plugin = '{$cl_plugin}';
     13var cl_version = '{$cl_version}';
     14    var cl_plugin = '{$name}';
    1515</script>
    1616<!---FIN Autosize/template/confilt.tpl (/head) --->     
    1717{/html_head}
    1818<!--- Autosize/template/confilt.tpl (body) ---> 
     19
     20
    1921<!---FIN Autosize/template/confilt.tpl (body) --->     
Note: See TracChangeset for help on using the changeset viewer.