Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8703 | Rev 8742 | 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
2
$currentUser    = $this->currentUserHelper();
3
$user = $currentUser->getUser();
4
$company = $currentUser->getCompany();
5
 
8706 stevensc 6
use LeadersLinked\Model\UserType;
1 www 7
$notify = '';
8
$messages = $this->flashMessenger()->getInfoMessages();
4686 stevensc 9
foreach ($messages as $message) {
10
	$notify .= "$.fn.showInfo('$message')";
1 www 11
}
12
 
13
$messages = $this->flashMessenger()->getSuccessMessages();
4686 stevensc 14
foreach ($messages as $message) {
15
	$notify .= "$.fn.showSuccess('$message')";
1 www 16
}
17
 
18
$messages = $this->flashMessenger()->getWarningMessages();
4686 stevensc 19
foreach ($messages as $message) {
20
	$notify .= " $.fn.showWarning('$message')";
1 www 21
}
22
 
23
$messages = $this->flashMessenger()->getErrorMessages();
4686 stevensc 24
foreach ($messages as $message) {
25
	$notify .= " $.fn.showError('$message')";
1 www 26
}
27
 
4686 stevensc 28
if ($notify) {
29
	$this->inlineScript()->captureStart();
30
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
31
	$this->inlineScript()->captureEnd();
1 www 32
}
33
 
34
 
8706 stevensc 35
$currentUserPlugin = $this->currentUserHelper();
36
$currentUser = $currentUserPlugin->getUser();
37
$currentCompany = $currentUserPlugin->getCompany();
8701 stevensc 38
 
8706 stevensc 39
if ($currentCompany) {
40
  $menu = getAclMenuCompany();
41
} else {
42
  $menu = getAclMenuSystem();
43
}
44
 
45
$usertype_id = $currentUser->usertype_id;
46
 
47
//[REQUEST_URI] => /settings/company-sizes/
48
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
49
 
50
if ($request_uri) {
51
  if (substr($request_uri, 0, 1) == '/') {
52
    $request_uri = substr($request_uri, 1);
53
  }
54
  if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
55
    $request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
56
  }
57
}
58
 
59
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
60
 
61
$jsonMenu = json_encode($menu);
62
$companyId = $company->uuid;
63
$companyName = $company->name;
64
$companyImg = $company->image;
65
if ($company) :
66
	$names = explode(' ', $company->name);
67
endif;
68
 
69
$js = <<<JS
70
const backendVars= {
71
	menu:JSON.parse('$jsonMenu'),
72
	companyId: "$companyId",
73
	companyImg: "$companyImg",
74
	companyName: "$companyName",
75
	name: "$names[0]",
76
}
77
JS;
78
$this->inlineScript()->appendScript($js);
79
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
1 www 80
?>
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 -->
8706 stevensc 120
 
121
		<aside class="main-sidebar sidebar-light-primary right-border" id="menu-sidebar">
4686 stevensc 122
		</aside>
1 www 123
 
4686 stevensc 124
		<!-- Content Wrapper. Contains page content -->
125
		<div class="content-wrapper">
126
			<section class="content">
127
				<?php echo $this->content ?>
128
			</section>
129
			<!-- /.content -->
130
		</div>
131
		<!-- /.content-wrapper -->
132
	</div>
133
 
134
	<!-- jQuery -->
135
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
136
	<!-- Bootstrap 4 -->
137
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
138
	<!-- AdminLTE App -->
139
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
140
	<!--  Aplicacion -->
141
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
142
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
143
	<?php
144
	echo $this->inlineScript();
145
	?>
146
</body>
147
 
1 www 148
</html>