Changeset 11948


Ignore:
Timestamp:
Aug 14, 2011, 7:07:14 PM (13 years ago)
Author:
flop25
Message:

new parameters in database and managed by the admin page
fr lang updated
need translations

Location:
extensions/imgpreview
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/imgpreview/admin/admin.php

    r11098 r11948  
    1616        $newconf_plugin .= '#';
    1717        $newconf_plugin .= (isset($_POST['max-height']) and preg_match("#^[0-9]+$#",$_POST['max-height'])) ? $_POST['max-height'] : $conf_imgp[1];
     18        $newconf_plugin .= '#';
     19        $newconf_plugin .= (isset($_POST['show-title'])) ? "true" : "false";
     20        $newconf_plugin .= '#';
     21        $newconf_plugin .= (isset($_POST['opacity'])) ? "true" : "false";
    1822        conf_update_param('imgpreview', pwg_db_real_escape_string($newconf_plugin));                           
    1923        array_push($page['infos'], l10n('imgp_conf_updated'));
     
    2226load_conf_from_db();
    2327$conf_imgp = explode("#" , $conf['imgpreview']);
    24 
     28$val_title=(isset($conf_imgp[2]) and $conf_imgp[2]=="true") ? "checked" : "";
     29$val_opacity=(isset($conf_imgp[3]) and $conf_imgp[3]=="true") ? "checked" : "";
    2530$template->assign(
    2631        array(
    2732                'MAX_W' => 'value="'.$conf_imgp[0].'"',
    2833                'MAX_H' => 'value="'.$conf_imgp[1].'"',
     34                'SHOW_TITTLE' => $val_title,
     35                'OPACITY' => $val_opacity,
    2936                'PWG_TOKEN' => get_pwg_token()
    3037        )
  • extensions/imgpreview/admin/admin.tpl

    r11098 r11948  
    1010    <input name="max-height" type="text" size="5" {$MAX_H} />
    1111    px<br />
     12    <br />
     13    {'imgp_showtitle'|@translate}<input type="checkbox" name="show-title" {$SHOW_TITTLE}><br />
     14    {'imgp_opacity'|@translate}<input type="checkbox" name="opacity" {$OPACITY}><br />
     15    <br />
    1216    <input name="envoi_config" type="hidden" value="imgpreview" />
    1317    <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
     
    1519  </form>
    1620</fieldset>
    17 <hr />
     21
     22<fieldset>
    1823<div style="text-align:left">
    1924  {'imgp_howitworks'|@translate}
    2025</div>
     26</fieldset>
  • extensions/imgpreview/css_js.tpl

    r11086 r11948  
    11{combine_script id='jquery.imgpreview' load='header' require='jquery' path='plugins/imgpreview/js/imgpreview.js'}
    2 {combine_script id='imgpreview.init' load='footer' require='jquery.imgpreview' path='plugins/imgpreview/js/init.js'}
     2
     3{footer_script require='jquery.imgpreview'}
     4{if isset($imgpreview)}
     5{literal}
     6$('.thumbnails a, #thumbnails a').imgPreview({
     7    containerID: 'tooltip',
     8                srcAttr: 'imgsrc',
     9                considerBorders:'true',
     10    // When container is shown:
     11    onShow: function(link){
     12      {/literal}{if $imgpreview.title=="true"}{literal}
     13      $('<span>' + $(link).children().attr("title") + '</span>').appendTo(this);
     14     
     15      {/literal}{/if}{if $imgpreview.opacity=="true"}{literal}
     16      $(link).stop().animate({opacity:0.4});
     17      // Reset image:
     18      $('img', this).stop().css({opacity:0});
     19      {/literal}{/if}{literal}
     20    },
     21    onLoad: function(){
     22      {/literal}{if $imgpreview.opacity=="true"}{literal}
     23      $(this).animate({opacity:1}, 300);
     24      {/literal}{/if}{literal}
     25    },
     26    // When container hides:
     27    onHide: function(link){
     28      {/literal}{if $imgpreview.title=="true"}{literal}
     29      $('span', this).remove();
     30      {/literal}{/if}{if $imgpreview.opacity=="true"}{literal}
     31      $(link).stop().animate({opacity:1});
     32      {/literal}{/if}{literal}
     33    }
     34});
     35
     36{/literal}
     37{/if}
     38{/footer_script}
     39
    340{combine_css path="plugins/imgpreview/css/imgpreview.css"}
    441{if isset($imgpreview)}
  • extensions/imgpreview/language/fr_FR/plugin.lang.php

    r11086 r11948  
    22$lang['imgp_max_width'] = 'largeur maximum de l\'image';
    33$lang['imgp_max_height'] = 'hauteur maximum de l\'image';
     4$lang['imgp_showtitle'] = 'Afficher le nom de l\'image';
     5$lang['imgp_opacity'] = 'Faire un effet de transparence au survol';
    46$lang['imgp_send'] = 'Envoyer !';
    57
     
    810
    911
    10 $lang['imgp_howitworks'] = 'utilise :<br>
     12$lang['imgp_howitworks'] = '
     13L\'auteur de ce plugin <a href="http://www.planete-flop.fr">Flop25</a> vous recommande :
     14<ul>
     15<li><a href="http://piwigo.org/ext/extension_view.php?eid=190">PWG Stuff</a> par P@t : ce plugin permet l\'ajout de blocs (Bloc personnel-Derniers commentaires-Images au hasard...) sur votre galerie</li>
     16<li><a href="http://piwigo.org/ext/extension_view.php?eid=527">Icons Set</a> par Flop25 : ce plugin permet d\'attribuer à n\'importe quels thèmes, un autre set d\'icônes</li>
     17<li><a href="http://piwigo.org/ext/extension_view.php?eid=231">Flop Style</a> par Flop25 : flop_style est un "Template (modèle)" ou "template-extension" : il permet de modifier une petite partie de votre galerie telle que les catégories ou les miniatures sans changer de thème</li>
     18<li><a href="http://piwigo.org/ext/">et bien plus d\'extensions sur piwigo.org</a></li>
     19</ul>
     20<br>
     21Pour les designers : sachez que la vignette est entièrement personnalisable avec l\'id #tooltip (img pour l\'image ou span pour le texte)
     22<br>
     23<br>
     24Ce plugin utilise une version modifiée de :<br>
    1125 * imgPreview jQuery plugin <br>
    1226 * Copyright (c) 2009 James Padolsey<br>
     
    1630 * @author James Padolsey<br>
    1731 * @version 0.22<br>
     32 <br>
     33<br>
     34<a href="http://fr.piwigo.org/forum/">En cas de problèmes, le forum de Piwigo -fort de sa communauté très active- vous aidera.</a>
    1835';
    1936
  • extensions/imgpreview/main.inc.php

    r11086 r11948  
    3030
    3131        $conf_imgp = explode("#" , $conf['imgpreview']);
    32         $imgpreview=array( 'width' => $conf_imgp[0], 'height' => $conf_imgp[1] );
     32        $imgpreview=array( 'width' => $conf_imgp[0], 'height' => $conf_imgp[1], 'title' => $conf_imgp[2], 'opacity' => $conf_imgp[3] );
    3333        $template->assign(array(
    3434                'imgpreview' => $imgpreview
  • extensions/imgpreview/maintain.inc.php

    r11091 r11948  
    77INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
    88        VALUES
    9         ("imgpreview" , "600#600" , "max-width#max-height");';
     9        ("imgpreview" , "600#600#true#true" , "max-width#max-height#title#opacity");';
    1010    pwg_query($q);
    1111
     
    1616function plugin_activate()
    1717{
    18     global $prefixeTable;
     18  global $prefixeTable, $conf;
     19        //////////// Check Config
     20        $query = '
     21        SELECT COUNT(*) AS result FROM '.CONFIG_TABLE.'
     22        WHERE param IN (\'imgpreview\')
     23        ;';
     24        $data_table = pwg_db_fetch_assoc(pwg_query($query));
     25        $exist = $data_table['result'];
     26        if ( $exist == 0 )
     27        {
     28                plugin_install();
     29        }
     30        else {
     31                load_conf_from_db();
     32
     33                if (count(explode("#" , $conf['imgpreview']))!=4)
     34                {
     35                        pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'imgpreview\')');
     36                        pwg_query($q);
     37                        plugin_install();
     38                }
     39        }
    1940}//fin active
    2041
Note: See TracChangeset for help on using the changeset viewer.