<?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'
);
}