Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15768 | Rev 16806 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 15768 Rev 16805
Línea 29... Línea 29...
29
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
29
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
30
	$this->inlineScript()->captureEnd();
30
	$this->inlineScript()->captureEnd();
31
}
31
}
Línea 32... Línea -...
32
 
-
 
Línea 33... Línea -...
33
 
-
 
34
$menu = [];
-
 
35
 
-
 
36
if ($company) {
-
 
37
	$baseMenu = getAclMenuCompany();
-
 
38
} else {
-
 
39
	$baseMenu = getAclMenuSystem();
-
 
40
}
-
 
41
 
-
 
42
if ($company) {
-
 
43
	$names = explode(' ', $company->name);
-
 
44
	$companyId = $company->uuid;
-
 
45
	$companyName = $company->name;
-
 
46
	$companyImg = $company->image;
-
 
47
}
-
 
48
 
-
 
49
$session_usertype_id = $user->usertype_id;
-
 
50
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
-
 
51
 
-
 
52
 
-
 
53
foreach ($baseMenu as $menuLevel1) {
-
 
54
	if (!$acl->isAllowed($session_usertype_id,  $menuLevel1['route'])) {
-
 
55
		continue;
-
 
56
	}
-
 
57
 
-
 
58
 
-
 
59
	$optionLevel1 = [
-
 
60
		'label' => $menuLevel1['label'],
-
 
61
		'route' => $menuLevel1['route'],
-
 
62
		'class' => empty($menuLevel1['class']) ? '' :  $menuLevel1['class'],
-
 
63
 
-
 
64
	];
-
 
65
 
-
 
66
 
-
 
67
	if (!empty($menuLevel1['pages'])) {
-
 
68
 
-
 
69
 
-
 
70
 
-
 
71
 
-
 
72
		$optionLevel1['pages'] = [];
-
 
73
 
-
 
74
 
-
 
75
 
-
 
76
		foreach ($menuLevel1['pages'] as $menuLevel2) {
-
 
77
 
-
 
78
			$optionLevel2 = [
-
 
79
				'label' => $menuLevel2['label'],
-
 
80
				'route' => $menuLevel2['route'],
-
 
81
				'class' => empty($menuLevel2['class']) ? '' :  $menuLevel2['class'],
-
 
82
			];
-
 
83
 
-
 
Línea 84... Línea -...
84
			if (!$acl->isAllowed($session_usertype_id,  $menuLevel2['route'])) {
-
 
85
				continue;
-
 
86
			}
-
 
87
 
-
 
88
			if (!empty($menuLevel2['pages'])) {
-
 
89
				$optionLevel2['pages'] = [];
-
 
90
 
-
 
91
				foreach ($menuLevel2['pages'] as $menuLevel3) {
-
 
92
 
-
 
93
					$optionLevel3 = [
-
 
94
						'label' => $menuLevel3['label'],
-
 
95
						'route' => $menuLevel3['route'],
-
 
96
						'class' => empty($menuLevel3['class']) ? '' :  $menuLevel3['class'],
-
 
97
					];
-
 
98
 
-
 
99
					if (!$acl->isAllowed($session_usertype_id,  $menuLevel3['route'])) {
-
 
100
						continue;
-
 
101
					}
-
 
102
 
-
 
103
					array_push($optionLevel2['pages'], $optionLevel3);
-
 
104
				}
-
 
105
			}
-
 
106
 
-
 
107
 
-
 
108
			array_push($optionLevel1['pages'], $optionLevel2);
-
 
109
		}
-
 
110
	}
-
 
111
 
-
 
112
 
-
 
113
 
-
 
114
 
-
 
115
	array_push($menu, $optionLevel1);
-
 
116
}
-
 
117
 
-
 
118
 
-
 
119
//[REQUEST_URI] => /settings/company-sizes/
-
 
120
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
-
 
121
 
-
 
122
if ($request_uri) {
-
 
123
	if (substr($request_uri, 0, 1) == '/') {
-
 
124
		$request_uri = substr($request_uri, 1);
-
 
125
	}
-
 
126
	if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
-
 
127
		$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
-
 
128
	}
-
 
129
}
-
 
130
 
-
 
131
 
-
 
132
 
-
 
133
$jsonMenu = json_encode($menu);
-
 
134
 
-
 
135
if ($company) {
-
 
136
	$js = <<<JS
-
 
137
	const backendVars= {
-
 
138
		menu:JSON.parse('$jsonMenu'),
-
 
139
		companyId: "$company->uuid",
-
 
140
		companyImg: "$companyImg",
-
 
141
		companyName: "$companyName",
-
 
142
		name: "$names[0]",
-
 
143
	}	
-
 
144
JS;
-
 
145
} else {
-
 
146
	$js = <<<JS
-
 
147
	const backendVars= {
-
 
148
		menu:JSON.parse('$jsonMenu'),
-
 
149
		companyId: "",
-
 
150
		companyImg: "",
-
 
151
		companyName: "",
-
 
152
		name: "",
-
 
153
	}	
-
 
Línea 154... Línea 32...
154
JS;
32
 
155
}
33
 
156
$this->inlineScript()->appendScript($js);
34
 
Línea 211... Línea 89...
211
 
89
 
212
<body class="hold-transition sidebar-mini">
90
<body class="hold-transition sidebar-mini">
213
	<!-- Site wrapper -->
91
	<!-- Site wrapper -->
Línea -... Línea 92...
-
 
92
	<div class="wrapper">
-
 
93
 
-
 
94
		<nav class="main-header navbar navbar-expand navbar-white navbar-light">
-
 
95
			<div class="w-100 text-center">
-
 
96
				<h4><?php  echo $company ? $company->name : 'LABEL_SUPER_ADMIN' ?></h4>
-
 
97
			</div>
214
	<div class="wrapper">
98
		</nav>
-
 
99
 
-
 
100
		<div id="menu-sidebar">
-
 
101
			<?php
-
 
102
			if ($currentUserHelper->hasIdentity()) {
-
 
103
				echo $this->menuHelper();
-
 
104
			}
Línea 215... Línea 105...
215
 
105
			?>
216
		<div id="menu-sidebar"></div>
106
		</div>
217
 
107
 
218
		<!-- Content Wrapper. Contains page content -->
108
		<!-- Content Wrapper. Contains page content -->