Changeset 10028


Ignore:
Timestamp:
Apr 4, 2011, 12:28:50 AM (13 years ago)
Author:
patdenice
Message:

Display missing extension before major upgrade

Location:
extensions/autoupdate/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/trunk/include/autoupdate.class.php

    r9740 r10028  
    99  var $themes;
    1010  var $languages;
     11  var $missing = array();
     12  var $default_plugins = array();
     13  var $default_themes = array();
     14  var $default_languages = array();
    1115
    1216  function autoupdate()
    1317  {
    1418    $this->types = array('plugins', 'themes', 'languages');
     19    $this->default_themes = array('clear', 'dark', 'Sylvia');
     20    $this->default_plugins = array('admin_multi_view', 'c13y_upgrade', 'language_switch', 'LocalFilesEditor');
    1521
    1622    foreach ($this->types as $type)
     
    3440  }
    3541
    36   function get_server_extensions()
     42  function get_server_extensions($version=PHPWG_VERSION)
    3743  {
    3844    global $user;
     
    4349
    4450    // Retrieve PEM versions
    45     $version = PHPWG_VERSION;
    4651    $versions_to_check = array();
    4752    $url = PEM_URL . '/api/get_version_list.php';
     
    108113          $server = 'server_'.$ext_to_check[$ext['extension_id']];
    109114          $this->$ext_to_check[$ext['extension_id']]->$server += array($ext['extension_id'] => $ext);
    110         }
    111       }
     115          unset($ext_to_check[$ext['extension_id']]);
     116        }
     117      }
     118      $this->check_missing_extensions($ext_to_check);
    112119      return true;
    113120    }
     
    183190  }
    184191
     192  function check_missing_extensions($missing)
     193  {
     194    foreach ($missing as $id => $type)
     195    {
     196      $fs = 'fs_'.$type;
     197      $default = 'default_'.$type;
     198      foreach ($this->$type->$fs as $ext_id => $ext)
     199      {
     200        if (isset($ext['extension']) and $id == $ext['extension'] and !in_array($ext_id, $this->$default))
     201        {
     202          $this->missing[$type][] = $ext;
     203          break;
     204        }
     205      }
     206    }
     207  }
     208
    185209  function version_compare($a, $b, $type)
    186210  {
  • extensions/autoupdate/trunk/language/ar_SA/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/cs_CZ/plugin.lang.php

    r9746 r10028  
    4848$lang['All extensions are up to date.'] = 'Všechny moduly a rozšíření jsou nyní aktuální.';
    4949$lang['Update in progress...'] = 'Probíhá aktualizace...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/da_DK/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/de_DE/plugin.lang.php

    r9732 r10028  
    4848$lang['All extensions are up to date.'] = 'Alle Erweiterungen sind auf dem neuesten Stand.';
    4949$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/en_UK/plugin.lang.php

    r9735 r10028  
    4848$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949$lang['Update in progress...'] = 'Update in progress...';
     50
     51$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     52$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     53$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5054?>
  • extensions/autoupdate/trunk/language/es_ES/plugin.lang.php

    r9731 r10028  
    4848$lang['All extensions are up to date.'] = 'Todas las extensiones estan actualizadas.';
    4949$lang['Update in progress...'] = 'Actualización en curso...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/fr_FR/plugin.lang.php

    r9721 r10028  
    4848$lang['All extensions are up to date.'] = 'Toutes les extensions sont à jour.';
    4949$lang['Update in progress...'] = 'Mise à jour en cours...';
     50
     51$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Les plugins suivants ne seront peut-être pas compatibles avec la nouvelle version de Piwigo:';
     52$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Les thèmes suivants ne seront peut-être pas compatibles avec la nouvelle version de Piwigo:';
     53$lang['I decide to upgrade anyway'] = 'Je décide de migrer quand même';
    5054?>
  • extensions/autoupdate/trunk/language/hr_HR/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/hu_HU/plugin.lang.php

    r9722 r10028  
    4949$lang['All extensions are up to date.'] = 'Az összes bővítmény naprakész.';
    5050$lang['Update in progress...'] = 'Frissítés folyamatban...';
     51/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     53/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5154?>
  • extensions/autoupdate/trunk/language/it_IT/plugin.lang.php

    r9733 r10028  
    4848$lang['All extensions are up to date.'] = 'Tutte le estensioni sono aggiornati.';
    4949$lang['Update in progress...'] = 'Aggiornamento in corso ...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/ja_JP/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/ka_GE/plugin.lang.php

    r9721 r10028  
    4949/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    5050/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     51/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     53/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5154?>
  • extensions/autoupdate/trunk/language/lv_LV/plugin.lang.php

    r9725 r10028  
    4848$lang['All extensions are up to date.'] = 'Visi paplašinājumi jau ir atjaunināti.';
    4949$lang['Update in progress...'] = 'Notiek jaunināšana...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/nl_NL/plugin.lang.php

    r9734 r10028  
    4949$lang['Update in progress...'] = 'Bezig met update...';
    5050
     51/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     53/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5154?>
  • extensions/autoupdate/trunk/language/no_NO/plugin.lang.php

    r9721 r10028  
    4747/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4848/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     49/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     50/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    4952?>
  • extensions/autoupdate/trunk/language/pl_PL/plugin.lang.php

    r9750 r10028  
    4848$lang['All extensions are up to date.'] = 'Wszystkie rozszerzenia są aktualne.';
    4949$lang['Update in progress...'] = 'Trwa aktualizacja...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/pt_PT/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/ru_RU/plugin.lang.php

    r9749 r10028  
    4848$lang['All extensions are up to date.'] = 'Все плагины соответствуют последней версии.';
    4949$lang['Update in progress...'] = 'Идет обновление...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/sk_SK/plugin.lang.php

    r9748 r10028  
    4848$lang['All extensions are up to date.'] = 'Všetky doplnky sú aktuálne.';
    4949$lang['Update in progress...'] = 'Prebieha aktualizácia...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/vi_VN/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/language/zh_CN/plugin.lang.php

    r9721 r10028  
    4848/*TODO*/$lang['All extensions are up to date.'] = 'All extensions are up to date.';
    4949/*TODO*/$lang['Update in progress...'] = 'Update in progress...';
     50/*TODO*/$lang['Following plugins may not be compatible with the new version of Piwigo:'] = 'Following plugins may not be compatible with the new version of Piwigo:';
     51/*TODO*/$lang['Following themes may not be compatible with the new version of Piwigo:'] = 'Following themes may not be compatible with the new version of Piwigo:';
     52/*TODO*/$lang['I decide to upgrade anyway'] = 'I decide to upgrade anyway';
    5053?>
  • extensions/autoupdate/trunk/template/update_pwg.tpl

    r9980 r10028  
    77    jQuery('.autoupdate_bar').show();
    88        });
     9  jQuery('[name="understand"]').click(function() {ldelim}
     10    jQuery('[name="submit"]').attr('disabled', !this.checked);
     11  });
    912});
    1013{/footer_script}
     
    7982<fieldset>
    8083  <legend>{'autoupdate_step_'|cat:$i|@translate}</legend>
    81   <p><input type="submit" name="submit" value="{'Upgrade to Piwigo %s'|@translate|@sprintf:$UPGRADE_TO}"></p>
     84  {if !empty($missing.plugins)}
     85  <p><i>{'Following plugins may not be compatible with the new version of Piwigo:'|@translate}</i></p>
     86  <p><ul>{foreach from=$missing.plugins item=plugin}<li><a href="{$plugin.uri}" class="externalLink">{$plugin.name}</a></li>{/foreach}</ul><br></p>
     87  {/if}
     88  {if !empty($missing.themes)}
     89  <p><i>{'Following themes may not be compatible with the new version of Piwigo:'|@translate}</i></p>
     90  <p><ul>{foreach from=$missing.themes item=theme}<li><a href="{$theme.uri}" class="externalLink">{$theme.name}</a></li>{/foreach}</ul><br></p>
     91  {/if}
     92  <p>
     93  {if !empty($missing.plugins) or !empty($missing.themes)}
     94  <p><label><input type="checkbox" name="understand"> &nbsp;{'I decide to upgrade anyway'|@translate}</label></p>
     95  {/if}
     96  <p><input type="submit" name="submit" value="{'Upgrade to Piwigo %s'|@translate|@sprintf:$UPGRADE_TO}" {if !empty($missing.plugins) or !empty($missing.themes)}disabled="disabled"{/if}>
     97  </p>
    8298  <p class="autoupdate_bar" style="display:none;">&nbsp; {'Update in progress...'|@translate}<br><img src="plugins/autoupdate/template/ajax-loader-bar.gif"></p>
    8399</fieldset>
  • extensions/autoupdate/trunk/update_pwg.inc.php

    r9735 r10028  
    115115    autoupdate_upgrade_to($_POST['upgrade_to'], $step);
    116116  }
     117
     118  include_once(AUTOUPDATE_PATH.'include/autoupdate.class.php');
     119  $autoupdate = new autoupdate();
     120  $autoupdate->get_server_extensions($upgrade_to);
     121  $template->assign('missing', $autoupdate->missing);
    117122}
    118123
Note: See TracChangeset for help on using the changeset viewer.