Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8907 | Rev 8914 | 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
8913 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);
8905 stevensc 89
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
1 www 90
?>
91
<!DOCTYPE html>
92
<html lang="es">
93
 
4686 stevensc 94
<head>
95
	<?php
96
	echo $this->headTitle();
97
	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
98
		->appendHttpEquiv('expires', '0')
99
		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
100
		->appendHttpEquiv('pragma', 'no-cache')
101
		->appendHttpEquiv('Cache-Control', 'no-store')
102
		->appendHttpEquiv('Cache-Control', 'max-age=0')
103
		->appendHttpEquiv('Cache-Control', 'no-cache')
104
		->appendHttpEquiv('charset', 'UTF-8')
105
		->appendName('viewport', 'width=device-width, initial-scale=1.0');
106
	?>
1 www 107
 
4686 stevensc 108
	<!-- Google Font: Source Sans Pro -->
109
	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
110
	<!-- Font Awesome -->
111
	<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
112
	<!-- Theme style -->
113
	<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
114
	<!-- App style -->
115
	<link rel="stylesheet" href="<?php echo $this->basePath('css/app.css') ?>">
116
	<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
1 www 117
 
4686 stevensc 118
	<?php
119
	echo $this->headStyle();
120
	echo $this->headLink();
121
	echo $this->headScript();
122
	?>
123
</head>
124
 
125
<body class="hold-transition sidebar-mini">
126
	<!-- Site wrapper -->
8759 stevensc 127
	<div class="wrapper">
4686 stevensc 128
 
8759 stevensc 129
		<!-- Main Sidebar Container -->
8913 stevensc 130
 
131
		<div id="menu-sidebar"></div>
8759 stevensc 132
 
4686 stevensc 133
		<!-- Content Wrapper. Contains page content -->
134
		<div class="content-wrapper">
135
			<section class="content">
136
				<?php echo $this->content ?>
137
			</section>
138
			<!-- /.content -->
139
		</div>
140
		<!-- /.content-wrapper -->
141
	</div>
142
 
143
	<!-- jQuery -->
144
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
145
	<!-- Bootstrap 4 -->
146
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
147
	<!-- AdminLTE App -->
8906 stevensc 148
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
4686 stevensc 149
	<!--  Aplicacion -->
150
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
151
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
152
	<?php
153
	echo $this->inlineScript();
154
	?>
155
</body>
156
 
1 www 157
</html>