Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8703 | Rev 8742 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 8703 Rev 8706
Línea 1... Línea 1...
1
<?php
1
<?php
2
$currentUser    = $this->currentUserHelper();
2
$currentUser    = $this->currentUserHelper();
3
$user = $currentUser->getUser();
3
$user = $currentUser->getUser();
4
$company = $currentUser->getCompany();
4
$company = $currentUser->getCompany();
Línea -... Línea 5...
-
 
5
 
5
 
6
use LeadersLinked\Model\UserType;
6
$notify = '';
7
$notify = '';
7
$messages = $this->flashMessenger()->getInfoMessages();
8
$messages = $this->flashMessenger()->getInfoMessages();
8
foreach ($messages as $message) {
9
foreach ($messages as $message) {
9
	$notify .= "$.fn.showInfo('$message')";
10
	$notify .= "$.fn.showInfo('$message')";
Línea 29... Línea 30...
29
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
30
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
30
	$this->inlineScript()->captureEnd();
31
	$this->inlineScript()->captureEnd();
31
}
32
}
Línea -... Línea 33...
-
 
33
 
-
 
34
 
-
 
35
$currentUserPlugin = $this->currentUserHelper();
-
 
36
$currentUser = $currentUserPlugin->getUser();
-
 
37
$currentCompany = $currentUserPlugin->getCompany();
-
 
38
 
-
 
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
}
Línea -... Línea 58...
-
 
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
}
32
 
77
JS;
33
 
78
$this->inlineScript()->appendScript($js);
34
 
79
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
Línea 35... Línea 80...
35
?>
80
?>
Línea 70... Línea 115...
70
<body class="hold-transition sidebar-mini">
115
<body class="hold-transition sidebar-mini">
71
	<!-- Site wrapper -->
116
	<!-- Site wrapper -->
72
	<div class="wrapper">
117
	<div class="wrapper">
Línea 73... Línea 118...
73
 
118
 
74
		<!-- Main Sidebar Container -->
-
 
75
		<aside class="main-sidebar sidebar-light-primary right-border">
-
 
76
			<!-- Brand Logo -->
-
 
77
			<a href="<?php echo $this->url('dashboard') ?>" class="brand-link">
-
 
78
				<?php if ($company) :
-
 
79
					$names = explode(' ', $company->name);
119
		<!-- Main Sidebar Container -->
80
 
-
 
81
				?>
-
 
82
					<img src="<?php echo $this->url('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image]) ?>" alt="<?php echo $company->name ?>" class="brand-image " style="opacity: .8; background-color: white">
120
		
83
					<span class="brand-text font-weight-light"><?php echo $names[0] ?></span>
-
 
84
 
-
 
85
				<?php else : ?>
-
 
86
					<img src="<?php echo $this->basePath('img/logo-ll34x34.png') ?>" alt="Administrador" class="brand-image " style="opacity: .8; background-color: white">
-
 
87
					<span class="brand-text font-weight-light">Admin</span>
-
 
88
				<?php endif; ?>
-
 
89
			</a>
-
 
90
 
-
 
91
			<!-- Sidebar -->
-
 
92
			<div class="sidebar">
-
 
93
				<?php echo $this->menuHelper() ?>
-
 
94
 
-
 
95
			</div>
-
 
96
			<!-- /.sidebar -->
121
		<aside class="main-sidebar sidebar-light-primary right-border" id="menu-sidebar">			
Línea 97... Línea 122...
97
		</aside>
122
		</aside>
98
 
123
 
99
		<!-- Content Wrapper. Contains page content -->
124
		<!-- Content Wrapper. Contains page content -->