diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-26 00:52:50 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-26 00:52:50 -0500 |
commit | 5f02e4f43cb1423653c156e612da53e4c5938583 (patch) | |
tree | 062c545dbc8cb1c50f1629ce055fc6cc3dbe6e9e /lib/class | |
parent | 31920c88a7b109d789511f45502c6291a2e617a0 (diff) | |
download | ampache-5f02e4f43cb1423653c156e612da53e4c5938583.tar.gz ampache-5f02e4f43cb1423653c156e612da53e4c5938583.tar.bz2 ampache-5f02e4f43cb1423653c156e612da53e4c5938583.zip |
Move flip_class() from lib/ui.lib.php to UI
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/ui.class.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/class/ui.class.php b/lib/class/ui.class.php index 6c2041f5..b1a54f33 100644 --- a/lib/class/ui.class.php +++ b/lib/class/ui.class.php @@ -25,6 +25,7 @@ class UI { + private static $_classes; private static $_ticker; public function __construct($data) { @@ -45,4 +46,20 @@ class UI { return false; } + + /** + * flip_class + * + * First initialised with an array of two class names. Subsequent calls + * reverse the array then return the first element. + */ + public static function flip_class($classes = null) { + if (is_array($classes)) { + self::$_classes = $array; + } + else { + self::$_classes = array_reverse(self::$_classes); + } + return self::$_classes[0]; + } } |