Ignore:
Timestamp:
Oct 16, 2014, 9:39:11 AM (10 years ago)
Author:
sarybe
Message:

[Thumbnail_Tooltip] Bug fix for html and double quotes in comment

Location:
extensions/ThumbnailTooltip/admin
Files:
5 edited

Legend:

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

    r28187 r30100  
    11<?php
     2
    23if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     4
     5
    36
    47global $template, $conf;
    58
     9
     10
    611load_language('plugin.lang', thumbnail_tooltip_PATH);
     12
    713include(dirname(__FILE__).'/config_default.inc.php');
     14
    815$params = array_merge($config_default, unserialize($conf['thumbnail_tooltip']));
    916
     17
     18
    1019if (isset($_POST['submit'])) {
     20
    1121  $params  = array(
     22
    1223    'display_name'      => $_POST['display_name'] ? true : false,
     24
    1325    'value1'            => $_POST['value1'],
     26
    1427    'value2'            => $_POST['value2'],
     28
    1529    'value3'            => $_POST['value3'],
     30
    1631    'value4'            => $_POST['value4'],
     32
    1733    'value5'            => $_POST['value5'],
     34
    1835    'value6'            => $_POST['value6'],
     36
    1937    'separator'         => $_POST['separator'],
     38
    2039    'display_author_cat' => $_POST['display_author_cat']
     40
    2141  );
    2242
     43
     44
    2345  $query = '
     46
    2447  UPDATE ' . CONFIG_TABLE . '
     48
    2549  SET value="' . addslashes(serialize($params)) . '"
     50
    2651  WHERE param="thumbnail_tooltip"
     52
    2753  LIMIT 1';
     54
    2855  pwg_query($query);
     56
    2957  array_push($page['infos'], l10n('tn_configuration_saved'));
     58
    3059}
    3160
    3261
     62
     63
     64
    3365if (isset($_POST['restore'])) {
     66
    3467  $params  = $config_default;
    3568
     69
     70
    3671  $query = '
     72
    3773  UPDATE ' . CONFIG_TABLE . '
     74
    3875  SET value="' . addslashes(serialize($params)) . '"
     76
    3977  WHERE param="thumbnail_tooltip"
     78
    4079  LIMIT 1';
     80
    4181  pwg_query($query);
     82
    4283  array_push($page['infos'], l10n('tn_default_parameters_saved'));
     84
    4385}
    4486
    4587
     88
     89
     90
    4691$template->assign(array(
     92
    4793  'DISPLAY_NAME'         => $params['display_name'],
     94
    4895  'VALUE1'               => $params['value1'],
     96
    4997  'VALUE2'               => $params['value2'],
     98
    5099  'VALUE3'               => $params['value3'],
     100
    51101  'VALUE4'               => $params['value4'],
     102
    52103  'VALUE5'               => $params['value5'],
     104
    53105  'VALUE6'               => $params['value6'],
     106
    54107  'SEPARATOR'            => $params['separator'],
     108
    55109  'DISPLAY_AUTHOR_CAT'   => $params['display_author_cat']
     110
    56111));
    57112
    58113
     114
     115
     116
    59117$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl'));
     118
    60119$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     120
    61121?>
  • extensions/ThumbnailTooltip/admin/admin.tpl

    r28262 r30100  
    11<div class="titrePage">
     2
    23<h2>Thumbnail Tooltip</h2>
     4
    35</div>
    46
     7
     8
    59<form action="" method="post">
    610
     11
     12
    713<fieldset>
     14
    815<legend>{'tn_display_img'|@translate}</legend>
     16
    917<table>
     18
    1019  <tr>
     20
    1121    <td align="right" nowrap="nowrap">{'tn_display_name_img'|@translate} : &nbsp;&nbsp;</td>
     22
    1223    <td><input type="radio" name="display_name" value="1" {if $DISPLAY_NAME}checked="checked"{/if} onClick="javascript: jQuery('.name_link').show();"> {'tn_yes'|@translate} &nbsp;
     24
    1325        <input type="radio" name="display_name" value="0" {if !$DISPLAY_NAME}checked="checked"{/if} onClick="javascript: jQuery('.name_link').hide();"> {'tn_no'|@translate}
    14     </td>
     26
     27    </td>
     28
    1529  </tr>
     30
    1631 
    17   <tr><td>&nbsp;</td></tr>
     32
     33  <tr><td>&nbsp;</td></tr>
     34
     35
    1836
    1937  <tr class="name_link">
     38
    2039    <td align="right" nowrap="nowrap">{'tn_name_link'|@translate} : &nbsp;&nbsp;</td>
     40
    2141    <td><select name="value1" style="widht:30px">
     42
    2243          <option value="tn_type1" {if $VALUE1 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     44
    2345          <option value="tn_type2" {if $VALUE1 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     46
    2447          <option value="tn_type3" {if $VALUE1 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     48
    2549          <option value="tn_type4" {if $VALUE1 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     50
    2651          <option value="tn_type5" {if $VALUE1 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     52
    2753          <option value="tn_type6" {if $VALUE1 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     54
    2855          <option value="tn_type7" {if $VALUE1 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     56
    2957          <option value="tn_type8" {if $VALUE1 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     58
    3059          <option value="tn_type9" {if $VALUE1 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    31         </select>
     60
     61        </select>
     62
    3263                <select name="value2" style="widht:30px">
     64
    3365          <option value="none" {if $VALUE2 == 'tn_none'}selected="selected"{/if}>{'tn_none'|@translate}</option>
     66
    3467          <option value="tn_type1" {if $VALUE2 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     68
    3569          <option value="tn_type2" {if $VALUE2 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     70
    3671          <option value="tn_type3" {if $VALUE2 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     72
    3773          <option value="tn_type4" {if $VALUE2 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     74
    3875          <option value="tn_type5" {if $VALUE2 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     76
    3977          <option value="tn_type6" {if $VALUE2 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     78
    4079          <option value="tn_type7" {if $VALUE2 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     80
    4181          <option value="tn_type8" {if $VALUE2 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     82
    4283          <option value="tn_type9" {if $VALUE2 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    43         </select>
     84
     85        </select>
     86
    4487                <select name="value3" style="widht:30px">
     88
    4589          <option value="none" {if $VALUE3 == 'tn_none'}selected="selected"{/if}>{'tn_none'|@translate}</option>
     90
    4691          <option value="tn_type1" {if $VALUE3 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     92
    4793          <option value="tn_type2" {if $VALUE3 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     94
    4895          <option value="tn_type3" {if $VALUE3 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     96
    4997          <option value="tn_type4" {if $VALUE3 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     98
    5099          <option value="tn_type5" {if $VALUE3 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     100
    51101          <option value="tn_type6" {if $VALUE3 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     102
    52103          <option value="tn_type7" {if $VALUE3 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     104
    53105          <option value="tn_type8" {if $VALUE3 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     106
    54107          <option value="tn_type9" {if $VALUE3 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    55         </select>
     108
     109        </select>
     110
    56111                <select name="value4" style="widht:30px">
     112
    57113          <option value="none" {if $VALUE4 == 'tn_none'}selected="selected"{/if}>{'tn_none'|@translate}</option>
     114
    58115          <option value="tn_type1" {if $VALUE4 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     116
    59117          <option value="tn_type2" {if $VALUE4 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     118
    60119          <option value="tn_type3" {if $VALUE4 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     120
    61121          <option value="tn_type4" {if $VALUE4 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     122
    62123          <option value="tn_type5" {if $VALUE4 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     124
    63125          <option value="tn_type6" {if $VALUE4 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     126
    64127          <option value="tn_type7" {if $VALUE4 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     128
    65129          <option value="tn_type8" {if $VALUE4 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     130
    66131          <option value="tn_type9" {if $VALUE4 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    67         </select>
     132
     133        </select>
     134
    68135                <select name="value5" style="widht:30px">
     136
    69137          <option value="none" {if $VALUE5 == 'tn_none'}selected="selected"{/if}>{'tn_none'|@translate}</option>
     138
    70139          <option value="tn_type1" {if $VALUE5 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     140
    71141          <option value="tn_type2" {if $VALUE5 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     142
    72143          <option value="tn_type3" {if $VALUE5 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     144
    73145          <option value="tn_type4" {if $VALUE5 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     146
    74147          <option value="tn_type5" {if $VALUE5 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     148
    75149          <option value="tn_type6" {if $VALUE5 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     150
    76151          <option value="tn_type7" {if $VALUE5 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     152
    77153          <option value="tn_type8" {if $VALUE5 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     154
    78155          <option value="tn_type9" {if $VALUE5 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    79         </select>
     156
     157        </select>
     158
    80159                <select name="value6" style="widht:30px">
     160
    81161          <option value="none" {if $VALUE6 == 'tn_none'}selected="selected"{/if}>{'tn_none'|@translate}</option>
     162
    82163          <option value="tn_type1" {if $VALUE6 == 'tn_type1'}selected="selected"{/if}>{'tn_type1'|@translate}</option>
     164
    83165          <option value="tn_type2" {if $VALUE6 == 'tn_type2'}selected="selected"{/if}>{'tn_type2'|@translate}</option>
     166
    84167          <option value="tn_type3" {if $VALUE6 == 'tn_type3'}selected="selected"{/if}>{'tn_type3'|@translate}</option>
     168
    85169          <option value="tn_type4" {if $VALUE6 == 'tn_type4'}selected="selected"{/if}>{'tn_type4'|@translate}</option>
     170
    86171          <option value="tn_type5" {if $VALUE6 == 'tn_type5'}selected="selected"{/if}>{'tn_type5'|@translate}</option>
     172
    87173          <option value="tn_type6" {if $VALUE6 == 'tn_type6'}selected="selected"{/if}>{'tn_type6'|@translate}</option>
     174
    88175          <option value="tn_type7" {if $VALUE6 == 'tn_type7'}selected="selected"{/if}>{'tn_type7'|@translate}</option>
     176
    89177          <option value="tn_type8" {if $VALUE6 == 'tn_type8'}selected="selected"{/if}>{'tn_type8'|@translate}</option>
     178
    90179          <option value="tn_type9" {if $VALUE6 == 'tn_type9'}selected="selected"{/if}>{'Dimensions'|@translate} - {'Filesize'|@translate}</option>
    91         </select>
    92     </td>
    93   <tr><td>&nbsp;</td></tr>
     180
     181        </select>
     182
     183    </td>
     184
     185  <tr><td>&nbsp;</td></tr>
     186
    94187  <tr class="name_link">
     188
    95189     <td align="right" nowrap="nowrap">{'tn_separator'|@translate} : &nbsp;&nbsp;</td>
     190
    96191    <td><input type="radio" name="separator" {if $SEPARATOR}checked="checked"{/if} value="1"> {'tn_yes'|@translate} &nbsp;
     192
    97193        <input type="radio" name="separator" {if !$SEPARATOR}checked="checked"{/if} value="0"> {'tn_no'|@translate}
    98     </td>
     194
     195    </td>
     196
    99197  </tr>
     198
    100199 
    101   <tr><td>&nbsp;</td></tr>
     200
     201  <tr><td>&nbsp;</td></tr>
     202
    102203</table>
     204
    103205</fieldset>
    104206
    105207
     208
     209
     210
    106211<fieldset>
     212
    107213<legend>{'tn_display_cat'|@translate}</legend>
     214
    108215<table>
     216
    109217  <tr>
     218
    110219    <td align="right" nowrap="nowrap">{'tn_display_name_cat'|@translate} : &nbsp;&nbsp;</td>
     220
    111221    <td><input type="radio" name="display_author_cat" value="1" {if $DISPLAY_AUTHOR_CAT}checked="checked"{/if}> {'tn_yes'|@translate} &nbsp;
     222
    112223        <input type="radio" name="display_author_cat" value="0" {if !$DISPLAY_AUTHOR_CAT}checked="checked"{/if}> {'tn_no'|@translate}
    113     </td>
     224
     225    </td>
     226
    114227  </tr>
     228
    115229   
    116   <tr><td>&nbsp;</td></tr>
     230
     231  <tr><td>&nbsp;</td></tr>
     232
    117233</table>
     234
    118235</fieldset>
    119236
     237
     238
    120239<p><input type="submit" name="submit" value="{'Submit'|@translate}">
     240
    121241<input type="submit" name="restore" value="{'tn_default_parameters'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');"></p>
     242
    122243</form>
    123244
     245
     246
    124247<script type="text/javascript">
     248
    125249if (document.getElementsByName("display_name")[1].checked == true)
     250
    126251  jQuery('.name_link').hide();
     252
    127253if (document.getElementsByName("display_arrows")[1].checked == true)
     254
    128255  jQuery('.all_cat').hide();
     256
    129257</script>
  • extensions/ThumbnailTooltip/admin/config_default.inc.php

    r28210 r30100  
    11<?php
     2
    23$config_default = array(
     4
    35  'display_name'        => true,
     6
    47  'value1'              => 'tn_type1',
     8
    59  'value2'              => 'tn_type8',
     10
    611  'value3'              => 'tn_type4',
     12
    713  'value4'              => 'none',
     14
    815  'value5'              => 'none',
     16
    917  'value6'              => 'none',
     18
    1019  'separator'           => '1',
     20
    1121  'display_author_cat'  => '1'
     22
    1223);
     24
    1325?>
  • extensions/ThumbnailTooltip/admin/functions.inc.php

    r27644 r30100  
    11<?php
     2
    23add_event_handler('get_admin_plugin_menu_links', 'thumbnail_tooltip_admin_menu');
    34
     5
     6
    47function thumbnail_tooltip_admin_menu($menu)
     8
    59{
     10
    611  array_push($menu, array(
     12
    713    'NAME' => 'Thumbnail Tooltip',
     14
    815    'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin.php')));
     16
    917  return $menu;
     18
    1019}
     20
    1121?>
  • extensions/ThumbnailTooltip/admin/index.php

    r28210 r30100  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
     2
    223// +-----------------------------------------------------------------------+
    234
     5// | Piwigo - a PHP based photo gallery                                    |
     6
     7// +-----------------------------------------------------------------------+
     8
     9// | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org |
     10
     11// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
     12
     13// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
     14
     15// +-----------------------------------------------------------------------+
     16
     17// | This program is free software; you can redistribute it and/or modify  |
     18
     19// | it under the terms of the GNU General Public License as published by  |
     20
     21// | the Free Software Foundation                                          |
     22
     23// |                                                                       |
     24
     25// | This program is distributed in the hope that it will be useful, but   |
     26
     27// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     28
     29// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     30
     31// | General Public License for more details.                              |
     32
     33// |                                                                       |
     34
     35// | You should have received a copy of the GNU General Public License     |
     36
     37// | along with this program; if not, write to the Free Software           |
     38
     39// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     40
     41// | USA.                                                                  |
     42
     43// +-----------------------------------------------------------------------+
     44
     45
     46
    2447// Recursive call
     48
    2549$url = '../';
     50
    2651header( 'Request-URI: '.$url );
     52
    2753header( 'Content-Location: '.$url );
     54
    2855header( 'Location: '.$url );
     56
    2957exit();
     58
    3059?>
Note: See TracChangeset for help on using the changeset viewer.