Вот решение:
1. В файл bootstrap.php добавляем новый хук
Core_Event::attach('Admin_Form_Action_Controller_Type_Edit.onBeforeExecute', array('Admin_Form_Action_Controller_Type_Edit_Observer', 'onBeforeExecute'));
2. В папке /modules/admin/form/action/controller/type/edit/ Создаем файл observer.php со следующим содержимым:
<?php
defined('HOSTCMS') || exit('HostCMS: access denied.');
class Admin_Form_Action_Controller_Type_Edit_Observer
{
static public function onBeforeExecute($controller, $args)
{
list($operation, $Admin_Form_Controller) = $args;
if (is_null($operation))
{
$layout=15; //id макета по умолчанию
$object = $controller->getObject();
$ObjectClass = get_class($object);
switch ($ObjectClass)
{
//Структура
case 'Structure_Model':
if ($object->template_id==0) $object->Document->template_id($layout);
break;
//Документ
case 'Document_Model':
if ($object->template_id==0) $object->template_id($layout);
break;
}
}
}
}
id шаблона можно задать любой из существующих