This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/load_ext_data/main.php

23 lines
544 B
PHP
Raw Normal View History

<?php
2009-05-11 21:09:24 +00:00
class LoadExtData extends SimpleExtension {
public function onPageRequest($event) {
global $page;
$data_href = get_base_href();
2009-05-11 21:09:24 +00:00
$css_files = glob("ext/*/style.css");
if($css_files) {
foreach($css_files as $css_file) {
$page->add_header("<link rel='stylesheet' href='$data_href/$css_file' type='text/css'>");
}
2009-05-11 21:09:24 +00:00
}
2009-05-11 21:09:24 +00:00
$js_files = glob("ext/*/script.js");
if($js_files) {
foreach($js_files as $js_file) {
$page->add_header("<script src='$data_href/$js_file' type='text/javascript'></script>");
}
}
}
}
?>