Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8774 | Rev 8905 | 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);
8767 stevensc 43
	$companyId = $company->uuid;
44
	$companyName = $company->name;
45
	$companyImg = $company->image;
8742 stevensc 46
}
8706 stevensc 47
 
8742 stevensc 48
 
49
$usertype_id = $user->usertype_id;
50
 
8706 stevensc 51
//[REQUEST_URI] => /settings/company-sizes/
52
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
53
 
54
if ($request_uri) {
55
  if (substr($request_uri, 0, 1) == '/') {
56
    $request_uri = substr($request_uri, 1);
57
  }
58
  if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
59
    $request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
60
  }
61
}
62
 
63
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
64
 
65
$jsonMenu = json_encode($menu);
66
 
8774 stevensc 67
if($company){
8706 stevensc 68
$js = <<<JS
8769 stevensc 69
	const backendVars= {
70
		menu:JSON.parse('$jsonMenu'),
8772 stevensc 71
		companyId: "$company->uuid",
8769 stevensc 72
		companyImg: "$companyImg",
73
		companyName: "$companyName",
74
		name: "$names[0]",
8774 stevensc 75
	}
76
JS;
77
} else {
78
	$js = <<<JS
79
	const backendVars= {
80
		menu:JSON.parse('$jsonMenu'),
81
		companyId: "",
82
		companyImg: "",
83
		companyName: "",
84
		name: "",
85
	}
86
JS;
8706 stevensc 87
}
88
$this->inlineScript()->appendScript($js);
1 www 89
?>
90
<!DOCTYPE html>
91
<html lang="es">
92
 
4686 stevensc 93
<head>
94
	<?php
95
	echo $this->headTitle();
96
	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
97
		->appendHttpEquiv('expires', '0')
98
		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
99
		->appendHttpEquiv('pragma', 'no-cache')
100
		->appendHttpEquiv('Cache-Control', 'no-store')
101
		->appendHttpEquiv('Cache-Control', 'max-age=0')
102
		->appendHttpEquiv('Cache-Control', 'no-cache')
103
		->appendHttpEquiv('charset', 'UTF-8')
104
		->appendName('viewport', 'width=device-width, initial-scale=1.0');
105
	?>
1 www 106
 
4686 stevensc 107
	<!-- Google Font: Source Sans Pro -->
108
	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
109
	<!-- Font Awesome -->
110
	<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
111
	<!-- Theme style -->
112
	<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
113
	<!-- App style -->
114
	<link rel="stylesheet" href="<?php echo $this->basePath('css/app.css') ?>">
115
	<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
1 www 116
 
4686 stevensc 117
	<?php
118
	echo $this->headStyle();
119
	echo $this->headLink();
120
	echo $this->headScript();
121
	?>
122
</head>
123
 
124
<body class="hold-transition sidebar-mini">
125
	<!-- Site wrapper -->
8759 stevensc 126
	<div class="wrapper">
4686 stevensc 127
 
8759 stevensc 128
		<!-- Main Sidebar Container -->
129
 
130
		<div id="menu-sidebar"></div>
131
 
4686 stevensc 132
		<!-- Content Wrapper. Contains page content -->
133
		<div class="content-wrapper">
134
			<section class="content">
135
				<?php echo $this->content ?>
136
			</section>
137
			<!-- /.content -->
138
		</div>
139
		<!-- /.content-wrapper -->
140
	</div>
141
 
142
	<!-- jQuery -->
143
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
144
	<!-- Bootstrap 4 -->
145
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
146
	<!-- AdminLTE App -->
147
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
148
	<!--  Aplicacion -->
149
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
150
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
8904 stevensc 151
	<script src="<?php echo $this->basePath('/react-bundles/menu/menuBundle.js') ?>"></script>
4686 stevensc 152
	<?php
153
	echo $this->inlineScript();
154
	?>
155
</body>
156
 
1 www 157
</html>