summaryrefslogtreecommitdiffstats
path: root/includes/legacy.inc
blob: 9085dda89f13e1423c73a9696f9287e031318b2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
// $Id$

/**
 * Legacy state manager for Panels.
 *
 * Checks all possible ways (using discovery of patterned method names) in which
 * Panels may need to operate in legacy mode,
 * sets variables as appropriate, and returns an informational
 *
 */
class PanelsLegacyState {
  var $legacy = NULL;

  function t() {
    $func = get_t();
    $args = func_get_args();
    return call_user_func_array($func, $args);
  }

  function getStatus() {
    if (!isset($this->legacy)) {
      $this->determineStatus();
    }
    return $this->legacy;
  }

  /**
   * Run all compatibility checks.
   */
  function determineStatus() {
    $this->legacy = array();
    foreach(get_class_methods($this) as $method) {
      if (strtolower(substr($method, 0, 5)) == 'check') {
        $this->legacy[$method] = $this->$method();
      }
    }
    $this->legacy = array_filter($this->legacy);
  }

  // At this time there are no legacy checks.
}