Changeset 27279


Ignore:
Timestamp:
02/09/14 13:26:25 (5 years ago)
Author:
nikrou
Message:

Fix issue with tag with an ampersand (need encoding)
Allow to choose width and height in menu (either null)

Location:
extensions/pwgCumulus
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/pwgCumulus/CHANGELOG

    r26115 r27279  
     1pwgCumulus 0.8.1 - 2014-02-09 
     2================================ 
     3* Fix issue with tag with an ampersand (need encoding) 
     4* Allow to choose width and height in menu (either null) 
     5 
    16pwgCumulus 0.8.0 - 2013-12-23 
    27================================ 
  • extensions/pwgCumulus/default_values.inc.php

    r21469 r27279  
    2424$default_values['pwg_cumulus_coeff'] = 10; 
    2525 
     26$default_values['pwg_cumulus_width_in_menu'] = '100%'; 
     27$default_values['pwg_cumulus_height_in_menu'] = '100%'; 
     28 
    2629$default_values['pwg_cumulus_mode_transparent'] = false; 
    2730$default_values['bgcolor'] = "FFFFFF"; 
  • extensions/pwgCumulus/include/admin_tags.inc.php

    r21469 r27279  
    2727 
    2828if (!empty($_POST['submit'])) { 
    29   if (!empty($_POST['pwg_cumulus_width']) && intval($_POST['pwg_cumulus_width'])!=$me->pwg_cumulus_width) { 
    30     $me->pwg_cumulus_width = intval($_POST['pwg_cumulus_width']); 
     29  if (!empty($_POST['pwg_cumulus_width']) && $_POST['pwg_cumulus_width']!=$me->pwg_cumulus_width) { 
     30    $me->pwg_cumulus_width = $_POST['pwg_cumulus_width']; 
    3131    $page['infos'][] = l10n('Width updated'); 
    3232    $save_config = true; 
    3333  } 
    34   if (!empty($_POST['pwg_cumulus_height']) && intval($_POST['pwg_cumulus_height'])!=$me->pwg_cumulus_height) { 
    35     $me->pwg_cumulus_height = intval($_POST['pwg_cumulus_height']); 
     34  if (isset($_POST['pwg_cumulus_height']) && $_POST['pwg_cumulus_height']!=$me->pwg_cumulus_height) { 
     35    $me->pwg_cumulus_height = $_POST['pwg_cumulus_height']; 
    3636    $page['infos'][] = l10n('Height updated'); 
    3737    $save_config = true; 
     
    4040    $me->pwg_cumulus_coeff = intval($_POST['pwg_cumulus_coeff']); 
    4141    $page['infos'][] = l10n('Coefficient for tags size updated'); 
     42    $save_config = true; 
     43  } 
     44 
     45  // size in menu  
     46  if (!empty($_POST['pwg_cumulus_width_in_menu']) && $_POST['pwg_cumulus_width_in_menu']!=$me->pwg_cumulus_width_in_menu) { 
     47    $me->pwg_cumulus_width_in_menu = $_POST['pwg_cumulus_width_in_menu']; 
     48    $page['infos'][] = l10n('Width in menu updated'); 
     49    $save_config = true; 
     50  } 
     51  if (isset($_POST['pwg_cumulus_height_in_menu']) && $_POST['pwg_cumulus_height_in_menu']!=$me->pwg_cumulus_height_in_menu) { 
     52    $me->pwg_cumulus_height_in_menu = $_POST['pwg_cumulus_height_in_menu']; 
     53    $page['infos'][] = l10n('Height in menu updated'); 
    4254    $save_config = true; 
    4355  } 
     
    8092$template->assign('PWG_CUMULUS_WIDTH', $me->pwg_cumulus_width);  
    8193$template->assign('PWG_CUMULUS_HEIGHT', $me->pwg_cumulus_height);  
     94$template->assign('PWG_CUMULUS_WIDTH_IN_MENU', $me->pwg_cumulus_width_in_menu);  
     95$template->assign('PWG_CUMULUS_HEIGHT_IN_MENU', $me->pwg_cumulus_height_in_menu);  
    8296$template->assign('PWG_CUMULUS_COEFF', $me->pwg_cumulus_coeff);  
    8397$template->assign('PWG_CUMULUS_MODE_TRANSPARENT', $me->pwg_cumulus_mode_transparent); 
  • extensions/pwgCumulus/include/pwgCumulusContent.class.php

    r26115 r27279  
    101101            $template->assign('PWG_CUMULUS_IMGS', PWG_CUMULUS_PLUGIN_IMGS); 
    102102       
    103             $template->assign('PWG_CUMULUS_WIDTH', $this->plugin_config->pwg_cumulus_width); 
    104             $template->assign('PWG_CUMULUS_HEIGHT', $this->plugin_config->pwg_cumulus_height); 
     103            $template->assign('PWG_CUMULUS_WIDTH', htmlspecialchars($this->plugin_config->pwg_cumulus_width,ENT_COMPAT,'UTF-8')); 
     104            $template->assign('PWG_CUMULUS_HEIGHT', htmlspecialchars($this->plugin_config->pwg_cumulus_height,ENT_COMPAT,'UTF-8')); 
     105            $template->assign('PWG_CUMULUS_WIDTH_IN_MENU', htmlspecialchars($this->plugin_config->pwg_cumulus_width_in_menu,ENT_COMPAT,'UTF-8')); 
     106            $template->assign('PWG_CUMULUS_HEIGHT_IN_MENU', htmlspecialchars($this->plugin_config->pwg_cumulus_height_in_menu,ENT_COMPAT,'UTF-8')); 
    105107            $template->assign('PWG_CUMULUS_MODE_TRANSPARENT', $this->plugin_config->pwg_cumulus_mode_transparent); 
    106             $template->assign('PWG_CUMULUS_BGCOLOR', $this->plugin_config->pwg_cumulus_bgcolor); 
    107             $template->assign('PWG_CUMULUS_COLOR1', '0x'.$this->plugin_config->pwg_cumulus_color1); 
    108             $template->assign('PWG_CUMULUS_COLOR2', '0x'.$this->plugin_config->pwg_cumulus_color2); 
    109             $template->assign('PWG_CUMULUS_HICOLOR', '0x'.$this->plugin_config->pwg_cumulus_hicolor); 
     108            $template->assign('PWG_CUMULUS_BGCOLOR', htmlspecialchars($this->plugin_config->pwg_cumulus_bgcolor,ENT_COMPAT,'UTF-8')); 
     109            $template->assign('PWG_CUMULUS_COLOR1', '0x'.htmlspecialchars($this->plugin_config->pwg_cumulus_color1,ENT_COMPAT,'UTF-8')); 
     110            $template->assign('PWG_CUMULUS_COLOR2', '0x'.htmlspecialchars($this->plugin_config->pwg_cumulus_color2,ENT_COMPAT,'UTF-8')); 
     111            $template->assign('PWG_CUMULUS_HICOLOR', '0x'.htmlspecialchars($this->plugin_config->pwg_cumulus_hicolor,ENT_COMPAT,'UTF-8')); 
    110112            foreach ($mbCumulus->data as &$tag) { 
    111113                $tag['size'] = $this->plugin_config->pwg_cumulus_coeff * $tag['level']; 
     
    113115                    $tag['URL'] = $tag['U_ADD']; 
    114116                } 
     117                $tag['display_name'] = urlencode($tag['name']); 
    115118            } 
    116119            $template->assign('PWG_CUMULUS_TAGS', $mbCumulus->data); 
  • extensions/pwgCumulus/language/fr_FR/plugin.lang.php

    r21560 r27279  
    2626$lang['Animation configuration : size, tags colors, tags size'] = 'Configuration de l\'animation : taille, couleurs des tags, taille des tags'; 
    2727$lang['Animation width and height'] = 'Dimensions de l\'animation'; 
     28$lang['Animation width and height in menu'] = 'Dimensions de l\'animation dans le menu'; 
    2829$lang['Background color'] = 'Couleur de fond'; 
    2930$lang['Background color updated'] = 'La couleur de fond a été mise à jour'; 
     
    5859$lang['Width'] = 'Largeur'; 
    5960$lang['Width updated'] = 'La largeur a été mise à jour'; 
     61$lang['Width or height can be null to allow animation using all the space'] = 'Vous pouvez omettre (valeur nulle ou vide) la largeur ou la hauteur pour que l\'animation occupe toute la place disponible.'; 
    6062$lang['You can choose that mode for tags default display mode by adding (or changing) in the configuration file'] = 'Vous pouvez choisir ce mode d\'affichage du nuage de tags en ajoutant le mode par défaut dans le fichier de configuration'; 
    6163$lang['You can choose to add cumulus tag cloud in menu. You can define tags cloud position in the main menu by choosing its position related to another block'] = 'Vous pouvez ajouter le nuage Cumulus dans le menu principal. Vous pouvez définir la position du nuage par rapport à un autre bloc de menu'; 
  • extensions/pwgCumulus/language/templates/plugin.lang.php

    r21469 r27279  
    2626$lang['Animation configuration : size, tags colors, tags size'] = ''; 
    2727$lang['Animation width and height'] = ''; 
     28$lang['Animation width and height in menu'] = ''; 
    2829$lang['Background color'] = ''; 
    2930$lang['Background color updated'] = ''; 
     
    4344$lang['Height'] = ''; 
    4445$lang['Height updated'] = ''; 
     46$lang['Height in menu updated'] = ''; 
    4547$lang['Menu'] = ''; 
    4648$lang['Mouseover color'] = ''; 
     
    5961$lang['Width'] = ''; 
    6062$lang['Width updated'] = ''; 
     63$lang['Width in menu updated'] = ''; 
     64$lang['Width or height can be null to allow animation using all the space'] = ''; 
    6165$lang['You can choose that mode for tags default display mode by adding (or changing) in the configuration file'] = ''; 
    6266$lang['You can choose to add cumulus tag cloud in menu. You can define tags cloud position in the main menu by choosing its position related to another block'] = ''; 
  • extensions/pwgCumulus/main.inc.php

    r26115 r27279  
    2222/* 
    2323Plugin Name: pwgCumulus 
    24 Version: 0.8.0 
     24Version: 0.8.1 
    2525Description: add an amazing tag cloud 
    2626Plugin URI: http://piwigo.org/ext/extension_view.php?eid=263 
  • extensions/pwgCumulus/template/admin_tags.tpl

    r11344 r27279  
    1919      </label> 
    2020    </p> 
     21    <p class="info">({'Width or height can be null to allow animation using all the space'|@translate})</p> 
     22  </fieldset> 
     23 
     24  <fieldset> 
     25    <legend>{'Animation width and height in menu'|@translate}</legend> 
     26    <p class="field"> 
     27      <label>{'Width'|@translate} 
     28        <input type="text" name="pwg_cumulus_width_in_menu" value="{$PWG_CUMULUS_WIDTH_IN_MENU}"> 
     29      </label> 
     30    </p> 
     31    <p class="field"> 
     32      <label>{'Height'|@translate} 
     33      <input type="text" name="pwg_cumulus_height_in_menu" value="{$PWG_CUMULUS_HEIGHT_IN_MENU}"> 
     34      </label> 
     35    </p> 
     36    <p class="info">({'Width or height can be null to allow animation using all the space'|@translate})</p> 
    2137  </fieldset> 
    2238   
  • extensions/pwgCumulus/template/menubar_tags.tpl

    r11344 r27279  
    22<dd> 
    33  <div id="menuTagCloud"> 
    4     <object data="{$PWG_CUMULUS_SWF}/tagcloud.swf" width="100%" type="application/x-shockwave-flash"> 
     4    <object data="{$PWG_CUMULUS_SWF}/tagcloud.swf"  
     5            {if !empty($PWG_CUMULUS_WIDTH_IN_MENU)}width="{$PWG_CUMULUS_WIDTH_IN_MENU}" {/if} 
     6            {if !empty($PWG_CUMULUS_HEIGHT_IN_MENU)}height="{$PWG_CUMULUS_HEIGHT_IN_MENU}" {/if} 
     7            type="application/x-shockwave-flash"> 
    58      <param name="movie" value="{$PWG_CUMULUS_SWF}/tagcloud.swf"> 
    69      <param name="allowScriptAccess" value="sameDomain"> 
     
    1013      {else} 
    1114      <param name="bgcolor" value="#{$PWG_CUMULUS_BGCOLOR}"> 
    12     {/if} 
    13       <param name="flashvars" value="mode=tags&tcolor={$PWG_CUMULUS_COLOR1}&tcolor2={$PWG_CUMULUS_COLOR2}&hicolor={$PWG_CUMULUS_HICOLOR}&tspeed=100&distr=true&tagcloud=<tags>{foreach from=$PWG_CUMULUS_TAGS item=tag}<a href='{$tag.URL}' style='{$tag.size}pt'>{$tag.name}</a>{/foreach}</tags>"> 
     15      {/if} 
     16      <param name="flashvars" value="mode=tags&tcolor={$PWG_CUMULUS_COLOR1}&tcolor2={$PWG_CUMULUS_COLOR2}&hicolor={$PWG_CUMULUS_HICOLOR}&tspeed=100&distr=true&tagcloud=<tags>{foreach from=$PWG_CUMULUS_TAGS item=tag}<a href='{$tag.URL}' style='{$tag.size}pt'>{$tag.display_name}</a>{/foreach}</tags>"> 
    1417    </object> 
    1518  </div> 
  • extensions/pwgCumulus/template/tags.tpl

    r26115 r27279  
    4444 
    4545  {if $display_mode == 'cumulus'} 
    46   <object data="{$PWG_CUMULUS_SWF}/tagcloud.swf" width="{$PWG_CUMULUS_WIDTH}" height="{$PWG_CUMULUS_HEIGHT}" type="application/x-shockwave-flash"> 
     46  <object data="{$PWG_CUMULUS_SWF}/tagcloud.swf"  
     47          {if !empty($PWG_CUMULUS_WIDTH)}width="{$PWG_CUMULUS_WIDTH}" {/if} 
     48          {if !empty($PWG_CUMULUS_HEIGHT)}height="{$PWG_CUMULUS_HEIGHT}" {/if} 
     49          type="application/x-shockwave-flash"> 
    4750    <param name="movie" value="{$PWG_CUMULUS_SWF}/tagcloud.swf"> 
    4851    <param name="allowScriptAccess" value="sameDomain"> 
Note: See TracChangeset for help on using the changeset viewer.