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

Display missing extension before major upgrade

File:
1 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  {
Note: See TracChangeset for help on using the changeset viewer.