Ignore:
Timestamp:
Feb 9, 2014, 1:26:25 PM (11 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/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.