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: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92:
<?php
class Theme
{
private $theme_id;
private $activated;
private $columns_disabled;
private $customize_interface;
private $authorizations;
const ACCES_THEME = 1;
public function __construct($theme_id, array $authorizations = array(), $activated = false)
{
$this->theme_id = $theme_id;
$this->activated = $activated;
$this->authorizations = $authorizations;
$this->customize_interface = new CustomizeInterface();
}
public function get_id()
{
return $this->theme_id;
}
public function is_activated()
{
return $this->activated;
}
public function get_authorizations()
{
return $this->authorizations;
}
public function set_activated($activated)
{
$this->activated = $activated;
}
public function set_columns_disabled(ColumnsDisabled $columns_disabled)
{
$this->columns_disabled = $columns_disabled;
}
public function get_columns_disabled()
{
return $this->columns_disabled;
}
public function set_customize_interface(CustomizeInterface $customize_interface)
{
$this->customize_interface = $customize_interface;
}
public function get_customize_interface()
{
return $this->customize_interface;
}
public function set_authorizations($authorizations)
{
$this->authorizations = $authorizations;
}
public function get_configuration()
{
return ThemeConfigurationManager::get($this->theme_id);
}
public function check_auth()
{
if ($this->theme_id == UserAccountsConfig::load()->get_default_theme())
{
return true;
}
return AppContext::get_current_user()->check_auth($this->authorizations, self::ACCES_THEME);
}
}
?>