mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
33 lines
867 B
PHP
33 lines
867 B
PHP
<?php
|
|
|
|
namespace Gazelle;
|
|
|
|
class Stylesheet extends Base {
|
|
|
|
protected $stylesheets;
|
|
|
|
public function __construct() {
|
|
parent::__construct();
|
|
if (($this->stylesheets = $this->cache->get_value('stylesheets')) === false) {
|
|
$this->db->prepared_query("
|
|
SELECT
|
|
ID,
|
|
lower(replace(Name, ' ', '_')) AS Name,
|
|
Name AS ProperName
|
|
FROM stylesheets
|
|
ORDER BY ID ASC
|
|
");
|
|
$this->stylesheets = $this->db->to_array('ID', MYSQLI_BOTH);
|
|
$this->cache->cache_value('stylesheets', $this->stylesheets, 86400 * 7);
|
|
}
|
|
}
|
|
|
|
public function list (): array {
|
|
return $this->stylesheets;
|
|
}
|
|
|
|
public function getName(int $id): string {
|
|
return $this->stylesheets[$id]['Name'];
|
|
}
|
|
}
|