コード例 #1
0
ファイル: courses.php プロジェクト: andrejjursa/list-lms
 public function index()
 {
     $period_id = $this->input->post('period_id');
     $filter = $this->inject_stored_filter();
     $this->_initialize_student_menu();
     $this->_select_student_menu_pagetag('courses');
     $this->parser->add_css_file('frontend_courses.css');
     $this->parser->add_js_file('courses/selection.js');
     $cache_id = $this->usermanager->get_student_cache_id('period_' . ($period_id ? $period_id : @$filter['period_id']));
     if (!$this->_is_cache_enabled() || !$this->parser->isCached($this->parser->find_view('frontend/courses/index.tpl'), $cache_id)) {
         $periods = new Period();
         if (intval($period_id) == 0) {
             if (isset($filter['period_id'])) {
                 $periods->where('id', $filter['period_id']);
             } else {
                 $periods->limit(1);
             }
         } else {
             $periods->where('id', $period_id);
         }
         $periods->order_by('sorting', 'asc')->get();
         $filter['period_id'] = $periods->id;
         $this->store_filter($filter);
         $this->inject_period_options();
         $this->parser->assign(array('periods' => $periods));
     }
     $this->parser->parse('frontend/courses/index.tpl', array(), FALSE, $this->_is_cache_enabled(), $cache_id);
 }