summaryrefslogtreecommitdiff
path: root/src/web/core
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-25 12:02:27 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-25 12:02:27 -0400
commitd5fed52363dbc30e702ba60e57acb2d6155826db (patch)
treebb67a9c752110f28ac611f532e09f21dd4e5c263 /src/web/core
parentfix ie6 support (diff)
downloadwebsite-d5fed52363dbc30e702ba60e57acb2d6155826db.tar.gz
website-d5fed52363dbc30e702ba60e57acb2d6155826db.tar.bz2
website-d5fed52363dbc30e702ba60e57acb2d6155826db.zip
ie6 blog post, click on blog images, prims.js syntax highlighting
Diffstat (limited to 'src/web/core')
-rw-r--r--src/web/core/core.php11
-rw-r--r--src/web/core/model.php11
2 files changed, 20 insertions, 2 deletions
diff --git a/src/web/core/core.php b/src/web/core/core.php
index d15436a..cfeeea9 100644
--- a/src/web/core/core.php
+++ b/src/web/core/core.php
@@ -51,6 +51,17 @@ abstract class Core {
}
/**
+ * Loads a js html link
+ * @param string $path - the path to the js file
+ */
+ public static function link_js(string $path): string
+ {
+ $stamp = Core::asset_stamp($path);
+ $href = Core::get_url("public/{$path}?stamp={$stamp}");
+ return '<script src="'. $href .'"></script>';
+ }
+
+ /**
* Loads a css html link
* @param string $path - the path to the css file
*/
diff --git a/src/web/core/model.php b/src/web/core/model.php
index 8e105da..c57fd5c 100644
--- a/src/web/core/model.php
+++ b/src/web/core/model.php
@@ -8,8 +8,10 @@ abstract class Model extends Component {
$data['title'] = lang('first_name');
$data['desc'] = lang('default_short_desc');
$data['css'] = array();
+ $data['js'] = array();
$style = $GLOBALS['style'];
+ $js = $GLOBALS['js'];
if (!$app)
$app = CONTEXT['app'];
@@ -18,11 +20,16 @@ abstract class Model extends Component {
$css = $style[$app];
if (!is_array($css))
$css = array($css);
- else
- $css = $style['app'];
$data['css'] = $css;
}
+ if (isset($js[$app])) {
+ $js = $js[$app];
+ if (!is_array($js))
+ $js = array($js);
+ $data['js'] = $js;
+ }
+
return $data;
}