Ignore:
Timestamp:
Sep 30, 2011, 1:50:32 PM (13 years ago)
Author:
Eric
Message:
  • Bug 2447 fixed : Pre-filled text are localized for installation from scratch. If language is not supported by the plugin, the default language remains English.
  • maintain.inc.php refactory : Simplify installation from scratch and make code more readable.
  • Comments in all code are more readable.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r12247 r12271  
    2929
    3030  // Get current plugin version
     31  // --------------------------
    3132  $plugin =  PluginInfos(UAM_PATH);
    3233  $version = $plugin['version'];
    3334
    3435  // Update plugin version in #_config table
     36  // ---------------------------------------
    3537  $query = '
    3638UPDATE '.CONFIG_TABLE.'
     
    4547// Check #_plugin table consistency
    4648// Only useful if a previous version upgrade has not worked correctly (rare case)
     49// ------------------------------------------------------------------------------
    4750  $query = '
    4851SELECT version
     
    133136{
    134137  // Create missing table
     138  // --------------------
    135139  $query = "
    136140ALTER TABLE ".USER_CONFIRM_MAIL_TABLE."
     
    141145
    142146  // Upgrade plugin configuration
     147  // ----------------------------
    143148        global $conf;
    144149
     
    191196
    192197  // Changing parameter name
     198  // -----------------------
    193199  $q = '
    194200UPDATE '.CONFIG_TABLE.'
     
    206212
    207213  // Upgrading ConfirmMail options
     214  // -----------------------------
    208215  $query = '
    209216SELECT value
     
    235242
    236243  // Upgrading options
     244  // -----------------
    237245  $query = '
    238246SELECT value
     
    289297
    290298  // Upgrading options
     299  // -----------------
    291300  $query = '
    292301SELECT value
     
    313322
    314323  // Insert a new config entry for futur plugin's version check
     324  // ----------------------------------------------------------
    315325  $query = '
    316326INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
     
    329339
    330340  // Upgrading options
     341  // -----------------
    331342  $query = '
    332343SELECT value
     
    352363
    353364  // Create new UAM entry in plugins table
     365  // -------------------------------------
    354366  $uam_new_version = "2.20.0";
    355367
     
    361373  pwg_query($query);
    362374
    363   // Delete old plugin entry in plugins table
     375  // Delete old plugin entry in plugins table
     376  // ----------------------------------------
    364377  $query = '
    365378DELETE FROM '.PLUGINS_TABLE.'
     
    370383  pwg_query($query);
    371384
    372   // rename directory
     385  // Rename directory
     386  // ----------------
    373387  if (!rename(PHPWG_PLUGINS_PATH.'NBC_UserAdvManager', PHPWG_PLUGINS_PATH.'UserAdvManager'))
    374388  {
     
    384398
    385399  // Upgrading options
     400  // -----------------
    386401  $query = '
    387402SELECT value
     
    409424
    410425  // Upgrading options
     426  // -----------------
    411427  $query = '
    412428SELECT value
     
    435451
    436452  // Upgrading options
     453  // -----------------
    437454  $query = '
    438455SELECT value
     
    447464
    448465  // Refactoring all configuration options
     466  // -------------------------------------
    449467  $Newconf_UAM[0] = $Newconf_UAM[0];
    450468  $Newconf_UAM[1] = $Newconf_UAM[1];
     
    484502 
    485503  // unset obsolete conf
     504  // -------------------
    486505  unset ($Newconf_UAM[35]);
    487506  unset ($Newconf_UAM[36]);
     
    501520
    502521  // Upgrading options
     522  // -----------------
    503523  $query = '
    504524SELECT value
     
    522542
    523543  // Piwigo's native tables modifications for password reset function - Add pwdreset column
     544  // --------------------------------------------------------------------------------------
    524545  $query = '
    525546SHOW COLUMNS FROM '.USERS_TABLE.'
Note: See TracChangeset for help on using the changeset viewer.