[eluser]kacyblack[/eluser]
Thanks I was able to fix the last question I asked on my own, But I have a new question and what am trying to achieve this time around is to display a certain DASHBOARD WITH CHART if a user with the Customer role logs in, then another type of DASHBOARD WITHOUT CHART will also display when a user with an Admin Role logs in and this is what i tried and it did not work: AM USING SKUNKBAD'S COMMUNITY-AUTH.
CONTROLLER: if ( ! function_exists('admin_side_menu'))
{
function admin_side_menu($menu_array) {
$CI =& get_instance();
echo '<ul>'; // Open the menu container
//go through each top level menu item
foreach($menu_array as $item) {
$admin_group = $CI->config->item('admin_group', 'ion_auth');
$item['access'] = array_key_exists('access', $item) ? $item['access'] : $admin_group;
if($CI->ion_auth->FALSE){
echo '<li><a href="'.$item['link'].'">'.$item['label'].'</a>';
//see if this menu has children
if(array_key_exists('children', $item)) {
echo '<ul>';
//echo the child menu
admin_side_menu($item['children']);
echo '</ul>';
}
echo '</li>';
}// end if
} // end foreach
echo '</ul>';
}
}
VIEW:
$menu = array(
array(
'label' => 'Dashboard',
'link' => 'admin/dashboard',
'access' => array('system_admin', 'hr', 'guest'),
'children' => array(
array(
'label' => 'Admin Can See',
'link' => 'http://google.com',
'access' => array('system_admin', 'hr', 'guest'),
),
array(
'label' => 'Guest Can See',
'link' => 'http://google.com',
'access' => array('system_admin', 'hr', 'guest'),
)
)
),
);
echo '<nav id="page-leftbar" role="navigation">';
echo admin_side_menu($menu);
echo '</nav>';
Please help me out asap, Thanks Skunkbad you deserve a tip!