<?php
include_once(_DIR_TO_CLASS.'/c_page.php');
class c_page_cab_quiz_known_card extends c_page
{
    public $h1='Контроль знаний - карточка знания';
    public $rec_known ;
    var $use_fusioncharts=1 ;

    function __construct($options=array())
    {   if (_CUR_ROOT_DIR_NAME=='frame') $this->body_class='no_menu';
        parent::__construct($options);
    }

    function set_head_tags()
    {   parent::set_head_tags();
        $this->HEAD['css'][]=_PATH_TO_EXT.'/quiz/style.css';
    }


    function select_obj_info()
     { if (_CUR_ID)
       { $this->rec_known=QUIZ()->get_theme_by_id(_CUR_ID) ;
         if ($this->rec_known['pkey'])
         { //$this->h1=$this->rec_theme['obj_name'] ;
           $arr=TREE('quiz_themes')->get_arr_parents_names($this->rec_known['pkey'],array('from_level'=>2)) ;
           $this->h1=implode(' / ',$arr) ;
           $_SESSION['cur_obj_page_dir'][_CUR_ROOT_DIR_NAME][$this->rec_known['tkey']][$this->rec_known['clss']]=str_replace(_CUR_ID,'***',_CUR_PAGE_DIR) ;
         }
         if (!$this->rec_known['pkey']) $this->result=404 ;
       } else $this->result=404 ;

     }


     function prepare_menu_config()
     {
         $cnt_questions=execSQL_value('select count(pkey) from quiz_questions where parent='.$this->rec_known['pkey']) ;

         $menu=[] ; $BASE_URL_THEME_CARD='/'._CUR_ROOT_DIR_NAME.'/quiz/known/card/'.$this->rec_known['pkey'] ;

         $menu[$BASE_URL_THEME_CARD.'/']='Карточка знания' ;
//         if ($this->rec_known['viewer_name']) $menu[$BASE_URL_THEME_CARD.'/stats/']='Статистика' ;
//         if ($this->rec_known['viewer_name']) $menu[$BASE_URL_THEME_CARD.'/graf/']='Оценка знаний' ;

         $menu[$BASE_URL_THEME_CARD.'/editor/']='Редактировать' ;
         $menu[$BASE_URL_THEME_CARD.'/questions/']='Билеты' ;

         // только для разделов, связанных с мероприятияем КЗ

         $menu[$BASE_URL_THEME_CARD.'/db/']='Исходные данные' ;

         return($menu) ;
     }

     function menu_config()
     {
        if (_CUR_ROOT_DIR_NAME=='window') $this->menu=$this->prepare_menu_config() ;
     }

     function panel_main_menu()
     {
         if (_CUR_ROOT_DIR_NAME!='frame') parent::panel_main_menu() ;
     }

     function second_menu_config()
     {
         if (_CUR_ROOT_DIR_NAME=='frame') $this->second_menu=$this->prepare_menu_config() ;
     }

    function block_main()
    {
        $this->page_title() ;






    }

    function panel_known_manual()
    {
        ?><div style="border: 1px solid #dadada;padding: 20px;font-size: 16px;background-color: #eaeaea;margin-bottom: 15px;color: #27272796;"><?echo nl2br($this->rec_known['manual'])?></div><?
    }


}

?>
