Skip to content

Commit 9c4a4df

Browse files
committed
only allow css, no less
1 parent 4550933 commit 9c4a4df

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

controllers/courseware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ private function getMustacheTemplates()
199199
);
200200

201201
// add stylesheets for block to page
202-
foreach (glob($block['path'] . '/css/*.less') as $source) {
202+
foreach (glob($block['path'] . '/css/*.css') as $source) {
203203
PageLayout::addHeadElement('link', [
204-
'rel' => 'stylesheet/less',
204+
'rel' => 'stylesheet',
205205
'type' => 'text/css',
206206
'href' => UrlHelper::getURL($source, ['cid' => null])
207207
]);

models/mooc/ui/BlockFactory.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public function __construct(Container $container)
2727
*/
2828
public function makeBlock($sorm_block)
2929
{
30+
$this->getBlockClasses();
31+
3032
$class = 'Mooc\\UI\\'.$sorm_block->type.'\\'.$sorm_block->type;
3133

3234
// there is no class describing a UI for that kind of block
@@ -45,18 +47,20 @@ public function getBlockClasses()
4547

4648
if (!isset($classes)) {
4749
$classes = array_map("basename", glob($this->getPluginDir() . '/blocks/*'));
50+
}
51+
52+
$dyn_classes = [];
4853

49-
foreach (\Courseware::$registered_blocks as $block) {
50-
$classes[] = basename($block['path']);
54+
foreach (\Courseware::$registered_blocks as $block) {
55+
$dyn_classes[] = basename($block['path']);
5156

52-
// load classes in blocks
53-
foreach (glob($block['path'] . '/*.php') as $class) {
54-
require_once($class);
55-
}
57+
// load classes in blocks
58+
foreach (glob($block['path'] . '/*.php') as $class) {
59+
require_once($class);
5660
}
5761
}
5862

59-
return $classes;
63+
return array_merge($classes, $dyn_classes);
6064
}
6165

6266
// TODO

0 commit comments

Comments
 (0)