mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 20:27:40 +02:00
Plugin API: Stylesheet and Javascript load() methods - fixed
This commit is contained in:
@@ -951,6 +951,8 @@
|
||||
// Sort stylesheets by priority
|
||||
$stylesheets = Arr::subvalSort(Stylesheet::$stylesheets, 'priority');
|
||||
|
||||
if (BACKEND) {
|
||||
|
||||
// Build backend site stylesheets
|
||||
foreach ($stylesheets as $stylesheet) {
|
||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'backend') or ($stylesheet['load'] == 'both')) ) {
|
||||
@@ -974,6 +976,8 @@
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// Build frontend site stylesheets
|
||||
foreach ($stylesheets as $stylesheet) {
|
||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'frontend') or ($stylesheet['load'] == 'both')) ) {
|
||||
@@ -996,6 +1000,8 @@
|
||||
$frontend_regenerate = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Render
|
||||
if (BACKEND) {
|
||||
echo '<link rel="stylesheet" href="'.Option::get('siteurl').'tmp/minify/backend_site.minify.css'.'" type="text/css" />';
|
||||
@@ -1089,6 +1095,9 @@
|
||||
// Sort javascripts by priority
|
||||
$javascripts = Arr::subvalSort(Javascript::$javascripts, 'priority');
|
||||
|
||||
|
||||
if (BACKEND) {
|
||||
|
||||
// Build backend site javascript
|
||||
foreach ($javascripts as $javascript) {
|
||||
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'backend') or ($javascript['load'] == 'both')) ) {
|
||||
@@ -1110,6 +1119,7 @@
|
||||
$backend_regenerate = false;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Build frontend site javascript
|
||||
foreach ($javascripts as $javascript) {
|
||||
@@ -1132,6 +1142,8 @@
|
||||
$frontend_regenerate = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Render
|
||||
if (BACKEND) {
|
||||
echo '<script type="text/javascript" src="'.Option::get('siteurl').'tmp/minify/backend_site.minify.js"></script>';
|
||||
|
Reference in New Issue
Block a user