-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.php
25 lines (21 loc) · 891 Bytes
/
bootstrap.php
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
<?php
if($app->module("auth")->getUser() && $app->module("auth")->hasaccess("Regions", ['create.regions', 'edit.regions'])) {
$regionRenderer = $this->module("regions")->__get('render');
$this->module("regions")->extend([
"render" => function($name, $params = []) use($regionRenderer, $app) {
$region = $app->db->findOne("common/regions", ["name"=>$name]);
$output = $regionRenderer($name, $params);
$path = dirname(__FILE__);
$cockpitFolder = explode('/',$path)[sizeof(explode('/',$path))-4];
$regionId = $region['_id'];
$output .= $app->renderer->file(
$path."/views/edit_button.php",
compact(
'cockpitFolder',
'regionId'
)
);
return $output;
}
]);
}