Proyectos de Subversion LeadersLinked - Backend

Rev

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