Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8706 | Rev 8756 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
8742 stevensc 2
use LeadersLinked\Model\UserType;
3
 
1 www 4
$currentUser    = $this->currentUserHelper();
5
$user = $currentUser->getUser();
6
$company = $currentUser->getCompany();
7
 
8
$notify = '';
9
$messages = $this->flashMessenger()->getInfoMessages();
4686 stevensc 10
foreach ($messages as $message) {
11
	$notify .= "$.fn.showInfo('$message')";
1 www 12
}
13
 
14
$messages = $this->flashMessenger()->getSuccessMessages();
4686 stevensc 15
foreach ($messages as $message) {
16
	$notify .= "$.fn.showSuccess('$message')";
1 www 17
}
18
 
19
$messages = $this->flashMessenger()->getWarningMessages();
4686 stevensc 20
foreach ($messages as $message) {
21
	$notify .= " $.fn.showWarning('$message')";
1 www 22
}
23
 
24
$messages = $this->flashMessenger()->getErrorMessages();
4686 stevensc 25
foreach ($messages as $message) {
26
	$notify .= " $.fn.showError('$message')";
1 www 27
}
28
 
4686 stevensc 29
if ($notify) {
30
	$this->inlineScript()->captureStart();
31
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
32
	$this->inlineScript()->captureEnd();
1 www 33
}
34
 
8742 stevensc 35
if ($company) {
36
	$menu = getAclMenuCompany();
8706 stevensc 37
} else {
8742 stevensc 38
	$menu = getAclMenuSystem();
8706 stevensc 39
}
40
 
8742 stevensc 41
if ($company) {
42
	$names = explode(' ', $company->name);
43
}
8706 stevensc 44
 
8742 stevensc 45
 
46
$usertype_id = $user->usertype_id;
47
 
8706 stevensc 48
//[REQUEST_URI] => /settings/company-sizes/
49
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
50
 
51
if ($request_uri) {
52
  if (substr($request_uri, 0, 1) == '/') {
53
    $request_uri = substr($request_uri, 1);
54
  }
55
  if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
56
    $request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
57
  }
58
}
59
 
60
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
61
 
62
$jsonMenu = json_encode($menu);
63
$companyId = $company->uuid;
64
$companyName = $company->name;
65
$companyImg = $company->image;
66
 
67
$js = <<<JS
68
const backendVars= {
69
	menu:JSON.parse('$jsonMenu'),
70
	companyId: "$companyId",
71
	companyImg: "$companyImg",
72
	companyName: "$companyName",
73
	name: "$names[0]",
74
}
75
JS;
76
$this->inlineScript()->appendScript($js);
77
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
1 www 78
?>
79
<!DOCTYPE html>
80
<html lang="es">
81
 
4686 stevensc 82
<head>
83
	<?php
84
	echo $this->headTitle();
85
	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
86
		->appendHttpEquiv('expires', '0')
87
		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
88
		->appendHttpEquiv('pragma', 'no-cache')
89
		->appendHttpEquiv('Cache-Control', 'no-store')
90
		->appendHttpEquiv('Cache-Control', 'max-age=0')
91
		->appendHttpEquiv('Cache-Control', 'no-cache')
92
		->appendHttpEquiv('charset', 'UTF-8')
93
		->appendName('viewport', 'width=device-width, initial-scale=1.0');
94
	?>
1 www 95
 
4686 stevensc 96
	<!-- Google Font: Source Sans Pro -->
97
	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
98
	<!-- Font Awesome -->
99
	<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
100
	<!-- Theme style -->
101
	<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
102
	<!-- App style -->
103
	<link rel="stylesheet" href="<?php echo $this->basePath('css/app.css') ?>">
104
	<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
1 www 105
 
4686 stevensc 106
	<?php
107
	echo $this->headStyle();
108
	echo $this->headLink();
109
	echo $this->headScript();
110
	?>
111
</head>
112
 
113
<body class="hold-transition sidebar-mini">
114
	<!-- Site wrapper -->
115
	<div class="wrapper">
116
 
117
		<!-- Main Sidebar Container -->
8706 stevensc 118
 
119
		<aside class="main-sidebar sidebar-light-primary right-border" id="menu-sidebar">
4686 stevensc 120
		</aside>
1 www 121
 
4686 stevensc 122
		<!-- Content Wrapper. Contains page content -->
123
		<div class="content-wrapper">
124
			<section class="content">
125
				<?php echo $this->content ?>
126
			</section>
127
			<!-- /.content -->
128
		</div>
129
		<!-- /.content-wrapper -->
130
	</div>
131
 
132
	<!-- jQuery -->
133
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
134
	<!-- Bootstrap 4 -->
135
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
136
	<!-- AdminLTE App -->
137
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
138
	<!--  Aplicacion -->
139
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
140
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
141
	<?php
142
	echo $this->inlineScript();
143
	?>
144
</body>
145
 
1 www 146
</html>