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 = ''; $productType = Req::get('productType') ? Req::get('productType'):(Req::get('type') ? Req::get('type'):0); if($sub_id==8){ $http = http('goods-type/coach/goods-type-school', 'GET', $this->authUsername); $waikanOrder = json_decode($http,true); } $showWK=0; if(isset($waikanOrder['errCode']) && $waikanOrder['errCode']=='00'){ if(isset($waikanOrder['data']) && $waikanOrder['data']){ $showWK=1; } } 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($urlType==''){ $urlType=Req::get('type'); } $countNumber=4; if($this->action=='selectstubyenglishreading'){ $countNumber=6; } if(count($urlInfoArr) > $countNumber){ $urlInfoArr = array_slice($urlInfoArr,0,$countNumber); } $urlInfoAll = implode('/',$urlInfoArr); } $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; $subjectHomePage=array(); if(Yii::app()->params['section']==0){ $subjectHomePage[$sub_id]='export/index_duo'; $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')), 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), ); // if($sub_id == 41){ // $meauArr = array_merge($meauArr,array( // array( // 'name' => '错题本', // 'url' => $this->createUrl("junior/product",array('type'=>1)), // 'button_active' => inArray($urlInfoAll,array('junior/product/type/1','junior/product_stu/type/1')), // 'is_show' => true, // 'all_nav'=>array('junior/product','junior/product_stu') // ), // array( // 'name' => '个性化学习宝', // 'url' => $this->createUrl("junior/product",array('type'=>30)), // 'button_active' => inArray($urlInfoAll,array('junior/product/type/30','junior/product_stu/type/30')), // 'is_show' => true, // 'all_nav'=>array('junior/product','junior/product_stu') // ), // )); // } }elseif (Yii::app()->params['section']==3) { $subjectHomePage[$sub_id]='export/index_duo'; $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')), 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), ); }elseif (in_array($sub_id, Yii::app()->params['mathSubjectId'])) { $subjectHomePage[$sub_id]='export/index'; $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index"), 'button_active' => inArray($urlInfo,array('export/index','export/batch','export/statistics','export/pastacdemicrs')), 'is_show' => true, 'all_nav'=>array('export/index','export/batch','export/statistics','export/pastacdemicrs') ), array( 'name' => '纠错本', 'url' => $this->createUrl("correct/index"), 'button_active' => inArray($urlInfo,array('correct/index','correct/classlist','correct/stu')), 'is_show' => true, 'all_nav'=>array('correct/index','correct/classlist','correct/stu') ), // array( // 'name' => '个性化学习方案', // 'url' => $this->createUrl("print/sub_index", array('type' => 'isp')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/isp')) || (inArray($urlInfo,array('print/changeraisescheme','print/sub_index')) && $urlType == 'isp'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changeraisescheme') // ), // array( // 'name' => '个性化学习宝', // 'url' => $this->createUrl("print/sub_index", array('type' => 'studytrend')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/studytrend')) || (inArray($urlInfo,array('print/changeraisescheme','print/sub_index')) && $urlType == 'studytrend'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changeraisescheme') // ), // array( // 'name' => '阶段复习学习宝', // 'url' => $this->createUrl("print/student_product"), // 'button_active' => inArray($urlInfo,array('print/student_product','print/class_student_product')), // 'is_show' => true, // 'all_nav'=>array('print/student_product','print/class_student_product') // ), // // array( // 'name' => '二轮学习指导手册', // 'url' => $this->createUrl("print/review"), // 'button_active' => inArray($urlInfo,array('print/review','print/reviewsetting','print/selectstubymath')), // 'is_show' => true, // 'all_nav'=>array('print/review','print/reviewsetting','print/selectstubymath') // ), // array( // 'name' => '好题本', // 'url' => $this->createUrl("htb/index"), // 'button_active' => inArray($urlInfo,array('htb/index','htb/setting','htb/selectstu')), // 'is_show' => true, // 'all_nav'=>array('htb/index','htb/setting','htb/selectstu') // ), // array( // 'name' => '个性化学习宝督学反馈', // 'url' => $this->createUrl("supervise/list"), // 'button_active' => inArray($urlInfo,array('supervise/list')), // 'is_show' => true, // 'all_nav'=>array('supervise/list') // ), // array( // 'name' => '假期报告(知识账单)', // 'url' => $this->createUrl("export/holiday_index"), // 'button_active' => inArray($urlInfo,array('export/holiday_index','export/selectstubyholidayreport','export/holiday_teacher_index')), // 'is_show' => true, // 'all_nav'=>array('export/holiday_index','export/selectstubyholidayreport','export/holiday_teacher_index') // ), // array( // 'name' => '方法宝', // 'url' => $this->createUrl("productexam/product",array('type'=>31)), // 'button_active' => inArray($urlInfo,array('productexam/product','productexam/product_stu')), // 'is_show' => true, // 'all_nav'=>array('productexam/product','productexam/product_stu') // ), // array( // 'name' => '专题宝', // 'url' => $this->createUrl("special/index"), // 'button_active' => inArray($urlInfo,array('special/index','special/setting','special/stu')), // 'is_show' => true, // 'all_nav'=>array('special/index','special/setting','special/stu') // ), // array( // 'name' => '假期作业', // 'url' => $this->createUrl("generalproduct/index",array('productType'=>ProductDownload::PRODUCT_TYPE_HOLIDAY_HOMEWORK)), // 'button_active' => inArray($productType,array(ProductDownload::PRODUCT_TYPE_HOLIDAY_HOMEWORK)) && inArray($urlInfo,array('generalproduct/index','generalproduct/setting','generalproduct/stu',)), // 'is_show' => true, // 'all_nav'=>array('generalproduct/index','generalproduct/setting','generalproduct/stu',) // ), // array( // 'name' => '错题精练', // 'url' => $this->createUrl("generalproduct/index",array('productType'=>ProductDownload::PRODUCT_TYPE_WRONG_REFINE)), // 'button_active' => inArray($productType,array(ProductDownload::PRODUCT_TYPE_WRONG_REFINE)) && inArray($urlInfo,array('generalproduct/index','generalproduct/setting','generalproduct/stu',)), // 'is_show' => true, // 'all_nav'=>array('generalproduct/index','generalproduct/setting','generalproduct/stu',) // ), // array( // 'name' => 'e学慧通', // 'url' => $this->createUrl("product/index"), // 'button_active' => inArray($urlInfo,array('product/index',)), // 'is_show' => true, // 'all_nav'=>array('product/index',) // ), ); }elseif($sub_id == 8){ $subjectHomePage[$sub_id]='export/index_duo'; $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')), 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), // array( // 'name' => '错题本', // 'url' => $this->createUrl("print/sub_index",array('type'=>'third_wb')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/third_wb')) || inArray($urlInfo,array('print/changewrongtopic')) || (inArray($urlInfo,array('print/sub_index')) && $urlType == 'third_wb'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changewrongtopic') // ), // array( // 'name' => '英语个性化学习宝', // 'url' => $this->createUrl("print/sub_index", array('type' => 'third_isp')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/third_isp')) || (inArray($urlInfo,array('print/sub_index')) && $urlType == 'third_isp') || inArray($urlInfo,array('print/selectstubymainly','print/changeraisescheme','print/mrv','print/mainly_revision','print/selectstubymrv','print/mrv3','print/mrvsetting','print/setting_mainly')), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/selectstubymainly','print/changeraisescheme','print/mrv','print/mainly_revision','print/selectstubymrv','print/mrv3','print/mrvsetting','print/setting_mainly') // ), // array( // 'name' => '外刊宝(老版)', // 'url' => $this->createUrl("print/english_reading",array('cg'=>1)), // 'button_active' => inArray($urlInfoAll,array('print/english_reading','print/english_reading/cg/1','print/selectStuByEnglishReading/cg/1/pt/0','print/englishreadingsetting','print/englishreading3','print/englishreadingtime')), // 'is_show' => in_array($sub_id, array(8)) && $showWK?true:false, // 'all_nav'=>array('print/english_reading','print/selectstubyenglishreading','print/englishreadingsetting','print/englishreading3','print/englishreadingtime') // ), // array( // 'name' => '基础宝', // 'url' => $this->createUrl("print/english_reading",array('pt'=>1,'cg'=>2)), // 'button_active' => inArray($urlInfoAll,array('print/english_reading/pt/1','print/selectStuByEnglishReading/cg/2/pt/1','print/englishreadingsetting','print/englishreading3','print/englishreadingtime')), // 'is_show' => in_array($sub_id, array(8))?true:false, // 'all_nav'=>array('print/english_reading','print/selectstubyenglishreading','print/englishreadingsetting','print/englishreading3','print/englishreadingtime') // ), // array( // 'name' => '外刊宝', // 'url' => $this->createUrl("print/english_reading",array('pt'=>2,'cg'=>2)), // 'button_active' => inArray($urlInfoAll,array('print/english_reading/pt/2','print/selectStuByEnglishReading/cg/2/pt/2','print/englishreadingsetting','print/englishreading3','print/englishreadingtime')), // 'is_show' => in_array($sub_id, array(8))?true:false, // 'all_nav'=>array('print/english_reading','print/selectstubyenglishreading','print/englishreadingsetting','print/englishreading3','print/englishreadingtime') // ), // array( // 'name' => '热点宝', // 'url' => $this->createUrl("print/english_reading",array('pt'=>3,'cg'=>2)), // 'button_active' => inArray($urlInfoAll,array('print/english_reading/pt/3','print/selectStuByEnglishReading/cg/2/pt/3','print/englishreadingsetting','print/englishreading3','print/englishreadingtime')), // 'is_show' => in_array($sub_id, array(8))?true:false, // 'all_nav'=>array('print/english_reading','print/selectstubyenglishreading','print/englishreadingsetting','print/englishreading3','print/englishreadingtime') // ), // array( // 'name' => '词汇宝', // 'url' => $this->createUrl("magic/index"), // 'button_active' => inArray($urlInfo,array('magic/index','magic/setting','magic/stu')), // 'is_show' => true, // 'all_nav'=>array('magic/index','magic/setting','magic/stu') // ), // array( // 'name' => '写作宝', // 'url' => $this->createUrl("writing/index"), // 'button_active' => inArray($urlInfo,array('writing/index','writing/setting','writing/stu')), // 'is_show' => true, // 'all_nav'=>array('writing/index','writing/setting','writing/stu') // ), // array( // 'name' => '假期作业', // 'url' => $this->createUrl("generalproduct/index",array('productType'=>ProductDownload::PRODUCT_TYPE_HOLIDAY_HOMEWORK)), // 'button_active' => inArray($urlInfo,array('generalproduct/index','generalproduct/setting','generalproduct/stu',)), // 'is_show' => true, // 'all_nav'=>array('generalproduct/index','generalproduct/setting','generalproduct/stu',) // ), // array( // 'name' => 'e学慧通', // 'url' => $this->createUrl("product/index"), // 'button_active' => inArray($urlInfo,array('product/index',)), // 'is_show' => true, // 'all_nav'=>array('product/index',) // ), ); }elseif($sub_id == 12){ $subjectHomePage[$sub_id]='export/index_duo'; $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')) , 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), // array( // 'name' => '错题本', // 'url' => $this->createUrl("print/sub_index",array('type'=>'third_wb')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/third_wb')) || inArray($urlInfo,array('print/changewrongtopic')) || (inArray($urlInfo,array('print/sub_index')) && $urlType == 'third_wb'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changewrongtopic') // ), // array( // 'name' => '个性化学习方案', // 'url' => $this->createUrl("print/sub_index", array('type' => 'isp')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/isp')) || (inArray($urlInfo,array('print/changeraisescheme','print/sub_index')) && $urlType == 'isp'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changeraisescheme') // ), // array( // 'name' => '个性化学习宝', // 'url' => $this->createUrl("print/sub_index", array('type' => 'studytrend')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/studytrend')) || (inArray($urlInfo,array('print/changeraisescheme','print/sub_index')) && $urlType == 'studytrend'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changeraisescheme') // ), // array( // 'name' => '阶段复习学习宝', // 'url' => $this->createUrl("print/student_product"), // 'button_active' => inArray($urlInfo,array('print/student_product','print/class_student_product')), // 'is_show' => true, // 'all_nav'=>array('print/student_product','print/class_student_product') // ), // // array( // 'name' => '假期作业', // 'url' => $this->createUrl("generalproduct/index",array('productType'=>ProductDownload::PRODUCT_TYPE_HOLIDAY_HOMEWORK)), // 'button_active' => inArray($productType,array(ProductDownload::PRODUCT_TYPE_HOLIDAY_HOMEWORK)) && inArray($urlInfo,array('generalproduct/index','generalproduct/setting','generalproduct/stu',)), // 'is_show' => true, // 'all_nav'=>array('generalproduct/index','generalproduct/setting','generalproduct/stu',) // ), // array( // 'name' => '错题精练', // 'url' => $this->createUrl("generalproduct/index",array('productType'=>ProductDownload::PRODUCT_TYPE_WRONG_REFINE)), // 'button_active' => inArray($productType,array(ProductDownload::PRODUCT_TYPE_WRONG_REFINE)) && inArray($urlInfo,array('generalproduct/index','generalproduct/setting','generalproduct/stu',)), // 'is_show' => true, // 'all_nav'=>array('generalproduct/index','generalproduct/setting','generalproduct/stu',) // ), // array( // 'name' => 'e学慧通', // 'url' => $this->createUrl("product/index"), // 'button_active' => inArray($urlInfo,array('product/index',)), // 'is_show' => true, // 'all_nav'=>array('product/index',) // ), ); }else{ $subjectHomePage[$sub_id]='export/index_duo'; if(isset($this->extendSubject[$sub_id]) && $sub_id!=21){ $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')) , 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), ); }else{ $meauArr = array( array( 'name' => '导出报告', 'url' => $this->createUrl("export/index_duo"), 'button_active' => inArray($urlInfoAll,array('export/index_duo','export/batch_duo')) , 'is_show' => true, 'all_nav'=>array('export/index_duo','export/batch_duo') ), // array( // 'name' => '错题本', // 'url' => $this->createUrl("print/sub_index",array('type'=>'third_wb')), // 'button_active' => inArray($urlInfoAll,array('print/sub_index/type/third_wb')) || inArray($urlInfo,array('print/changewrongtopic')) || (inArray($urlInfo,array('print/sub_index')) && $urlType == 'third_wb'), // 'is_show' => true, // 'all_nav'=>array('print/sub_index','print/changewrongtopic') // ), ); } } $allNavUrl=array(); foreach ($meauArr as $value){ $allNavUrl=array_merge($allNavUrl,$value['all_nav']); } if(!inArray($urlInfo,$allNavUrl)){ return $this->redirect(array($subjectHomePage[$sub_id])); } ?>