Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14903 Rev 15089
Línea 28... Línea 28...
28
	$this->inlineScript()->captureStart();
28
	$this->inlineScript()->captureStart();
29
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
29
	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
30
	$this->inlineScript()->captureEnd();
30
	$this->inlineScript()->captureEnd();
31
}
31
}
Línea -... Línea 32...
-
 
32
 
-
 
33
 
-
 
34
$menu = [];
32
 
35
 
33
if ($company) {
36
if ($company) {
34
	$menu = getAclMenuCompany();
37
	$baseMenu = getAclMenuCompany();
35
} else {
38
} else {
36
	$menu = getAclMenuSystem();
39
	$baseMenu= getAclMenuSystem();
Línea 37... Línea 40...
37
}
40
}
38
 
41
 
39
if ($company) {
42
if ($company) {
40
	$names = explode(' ', $company->name);
43
	$names = explode(' ', $company->name);
41
	$companyId = $company->uuid;
44
	$companyId = $company->uuid;
42
	$companyName = $company->name;
45
	$companyName = $company->name;
Línea 43... Línea 46...
43
	$companyImg = $company->image;
46
	$companyImg = $company->image;
-
 
47
}
-
 
48
 
-
 
49
$session_usertype_id = $user->usertype_id;
-
 
50
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
-
 
51
 
-
 
52
 
-
 
53
foreach($baseMenu as $menuLevel1) 
-
 
54
{
-
 
55
    if(!$acl->isAllowed($session_usertype_id ,  $menuLevel1['route'])) {
-
 
56
        continue;
-
 
57
    }
-
 
58
    
-
 
59
    
-
 
60
    $optionLevel1 = [
-
 
61
        'label' => $menuLevel1['label'], 
-
 
62
        'route' => $menuLevel1['route'], 
-
 
63
        'class' => empty($menuLevel1['class']) ? '' :  $menuLevel1['class'], 
-
 
64
       
-
 
65
    ];
-
 
66
    
-
 
67
    
-
 
68
    if(!empty($menuLevel1['pages'])) {
-
 
69
        
-
 
70
        
-
 
71
 
-
 
72
        
-
 
73
        $optionLevel1['pages'] = [];
-
 
74
        
-
 
75
        
-
 
76
        
-
 
77
        foreach($menuLevel1['pages'] as $menuLevel2)
-
 
78
        {
-
 
79
            
-
 
80
            $optionLevel2 = [
-
 
81
                'label' => $menuLevel2['label'],
-
 
82
                'route' => $menuLevel2['route'],
-
 
83
                'class' => empty($menuLevel2['class']) ? '' :  $menuLevel2['class'],
-
 
84
            ];
-
 
85
            
-
 
86
            if(!$acl->isAllowed($session_usertype_id ,  $menuLevel2['route'])) {
-
 
87
               continue;
-
 
88
            }
-
 
89
            
-
 
90
            if(!empty($menuLevel2['pages'])) {
-
 
91
                $optionLevel2['pages'] = [];
-
 
92
                
-
 
93
                foreach($menuLevel2['pages'] as $menuLevel3)
-
 
94
                {
-
 
95
                    
-
 
96
                    $optionLevel3 = [
-
 
97
                        'label' => $menuLevel3['label'],
-
 
98
                        'route' => $menuLevel3['route'],
-
 
99
                        'class' => empty($menuLevel3['class']) ? '' :  $menuLevel3['class'],
-
 
100
                    ];
-
 
101
                    
-
 
102
                    if(!$acl->isAllowed($session_usertype_id ,  $menuLevel3['route'])) {
-
 
103
                        continue;
-
 
104
                    }
-
 
105
                    
-
 
106
                    array_push($optionLevel2['pages'], $optionLevel3);
-
 
107
                    
-
 
108
                }
-
 
109
            }
-
 
110
            
-
 
111
            
-
 
112
            array_push($optionLevel1['pages'], $optionLevel2);
-
 
113
        
-
 
114
        }
-
 
115
        
-
 
116
        
-
 
117
    }
-
 
118
    
-
 
119
    
-
 
120
    
-
 
121
    
Línea 44... Línea 122...
44
}
122
    array_push($menu, $optionLevel1);
45
 
123
}
Línea 46... Línea 124...
46
$usertype_id = $user->usertype_id;
124
 
Línea 55... Línea 133...
55
	if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
133
	if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
56
		$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
134
		$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
57
	}
135
	}
58
}
136
}
Línea 59... Línea -...
59
 
-
 
-
 
137
 
Línea 60... Línea 138...
60
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
138
 
Línea 61... Línea 139...
61
 
139
 
62
$jsonMenu = json_encode($menu);
140
$jsonMenu = json_encode($menu);