session['session_subject_id']) ? Yii::app()->session['session_subject_id']:0; $duo_sub_id = isset(Yii::app()->session['session_duoxueke_subject_id']) ? Yii::app()->session['session_duoxueke_subject_id']:0; $testFlag = isset(Yii::app()->session['testFlag'])?Yii::app()->session['testFlag']:0; $printType = isset($printType)?$printType:''; $subject = isset($subject)?$subject:array(); $urlInfoAll = Yii::app()->request->getPathInfo(); $urlInfo = ''; if($urlInfoAll){ $urlInfoArr = explode('/',$urlInfoAll); if(isset($urlInfoArr[0]) && isset($urlInfoArr[1])){ $urlInfo = strtolower($urlInfoArr[0]).'/'.strtolower($urlInfoArr[1]); } $urlType = ''; foreach ($urlInfoArr as $_url_k => $_url_v) { if ($_url_v == 'type' && isset($urlInfoArr[$_url_k + 1])) { $urlType = $urlInfoArr[$_url_k + 1]; } } if(count($urlInfoArr) > 4){ $urlInfoArr = array_slice($urlInfoArr,0,4); } $urlInfoAll = implode('/',$urlInfoArr); } $basicSubject=$this->basicSubject; unset($basicSubject[18]); unset($basicSubject[19]); $subjectNameArr = array( 3 => '数学', 8 => '英语', 9 => '语文', 12 => '物理', 13 => '化学', 14 => '生物', 15 => '政治', 16 => '历史', 17 => '地理', 18 => '理综', 19 => '文综', ); $subjectNameArr=Yii::app()->params['subjectId']; unset($subjectNameArr[20]); unset($subjectNameArr[6]); unset($subjectNameArr[51]); $_num=''; $use_version = ''; if(isset(Yii::app()->session['coachInfo']->use_version)) { $use_version = Yii::app()->session['coachInfo']->use_version; }else { $use_version = Yii::app()->session['coachInfo']['use_version']; } if(!$use_version) { $use_version = 100; } $version_number = implode('',explode('.',$use_version)); if(strlen($version_number)<7) { for($i=0;$i<7-strlen($version_number);$i++) { $_num.='0'; } } $version_number=(int)$version_number.$_num; $menuList=array( //打印试卷 'print'=>array('print/index','print/class_exam','print/change','print/changescan','print/modifythirdexam','print/gettaskdetail'), //校本作业 'homework'=>array('homework/index','homework/exam_list','homework/change'), //导入成绩 'record'=>array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent','record/check_excel','record/handle_repeat','record/importStudentExcel','record/checkimgexcel','record/check_img_field_first','record/check_img_student_name','record/matchingimg','record/handle_repeat_img','record/handle_existent_img','record/bindingImg','record/change_value_img','record/handle_existent_img','record/update_images','record/change_check_img'), //第三方 'third'=>array('third/index','third/assist','third/exam_list','third/change','third/thirdview','third/import','third/modifythirdexam','third/thirdview_under_line','third/editthirdunderline','third/gettaskdetail','third/thirdcardsecond','third/thirdview_section','third/thirdview_duo','third/thirdview_section'), //统考 'cylet'=>array('cylet/index','cylet/edit'), //还原考试 'restore'=>array('print/restore'), //用户成绩推送设置 'zhiliao'=>array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist','zhiliao/upload','zhiliao/importstore','zhiliao/check_excel','zhiliao/handle_repeat','zhiliao/handle_existent','zhiliao/reportsetting','zhiliao/unpaidusersetting'), ); $subjectHomePage=array(); //新版本菜单 if(Yii::app()->params['section']==0){ $subjectHomePage[$sub_id]='third/index'; $meauArr = array( array( 'name' => '第三方试卷', 'url' => $this->createUrl("third/index"), 'button_active' => inArray($urlInfo,$menuList['third']), 'is_show' => true, 'all_nav'=>$menuList['third'] ), array( 'name' => '导入成绩', 'url' => $this->createUrl("record/importscore"), 'button_active' => inArray($urlInfo,$menuList['record']), 'is_show' => true, 'all_nav'=>$menuList['record'] ), array( 'name' => '全学科统考', 'url' => $this->createUrl("cylet/index"), 'button_active' => inArray($urlInfo,$menuList['cylet']), 'is_show' => true, 'all_nav'=>$menuList['cylet'] ), array( 'name' => '还原考试', 'url' => $this->createUrl("print/restore"), 'button_active' => inArray($urlInfo,$menuList['restore']), 'is_show' => $testFlag == 1 , 'all_nav'=>$menuList['restore'] ), ); }elseif(Yii::app()->params['section']==3){ //中职 $subjectHomePage[$sub_id]='print/index'; $meauArr = array( array( 'name' => '打印试卷', 'url' => $this->createUrl("print/index"), 'button_active' => inArray($urlInfo,$menuList['print']), 'is_show' => true, 'all_nav'=>$menuList['print'] ), array( 'name' => '第三方试卷', 'url' => $this->createUrl("third/index"), 'button_active' => inArray($urlInfo,$menuList['third']), 'is_show' => true, 'all_nav'=>$menuList['third'] ), array( 'name' => '导入成绩', 'url' => $this->createUrl("record/importscore"), 'button_active' => inArray($urlInfo,$menuList['record']), 'is_show' => true, 'all_nav'=>$menuList['record'] ), array( 'name' => '全学科统考', 'url' => $this->createUrl("cylet/index"), 'button_active' => inArray($urlInfo,$menuList['cylet']), 'is_show' => true, 'all_nav'=>$menuList['cylet'] ), array( 'name' => '还原考试', 'url' => $this->createUrl("print/restore"), 'button_active' => inArray($urlInfo,$menuList['restore']), 'is_show' => $testFlag == 1 , 'all_nav'=>$menuList['restore'] ), ); }elseif (in_array($sub_id, Yii::app()->params['mathSubjectId'])) { $subjectHomePage[$sub_id]='print/index'; $meauArr = array( array( 'name' => '打印试卷', 'url' => $this->createUrl("print/index"), 'button_active' => inArray($urlInfo,$menuList['print']), 'is_show' => true, 'all_nav'=>$menuList['print'] ), array( 'name' => '第三方试卷', 'url' => $this->createUrl("third/index"), 'button_active' => inArray($urlInfo,$menuList['third']), 'is_show' => true, 'all_nav'=>$menuList['third'] ), array( 'name' => '校本作业', 'url' => $this->createUrl("homework/index"), 'button_active' => inArray($urlInfo,$menuList['homework']), 'is_show' => true, 'all_nav'=>$menuList['homework'] ), array( 'name' => '导入成绩', 'url' => $this->createUrl("record/importscore"), 'button_active' => inArray($urlInfo,$menuList['record']), 'is_show' => true, 'all_nav'=>$menuList['record'] ), array( 'name' => '全学科统考', 'url' => $this->createUrl("cylet/index"), 'button_active' => inArray($urlInfo,$menuList['cylet']), 'is_show' => true, 'all_nav'=>$menuList['cylet'] ), // array( // 'name' => '用户成绩推送设置', // 'url' => $this->createUrl("zhiliao/index"), // 'button_active' => inArray($urlInfo,$menuList['zhiliao']), // 'is_show' => true, // 'all_nav'=>$menuList['zhiliao'] // ), array( 'name' => '还原考试', 'url' => $this->createUrl("print/restore"), 'button_active' => inArray($urlInfo,array('print/restore')), 'is_show' => $testFlag == 1, 'all_nav'=>$menuList['restore'] ), ); }elseif(in_array($sub_id,array(8,12,13))){ $subjectHomePage[$sub_id]='print/index'; $meauArr = array( array( 'name' => '打印试卷', 'url' => $this->createUrl("print/index"), 'button_active' => inArray($urlInfo,$menuList['print']), 'is_show' => true, 'all_nav'=>$menuList['print'] ), array( 'name' => '第三方试卷', 'url' => $this->createUrl("third/index"), 'button_active' => inArray($urlInfo,$menuList['third']), 'is_show' => true, 'all_nav'=>$menuList['third'] ), array( 'name' => '校本作业', 'url' => $this->createUrl("homework/index"), 'button_active' => inArray($urlInfo,$menuList['homework']), 'is_show' => true, 'all_nav'=>$menuList['homework'] ), array( 'name' => '导入成绩', 'url' => $this->createUrl("record/importscore"), 'button_active' => inArray($urlInfo,$menuList['record']), 'is_show' => true, 'all_nav'=>$menuList['record'] ), array( 'name' => '全学科统考', 'url' => $this->createUrl("cylet/index"), 'button_active' => inArray($urlInfo,$menuList['cylet']), 'is_show' => true, 'all_nav'=>$menuList['cylet'] ), // array( // 'name' => '用户成绩推送设置', // 'url' => $this->createUrl("zhiliao/index"), // 'button_active' => inArray($urlInfo,$menuList['zhiliao']), // 'is_show' => true, // 'all_nav'=>$menuList['zhiliao'] // ), ); if( Yii::app()->params['section']==0){ //初中学段 unset($meauArr[0]); } }else{ $subjectHomePage[$sub_id]='print/index'; $meauArr = array( array( 'name' => '打印试卷', 'url' => $this->createUrl("print/index"), 'button_active' => inArray($urlInfo,$menuList['print']), 'is_show' => true, 'all_nav'=>$menuList['print'] ), array( 'name' => '第三方试卷', 'url' => $this->createUrl("third/index"), 'button_active' => inArray($urlInfo,$menuList['third']), 'is_show' => true, 'all_nav'=>$menuList['third'] ), array( 'name' => '校本作业', 'url' => $this->createUrl("homework/index"), 'button_active' => inArray($urlInfo,$menuList['homework']), 'is_show' => true, 'all_nav'=>$menuList['homework'] ), array( 'name' => '导入成绩', 'url' => $this->createUrl("record/importscore"), 'button_active' => inArray($urlInfo,$menuList['record']), 'is_show' => true, 'all_nav'=>$menuList['record'] ), array( 'name' => '全学科统考', 'url' => $this->createUrl("cylet/index"), 'button_active' => inArray($urlInfo,$menuList['cylet']), 'is_show' => true, 'all_nav'=>$menuList['cylet'] ), // array( // 'name' => '用户成绩推送设置', // 'url' => $this->createUrl("zhiliao/index"), // 'button_active' => inArray($urlInfo,$menuList['zhiliao']), // 'is_show' => true, // 'all_nav'=>$menuList['zhiliao'] // ), ); } $allNavUrl=array(); foreach ($meauArr as $value){ $allNavUrl=array_merge($allNavUrl,$value['all_nav']); } if(!inArray($urlInfo,$allNavUrl)){ return $this->redirect(array($subjectHomePage[$sub_id])); } $subjectNameArr=Yii::app()->params['subjectId']; unset($subjectNameArr[20]); unset($subjectNameArr[6]); unset($subjectNameArr[51]); ?>