Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8756 | Rev 8767 | 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 -->
8759 stevensc 115
	<div class="wrapper">
4686 stevensc 116
 
8759 stevensc 117
		<!-- Main Sidebar Container -->
118
 
119
		<div id="menu-sidebar"></div>
120
 
4686 stevensc 121
		<!-- Content Wrapper. Contains page content -->
122
		<div class="content-wrapper">
123
			<section class="content">
124
				<?php echo $this->content ?>
125
			</section>
126
			<!-- /.content -->
127
		</div>
128
		<!-- /.content-wrapper -->
129
	</div>
130
 
131
	<!-- jQuery -->
132
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
133
	<!-- Bootstrap 4 -->
134
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
135
	<!-- AdminLTE App -->
136
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
137
	<!--  Aplicacion -->
138
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
139
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
140
	<?php
141
	echo $this->inlineScript();
142
	?>
143
</body>
144
 
1 www 145
</html>