<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/11/011
 * Time: 19:37
 */
use yii\helpers\Url;

$data['id'] = Yii::$app->user->identity->getId();
$result = (new \frontend\models\AdminApi())->getAdminRoleByUserId($data);
$authorityList = $result['data'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>BIT System 后台管理平台</title>
    <link href="<?= STATIC_URL?>/static/cp/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATIC_URL?>/static/cp/css/base.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATIC_URL?>/static/cp/css/admin.css" rel="stylesheet" type="text/css" />
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="<?= STATIC_URL?>/static/cp/js/jquery-1.7.2.min.js"></script>
    <script src="<?= STATIC_URL?>/static/cp/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="left-menu">
    <h3><i class="icon-th-large"></i> 内容管理</h3>
    <ul>
        <?php if ($data['id'] != 1) { ?>
        <?php if (in_array('ROLE_article', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/article-project/article-set']) ?>" target="mainFrame">文章管理</a></li>
        <?php } ?>      
        <?php if (in_array('ROLE_articleCategory', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/article-category/list']) ?>" target="mainFrame">文章分类管理</a></li>
        <?php } ?>      
        <?php if (in_array('ROLE_activity', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/article/list?id=9']) ?>" target="mainFrame">活动管理</a></li>
        <?php } ?>
        <?php if (in_array('ROLE_indexRegister', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/index-activity/get-register-list']) ?>" target="mainFrame">首页报名记录</a></li>
        <?php } ?>
        <?php if (in_array('ROLE_partner', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/index-activity/get-partner-apply']) ?>" target="mainFrame">合作伙伴报名</a></li>
        <?php }} else { ?>
        <li><a href="<?= Url::to(['/cp/article-project/article-set']) ?>" target="mainFrame">文章管理</a></li>
        <li><a href="<?= Url::to(['/cp/article-category/list']) ?>" target="mainFrame">文章分类管理</a></li>
        <li><a href="<?= Url::to(['/cp/article/list?id=3']) ?>" target="mainFrame">活动管理</a></li>
        <li><a href="<?= Url::to(['/cp/index-activity/get-register-list']) ?>" target="mainFrame">首页报名记录</a></li>
        <li><a href="<?= Url::to(['/cp/index-activity/get-partner-apply']) ?>" target="mainFrame">合作伙伴报名</a></li>
        <?php } ?>
    </ul>
   
</div>
</body>
</html>
