1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Legacy state manager for Panels.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Legacy state manager for Panels.
|
10
|
*
|
11
|
* Checks all possible ways (using discovery of patterned method names) in which
|
12
|
* Panels may need to operate in legacy mode,
|
13
|
* sets variables as appropriate, and returns an informational.
|
14
|
*/
|
15
|
class PanelsLegacyState {
|
16
|
var $legacy = NULL;
|
17
|
|
18
|
/**
|
19
|
* Translation wrapper.
|
20
|
*/
|
21
|
function t() {
|
22
|
$func = get_t();
|
23
|
$args = func_get_args();
|
24
|
return call_user_func_array($func, $args);
|
25
|
}
|
26
|
|
27
|
/**
|
28
|
* Get Status.
|
29
|
*/
|
30
|
function getStatus() {
|
31
|
if (!isset($this->legacy)) {
|
32
|
$this->determineStatus();
|
33
|
}
|
34
|
return $this->legacy;
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* Run all compatibility checks.
|
39
|
*/
|
40
|
function determineStatus() {
|
41
|
$this->legacy = array();
|
42
|
foreach (get_class_methods($this) as $method) {
|
43
|
if (strtolower(substr($method, 0, 5)) == 'check') {
|
44
|
$this->legacy[$method] = $this->$method();
|
45
|
}
|
46
|
}
|
47
|
$this->legacy = array_filter($this->legacy);
|
48
|
}
|
49
|
|
50
|
}
|