个性化引导菜单

时间:2019-05-22 20:13:10

标签: php bootstrap-4

我正在尝试将引导菜单分为3个部分:

  • 每个人的选择
  • 当前会话用户的“项目”菜单
  • 管理菜单

我已经尝试从SO复制各种代码,并在Google周围搜索了几天,但我只是被卡住了。我需要您的帮助,亲爱的SO社区!

    // This should appear for all users
    $dm->main_nav                   = array(
        array(
            'name'  => 'Profile',
            'icon'  => 'si si-user',
            'url'   => 'profile.php'
            ),
        array(
            'name'  => 'Exchange',
            'icon'  => 'si si-briefcase',
            'url'   => 'exchange.php'
            ),
        array(
            'name'  => 'Deck',
            'icon'  => 'si si-directions',
            'url'   => 'deck.php'
            ),
    // Here I want to list all projects this user has currently in $DB->projects.userid == $_SESSION(id)
        array(
            'name'  => 'Projects',
            'type'  => 'heading'
            ),
        array(
            'name'  => 'Current Project #1',
            'icon'  => 'fa fa-x',
            'url'   => 'project.php?id=$projectid'
        ),
        array(
            'name'  => 'Current Project #2',
            'icon'  => 'fa fa-x',
            'url'   => 'project.php?id=$projectid'
        ),
        array(
            'name'  => 'New Project',
            'icon'  => 'fa fa-plus-circle',
            'url'   => 'order.php'
        ),
    // This whole section should only appear if $DB->users.admin = 1.
        array(
            'name'  => 'Admin',
            'type'  => 'heading'
        ),    
        array(
            'name'  => 'Dashboard',
            'icon'  => 'si si-cursor',
            'url'   => 'admin_dashboard.php'
        ),
        array(
            'name'  => 'Projects',
            'icon'  => 'si si-tag',
            'url'   => 'admin_projects.php'
        ),
        array(
            'name'  => 'Users',
            'icon'  => 'si si-users',
            'url'   => 'admin_users.php'
        )

0 个答案:

没有答案