На странице
templategroup.massupdate
Описание
object templategroup.massupdate(параметры объекта)
Этот метод позволяет заменить шаблоны на указанные в нескольких группах шаблонов.
Этот метод доступен только пользователям с типом доступа Администратор и Супер-администратор. Разрешения на вызов метода можно отозвать в настройках ролей пользователя. Дополнительную информацию см. в разделе Роли пользователей.
Parameters
(object) Parameters containing the IDs of the template groups to update
and the objects that should be updated.
| Parameter | Type | Description |
|---|---|---|
| groups (required) |
object/array | Template groups to be updated. The template groups must have the groupid property defined. |
| templates (required) |
object/array | Templates to replace the current template on the given template groups. All other template, except the ones mentioned, will be excluded from template groups. The templates must have the templateid property defined. |
Return values
(object) Returns an object containing the IDs of the updated template
groups under the groupids property.
Примеры
Replacing templates in a template group
Replace all templates in a template group to ones mentioned templates.
Request:
{
"jsonrpc": "2.0",
"method": "templategroup.massupdate",
"params": {
"groups": [
{
"groupid": "8"
}
],
"templates": [
{
"templateid": "40050"
}
]
},
"auth": "f223adf833b2bf2ff38574a67bba6372",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"groupids": [
"8",
]
},
"id": 1
}
See also
Источник
CTemplateGroup::massUpdate() в ui/include/classes/api/services/CTemplateGroup.php.