Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4468 Rev 4526
Línea 4... Línea 4...
4
use LeadersLinked\Model\User;
4
use LeadersLinked\Model\User;
5
use LeadersLinked\Model\Theme;
5
use LeadersLinked\Model\Theme;
Línea 6... Línea 6...
6
 
6
 
Línea -... Línea 7...
-
 
7
$currentUser            = $this->currentUserHelper();
-
 
8
 
-
 
9
$currentNetworkHelper = $this->currentNetworkHelper();
7
$currentUser            = $this->currentUserHelper();
10
$currentNetwork = $currentNetworkHelper->getNetwork();
Línea 8... Línea 11...
8
 
11
 
Línea 9... Línea 12...
9
$logoForNavbar = $this->networkNavbarHelper();
12
$logoForNavbar = $this->networkNavbarHelper();
10
 
13
 
11
if( $currentUser->hasIdentity() ) {
14
if ($currentUser->hasIdentity()) {
Línea 12... Línea 15...
12
 
15
 
Línea 13... Línea 16...
13
$session_user_id        = $currentUser->getUserId();
16
    $session_user_id        = $currentUser->getUserId();
Línea 14... Línea 17...
14
$session_usertype_id    = $currentUser->getUserTypeId();
17
    $session_usertype_id    = $currentUser->getUserTypeId();
-
 
18
    $user = $currentUser->getUser();
-
 
19
 
-
 
20
    $link_admin = $session_usertype_id == UserType::ADMIN ? 1 : 0;
-
 
21
 
-
 
22
 
-
 
23
    $link_impersonate = $user->is_super_user == User::IS_SUPER_USER_YES ? 1 : 0;
-
 
24
 
-
 
25
 
-
 
26
    $container = $this->navigation('menuNavigation')->getContainer();
-
 
27
 
-
 
28
    $acl = $this->viewModel()->getCurrent()->getVariable('acl');
-
 
29
 
-
 
30
 
-
 
31
 
-
 
32
    $menu = [];
-
 
33
    foreach ($container as $page) {
-
 
34
 
-
 
35
        if (!$page || !$page->getRoute() || !$acl->isAllowed($session_usertype_id, $page->getRoute())) {
-
 
36
            continue;
-
 
37
        }
-
 
38
 
-
 
39
 
-
 
40
 
-
 
41
        $option = [
-
 
42
            'label' => $page->getLabel(),
-
 
43
            'href' => $page->getHref(),
-
 
44
            'img' => $page->getClass(),
-
 
45
            'childs' => [],
Línea 15... Línea -...
15
$user = $currentUser->getUser();
-
 
Línea 16... Línea -...
16
 
-
 
17
$link_admin = $session_usertype_id == UserType::ADMIN ? 1 : 0;
-
 
Línea 18... Línea -...
18
 
-
 
19
 
-
 
20
$link_impersonate = $user->is_super_user == User::IS_SUPER_USER_YES ? 1 : 0;
-
 
Línea -... Línea 46...
-
 
46
        ];
Línea 21... Línea -...
21
 
-
 
22
 
-
 
23
$container = $this->navigation('menuNavigation')->getContainer();
-
 
24
 
-
 
25
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
-
 
26
 
-
 
27
 
-
 
28
 
-
 
29
$menu = [];
-
 
30
foreach($container as $page) {
-
 
31
 
-
 
32
    if(!$page || !$page->getRoute() || !$acl->isAllowed($session_usertype_id , $page->getRoute())) {
-
 
33
        continue;
-
 
34
    }
-
 
35
 
-
 
36
 
-
 
37
 
-
 
38
    $option = [
-
 
39
        'label' => $page->getLabel(),
-
 
40
        'href' => $page->getHref(),
-
 
41
        'img' => $page->getClass(),
-
 
42
        'childs' => [],
-
 
43
    ];    
-
 
44
    
47
 
45
    
48
 
46
    $childs = $page->getPages();
49
        $childs = $page->getPages();
47
    if($childs) {
50
        if ($childs) {
48
        foreach($childs as $child) {
51
            foreach ($childs as $child) {
49
            if(!$acl->isAllowed($session_usertype_id ,  $child->getRoute())) {
52
                if (!$acl->isAllowed($session_usertype_id,  $child->getRoute())) {
50
    		      continue;
53
                    continue;
51
    	    }
54
                }
52
    	    
55
 
53
    	    
56
 
54
 
57
 
55
    	    
58
 
56
    	    
59
 
57
    	    
60
 
58
    	    $childs_level2 = [];
61
                $childs_level2 = [];
59
    	    
62
 
60
    	    
63
 
61
    	    $childsLevel2 = $child->getPages();
64
                $childsLevel2 = $child->getPages();
62
    	    
-
 
63
 
-
 
64
    	    
65
 
65
 
66
 
66
    	    
67
 
67
    	    if($childsLevel2) {
68
 
68
    	        foreach($childsLevel2 as $childLevel2) {
69
 
69
    	            if(!$acl->isAllowed($session_usertype_id ,  $childLevel2->getRoute())) {
70
                if ($childsLevel2) {
70
    	                continue;
71
                    foreach ($childsLevel2 as $childLevel2) {
-
 
72
                        if (!$acl->isAllowed($session_usertype_id,  $childLevel2->getRoute())) {
71
    	            }
73
                            continue;
72
    	            
-
 
73
    	            array_push($childs_level2, [
74
                        }
74
    	                'label' => $childLevel2->getLabel(),
-
 
75
    	                'href' => $childLevel2->getHref(),
-
 
76
    	                
-
 
77
    	            ]);
-
 
Línea -... Línea 75...
-
 
75
 
-
 
76
                        array_push($childs_level2, [
-
 
77
                            'label' => $childLevel2->getLabel(),
78
    	        }
78
                            'href' => $childLevel2->getHref(),
79
    	        
79
 
80
    	       
80
                        ]);
81
    	    }
81
                    }
82
    	    
82
                }
83
    	    
83
 
Línea 84... Línea 84...
84
    	    array_push($option['childs'], [
84
 
Línea 85... Línea 85...
85
    	        'label' => $child->getLabel(),
85
                array_push($option['childs'], [
Línea 86... Línea 86...
86
    	        'href' => $child->getHref(),
86
                    'label' => $child->getLabel(),
87
    	        'childs' => $childs_level2,
87
                    'href' => $child->getHref(),
88
    	    ]);
88
                    'childs' => $childs_level2,
89
    	    
89
                ]);
90
        }
90
            }
91
    }				
91
        }
92
    
92
 
93
    array_push($menu, $option);
93
        array_push($menu, $option);
94
}
94
    }
Línea 124... Línea 124...
124
  logoForNavbar: '$logoForNavbar',
124
  logoForNavbar: '$logoForNavbar',
125
}
125
}
Línea 126... Línea 126...
126
 
126
 
127
//TODO is_chat
127
//TODO is_chat
128
JS;
128
JS;
Línea -... Línea 129...
-
 
129
    $this->inlineScript()->appendScript($js);
129
$this->inlineScript()->appendScript($js);
130
 
-
 
131
    if ($currentNetwork->theme_id == Theme::THEME_LEADERSLINKED_LINKEDIN) {
130
 
132
        $this->inlineScript()->appendFile('/react-bundles/templates/linkedin/navbarLinkedInBundle.js');
-
 
133
    } else {
Línea 131... Línea 134...
131
$this->inlineScript()->appendFile('/react-bundles/templates/linkedin/navbarLinkedInBundle.js');
134
        $this->inlineScript()->appendFile('/react-bundles/navbar/navbarBundle.js');
132
//$this->inlineScript()->appendFile('/react-bundles/navbar/navbarBundle.js');
135
    }
133
 
136
 
134
echo <<<EOT
137
    echo <<<EOT
135
<div id="react_navbar"></div>
138
<div id="react_navbar"></div>
136
<div id="react_navbar_2"></div>
-
 
137
EOT;
139
<div id="react_navbar_2"></div>