Changeset 33302
- Timestamp:
- 01/05/12 06:26:43 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sw2DecorationToolkitPlugin/branches/2.0/README
r25375 r33302 38 38 Users: '@sf_guard_user' 39 39 Groups: '@sf_guard_group' 40 # Above are simple examples. Below will be advanced. 41 'Admin Advanced': 42 Home: 43 'href': '@homepage' 44 'id': 'home_link' 45 Logout: 46 'href': '@sf_guard_signout' 47 'id': 'logout_link' 48 'Mental': 49 _permission: 'Mental Admin Menu' 50 _children: 51 Builder: '@mental_builder' 52 Category: '@mental_category' 53 Circuit: '@mental_circuit' 54 Exercise: '@mental_exercise' 55 Program: '@mental_program' 40 56 41 57 Then update the layout.php for the correct app … … 78 94 # /apps/frontend/public/modules/home/templates/indexSuccess.php 79 95 <?php add_body_class('home_class'); /> 80 96 81 97 # Outputs the following html 82 98 <body class=".home .index .home_class"> plugins/sw2DecorationToolkitPlugin/branches/2.0/lib/helper/sw2AdminLayoutHelper.php
r32940 r33302 48 48 49 49 function Get_Array_Keys_UL($array = array()) { 50 51 $sf_context = sfContext::getInstance(); 52 $sf_user = $sf_context->getUser(); 53 50 54 $recursion = __FUNCTION__; 51 55 if(empty($array)) … … 53 57 $out = '<ul>' . "\n"; 54 58 foreach($array as $key => $elem) 59 55 60 if(is_array($elem) && !isset($elem['href'])) { 56 $out .= '<li>' . $key . $recursion($elem) . '</li>' . "\n"; 61 if(isset($elem['_permission'])) { 62 if($sf_user->hasCredential($elem['_permission'])) { 63 $out .= '<li>' . $key . $recursion($elem['_children']) . '</li>' . "\n"; 64 } 65 } else { 66 $out .= '<li>' . $key . $recursion($elem) . '</li>' . "\n"; 67 } 57 68 } 69 elseif(substr($key,0,1) =='_') {} 58 70 elseif(is_array($elem)) { 59 71 $href = $elem['href']; 60 72 $options = $elem; 61 73 unset($options['href']); 74 if(isset($elem['_permission']) && !$sf_user->hasCredential($elem['_permission'])) { 75 continue; 76 } 77 unset($options['_permission']); 62 78 $out .= '<li>' . link_to($key, $href, $options) . '</li>'; 63 79 } else {