| 1 |
<?php |
| 2 |
namespace MBSocial; |
| 3 |
defined('ABSPATH') or die('No direct access permitted'); |
| 4 |
|
| 5 |
|
| 6 |
class styles |
| 7 |
{ |
| 8 |
protected static $style_classes; |
| 9 |
//protected static $styles; |
| 10 |
|
| 11 |
public static function registerStyle($style_name, $order) |
| 12 |
{ |
| 13 |
|
| 14 |
if (! isset (static::$style_classes[$order])) |
| 15 |
static::$style_classes[$order] = array( new $style_name); |
| 16 |
else |
| 17 |
static::$style_classes[$order][] = new $style_name; |
| 18 |
|
| 19 |
ksort(static::$style_classes); |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
public static function getStyles() |
| 24 |
{ |
| 25 |
|
| 26 |
return self::$style_classes; |
| 27 |
} |
| 28 |
|
| 29 |
public static function getStyle($name) |
| 30 |
{ |
| 31 |
foreach (self::$style_classes as $order => $styles) |
| 32 |
{ |
| 33 |
foreach($styles as $style_class) |
| 34 |
{ |
| 35 |
if ($style_class->name == $name) |
| 36 |
return $style_class; |
| 37 |
} |
| 38 |
} |
| 39 |
return false; |
| 40 |
} |
| 41 |
|
| 42 |
} |
| 43 |
|