-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathadmin.php
More file actions
33 lines (22 loc) · 809 Bytes
/
admin.php
File metadata and controls
33 lines (22 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
$app->on('admin.init', function() {
// bind admin routes /layout-components/*
$this->bindClass('LayoutComponents\\Controller\\Admin', 'layout-components');
$this->on('cockpit.view.settings.item', function() {
$this->renderView("layoutcomponents:views/partials/settings-link.php");
});
$this->on('app.layout.header', function() {
if ($file = $this->path('#storage:components.json')) {
$content = @file_get_contents($file);
if (!$content) {
return;
}
?>
<script>
window.CP_LAYOUT_COMPONENTS = App.$.extend(window.CP_LAYOUT_COMPONENTS || {}, <?=$content?>);
</script>
<?php
//echo $this->script('#config:components.js', time());
}
});
});