<?php
include_once('c_quiz_known_card.php');
class c_page_cab_quiz_known_card_editor extends c_page_cab_quiz_known_card
{
    public $h1='Контроль знаний - карточка знания - редактировать';
    var $use_textarea_autosize=1 ;

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

    function panel_quiz_theme()
    {
        $form=new i_form();
        $form->form_open();
        $form->row_open();
        $form->filter_section_input_text('section[name]','Название знания',4,array('cur_value'=>$this->rec_known['obj_name']));
        $form->row_close();
        $form->row_open();
        $form->filter_section_textarea('section[manual]','Текст',11,array('cur_value'=>$this->rec_known['manual'],'style'=>'height:400px;'));
        $form->row_close();
        $form->row_open(['class'=>'center']);
        $form->button('Сохранить','quiz/section_save',['item_id'=>$this->rec_known['pkey'],'id'=>'button_save']);
        if ($this->rec_known['parent']>0) $form->button('Удалить знание','quiz/get_panel_theme_delete',['item_id'=>$this->rec_known['pkey']]);
        //$form->button('Экспортировать раздел','quiz/get_panel_theme_export',['id'=>$this->rec_known['pkey'],'item_type'=>'theme']);
        $form->row_close();
        $form->form_close();



    }

    function panel_PDF_upload()
    {
        include(_DIR_EXT.'/upload_files/panel_upload_files.php');
        panel_upload_files(array('text'=>'Перетяните и отпустите сюда<br>PDF-документ',
                                                   'upload_url'=>'/services/quiz/section/upload_file/',
                                                   //'upload_params'=>array('event_id'=>$this->rec_event['pkey']),
                                                    'file_filter'=>'pdf;',
                                                    'SendFormOnUploadSuccess'=>0,
                                                    'view_debug_panel'=>0,
                                                    'style_panel'=>'width:400px;margin:20px auto;;',
                                                    'onUploadSuccessFunction'=>'onUploadSuccessFunction',
                                              )) ;
    }
}

?>
