Changeset 11667


Ignore:
Timestamp:
Jul 8, 2011, 5:58:37 PM (13 years ago)
Author:
nikrou
Message:

Fix issue preventing config to be persistent.
Thanks to xtouf and Billr for reporting bug.

Update Italian translations, thanks to rio.

Location:
extensions/pwgCumulus
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • extensions/pwgCumulus/CHANGELOG

    r11344 r11667  
     1pwgCumulus 0.6.1 - 2011-07-08
     2================================
     3* Fix issue preventing config to be persistent.
     4  Thanks to xtouf and Billr for reporting bug.
     5* Update Italian translations, thanks to rio.
     6
    17pwgCumulus 0.6.0 - 2011-06-13
    28================================
  • extensions/pwgCumulus/include/admin_menu.inc.php

    r11344 r11667  
    2020// +-----------------------------------------------------------------------+
    2121
     22if (!defined('PHPWG_ROOT_PATH')) {
     23  die('Hacking attempt!');
     24}
     25
     26$save_config = false;
    2227$Positions = array('before' => l10n('Before'),
    2328                   'after' => l10n('After')
    2429                   );
    25 
    26 $position_order = $me->position_order;
    27 $position_block_id = $me->position_block_id;
    2830
    2931include_once(PHPWG_ROOT_PATH.'include/block.class.php');
     
    3739}
    3840
    39 if (!empty($_POST['pwg_cumulus_in_main_menu']) && !$me->pwg_cumulus_in_main_menu) {
    40   $me->pwg_cumulus_in_main_menu = true;
    41   $page['infos'][] = l10n('Tags cloud added in main menu');
    42   $save_config = true;
    43 } elseif (empty($_POST['pwg_cumulus_in_main_menu']) && $me->pwg_cumulus_in_main_menu) {
    44   $me->pwg_cumulus_in_main_menu = false;
    45   $page['infos'][] = l10n('Tags cloud removed from main menu');
    46   $save_config = true;
    47 }
     41if (!empty($_POST['submit'])) {
     42  if (!empty($_POST['pwg_cumulus_in_main_menu']) && $_POST['pwg_cumulus_in_main_menu']!=$me->pwg_cumulus_in_main_menu) {
     43    $me->pwg_cumulus_in_main_menu = true;
     44    $page['infos'][] = l10n('Tags cloud added in main menu');
     45    $save_config = true;
     46  } elseif (empty($_POST['pwg_cumulus_in_main_menu']) && $me->pwg_cumulus_in_main_menu) {
     47    $me->pwg_cumulus_in_main_menu = false;
     48    $page['infos'][] = l10n('Tags cloud removed from main menu');
     49    $save_config = true;
     50  }
    4851
    49 if (!empty($_POST['position_order']) && isset($Positions[$_POST['position_order']])) {
    50   $position_order = $_POST['position_order'];
    51 }
     52  if (!empty($_POST['position_order']) && isset($Positions[$_POST['position_order']])
     53      && !empty($_POST['position_block_id']) && isset($Blocks[$_POST['position_block_id']])
     54      && ($_POST['position_order']!=$me->position_order || $_POST['position_block_id']!=$me->position_block_id)) {
     55   
     56    $me->position_order = $_POST['position_order'];
     57    $me->position_block_id = $_POST['position_block_id'];
     58    $page['infos'][] = l10n('Block\'s position has been updated');   
     59    $save_config = true;
     60  }
    5261
    53 if (!empty($_POST['position_block_id']) && isset($Blocks[$_POST['position_block_id']])) {
    54   $position_block_id = $_POST['position_block_id'];
    55 }
    56 
    57 if ($position_order!=null && $position_block_id!=null) {
    58   $me->position_order = $position_order;
    59   $me->position_block_id = $position_block_id; 
    60   $page['infos'][] = l10n('Position in main menu has been updated'); 
    61   $me->save_config();
     62  if ($save_config) {
     63    $me->save_config();
     64  }
    6265}
    6366
    6467$template->assign('MENUBAR_BLOCKS', $Blocks);
    65 $template->assign('POSITION_ORDER', $position_order);
     68$template->assign('POSITION_ORDER', $me->position_order);
    6669$template->assign('POSITIONS', $Positions);
    67 $template->assign('POSITION_BLOCK_ID', $position_block_id);
     70$template->assign('POSITION_BLOCK_ID', $me->position_block_id);
    6871$template->assign('PWG_CUMULUS_IN_MAIN_MENU', $me->pwg_cumulus_in_main_menu);
    6972?>
  • extensions/pwgCumulus/include/pwgCumulusConfig.class.php

    r11344 r11667  
    3535
    3636    if (!file_exists($this->get_config_filename())) {
     37      $this->setDefaults();
    3738      $this->save_config();
    3839    }
     
    4546      $this->config = $c;
    4647    }
    47     $this->setDefaults();
    4848  }
    4949
     
    7979
    8080  private function setDefaults() {
    81     include_once $this->plugin_dir.'/default_values.inc.php';
     81    include $this->plugin_dir.'/default_values.inc.php';
    8282
    8383    foreach ($default_values as $key => $value) {
  • extensions/pwgCumulus/language/ar_SA/index.php

    r10186 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/cs_CZ/index.php

    r8033 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/de_DE/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/en_UK/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/es_ES/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/fr_FR/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/hr_HR/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/hu_HU/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/it_IT/index.php

    r11529 r11667  
    11<?php
    22// +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
     3// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2011 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 |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    86// +-----------------------------------------------------------------------+
    97// | 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                                          |
     8// | it under the terms of the GNU General Public License version 2 as     |
     9// | published by  the Free Software Foundation                            |
    1210// |                                                                       |
    1311// | This program is distributed in the hope that it will be useful, but   |
     
    1816// | You should have received a copy of the GNU General Public License     |
    1917// | 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.                                                                  |
     18// | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,            |
     19// | MA 02110-1301 USA                                                     |
    2220// +-----------------------------------------------------------------------+
    2321
  • extensions/pwgCumulus/language/lv_LV/index.php

    r7497 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/nl_NL/index.php

    r11085 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/no_NO/index.php

    r8996 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/pl_PL/index.php

    r7280 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/ru_RU/index.php

    r7455 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/sk_SK/index.php

    r7228 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/sv_SE/index.php

    r10990 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/templates/index.php

    r6851 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/language/tr_TR/index.php

    r9139 r11667  
    33// | pwgCumulus  - a plugin for Piwigo                                     |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2009-2010 Nicolas Roudaire        http://www.nikrou.net  |
     5// | Copyright(C) 2009-2011 Nicolas Roudaire        http://www.nikrou.net  |
    66// +-----------------------------------------------------------------------+
    77// | This program is free software; you can redistribute it and/or modify  |
  • extensions/pwgCumulus/main.inc.php

    r11344 r11667  
    2222/*
    2323Plugin Name: pwgCumulus
    24 Version: 0.6.0
     24Version: 0.6.1
    2525Description: add an amazing tag cloud
    2626Plugin URI: http://piwigo.org/ext/extension_view.php?eid=263
Note: See TracChangeset for help on using the changeset viewer.