Forums / National / Russian / Тех. поддержка / Запросы документации

Принимаем вопросы от населения

Kabak Online
#40744 2015-03-25 17:33

Ещё вопрос. А CKEditor с ajax работатет ?  Потому что как только включаю &_ajax=1  выводится окно простого textedit, а не CKEditor с кнопочками.

question.index.tags.php

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=index.tags
Tags=index.tpl:{ASK_QUESTION}
[END_COT_EXT]
==================== */
 
defined('COT_CODE') or die('Wrong URL');
 
    require_once cot_incfile('question', 'plug');
    require_once cot_langfile('question', 'plug');
     
    $question_text  = cot_import('questiontext','P','HTM');
    $question_owner = cot_import('owner','G','INT');   
    $ask_q      = cot_import('ask_q','G','TXT');
     
//if ( COT_AJAX )     
if ( $ask_q == 'ask_question'){
    
    $t->assign(array(
        'QUESTION' => cot_question('page', $pag['page_id'], 'question'),
        ));
}
    $t->parse('QUESTION');

question.functions.php

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
 
defined('COT_CODE') or die('Wrong URL');
 
global $R, $L;
require_once cot_incfile('page', 'module');
require_once cot_incfile('forms');
require_once cot_langfile('question');
 
function cot_question($ext_name, $code, $cat = '')
{
    global $id, $db, $db_users, $cfg, $usr, $L, $sys, $R, $env, $structure;
 
    $can_question = 1;
     
    $t = new XTemplate(cot_tplfile('question', 'plug'));
     
    $editor = ($cfg['plugin']['question']['question_markup']) ? 'input_textarea_medieditor' : '';
    $t->assign(array(
    'QUESTION_FORM_SEND' => cot_url('plug', "e=comments&a=send&area=$ext_name&cat=$cat&item=$code"),
    'QUESTION_FORM_AUTHOR' => 'save author id somehow!!!',
    'QUESTION_FORM_TEXT' => $can_question ? cot_textarea('questiontext', $questiontext, 7, 120, '', $editor) : '',
    ));
 
    $t->parse('QUESTION');
    return $t->text('QUESTION');
}

question.tpl

XML/XHTML
1
2
3
4
5
6
7
8
9
<!-- BEGIN: QUESTION -->
                <div class="p20">
                    <strong class="dbl mb15">{PHP.L.Your_question}</strong>
                    <form id="answer" name="answer" action="{QUESTION_FORM_POST}" method="post" class="ajax post-ajaxBlock">
                        <div>{QUESTION_FORM_TEXT}</div>
                        <button class="btn btn-success mt10" type="submit">{PHP.L.Ask_Question}</button>
                    </form>
                </div>
<!-- END: QUESTION -->

header.tpl  с кнопкой по нажатию на которую должен заполниться тэг {QUESTION} в index.tpl

XML/XHTML
1
<a href="index.php?ask_q=ask_question" class="btn btn-ask btn-block askclosed"><i class="fa fa-question-circle fa-lg"></i> {PHP.L.Ask}</a>

index.tpl  Блок в который выводится окно CKEditor

XML/XHTML
1
2
3
<div id="ajaxBlock">
    {QUESTION}
</div>

Что не так я делаю ?