Proyectos de Subversion LeadersLinked - Backend

Rev

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