Question

i found example for older version, but my current version has not assets/libs/docmanager/document.class.inc.php file and libs folder dosn't exists too. HELP GUYS!

function CreateNewArticle(&$fields){
// Массив $fields будет содержать данные всех полей формы
// Создания документа с описанием.
require_once('assets/libs/docmanager/document.class.inc.php');
$doc = new Document(); // создаем документ
$doc->Set('parent',9); // определяем в какую папку положить
$doc->Set('template','psih'); // задаем шаблон
$doc->Set('content',$fields['content']); // основное содержимое
// Далее пойдут TV-параметры
$doc->Set('tvAvtor',$fields['avtor']); // автор
$doc->Set('tvEmail',$fields['email']); // e-mail
$doc->Save(); // сохраняем
return true; // Говорим eForm, что все в порядке.

}

Was it helpful?

OTHER TIPS

Install CakeMOdx. It's an API class for MODx Evolution. It provides, among other things, a function "newDocument".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top