Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16805 efrain 1
<?php
2
 
3
use LeadersLinked\Model\UserType;
4
 
5
$currentUserPlugin = $this->currentUserHelper();
6
$currentUser = $currentUserPlugin->getUser();
7
$currentCompany = $currentUserPlugin->getCompany();
8
 
9
if ($currentCompany) {
10
  $menu = getAclMenuCompany();
11
} else {
12
  $menu = getAclMenuSystem();
13
}
14
 
15
$usertype_id = $currentUser->usertype_id;
16
 
17
//[REQUEST_URI] => /settings/company-sizes/
18
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
19
 
20
if ($request_uri) {
21
  if (substr($request_uri, 0, 1) == '/') {
22
    $request_uri = substr($request_uri, 1);
23
  }
24
  if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
25
    $request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
26
  }
27
}
28
 
29
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
30
/*
31
$this->inlineScript()->captureStart();
32
  echo <<<JS
33
    const redirectToDashboard = () => {
34
      console.log('>>: redirect > ')
35
      document.location.href = '/dashboard';
36
    }
37
    JS;
38
    $this->inlineScript()->captureEnd();
39
    */
40
 
41
$jsonMenu = json_encode($menu);
42
$js = <<<JS
43
const backendVars= JSON.parse('$jsonMenu')
44
JS;
45
$this->inlineScript()->appendScript($js);
46
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
47
?>
48
<nav class="mt-2" id="menu-sidebar"></nav>