diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-18 14:14:53 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-18 14:48:54 -0400 |
commit | 1f9024763d9224c4cd9a181bac27e6b9f12ad672 (patch) | |
tree | 00f827470dad9aa2692483acbdef9502c1a464d3 /src/web/core/model.php | |
parent | fix rss (diff) | |
download | website-1f9024763d9224c4cd9a181bac27e6b9f12ad672.tar.gz website-1f9024763d9224c4cd9a181bac27e6b9f12ad672.tar.bz2 website-1f9024763d9224c4cd9a181bac27e6b9f12ad672.zip |
refactor
Diffstat (limited to 'src/web/core/model.php')
-rw-r--r-- | src/web/core/model.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/web/core/model.php b/src/web/core/model.php new file mode 100644 index 0000000..8e105da --- /dev/null +++ b/src/web/core/model.php @@ -0,0 +1,29 @@ +<?php /* Copyright (c) 2024 Freya Murphy */ + +abstract class Model extends Component { + + public static function get_base_data(?string $app = NULL): array + { + $data = array(); + $data['title'] = lang('first_name'); + $data['desc'] = lang('default_short_desc'); + $data['css'] = array(); + + $style = $GLOBALS['style']; + + if (!$app) + $app = CONTEXT['app']; + + if (isset($style[$app])) { + $css = $style[$app]; + if (!is_array($css)) + $css = array($css); + else + $css = $style['app']; + $data['css'] = $css; + } + + return $data; + } + +} |