125 if (strpos($action,
'page.') === 0 && !empty(
$result[
'id'])) {
128 if (strpos($action,
'folder.') === 0 && !empty(
$result[
'id'])) {
131 if (strpos($action,
'media.create') === 0 && !empty(
$result[
'id'])) {
134 if ($action ===
'media.assign' && !empty(
$result[
'usage_id'])) {
142 $cms = new \dbx\dbxKi\dbxKiCmsService();
145 foreach ($job[
'steps'] as $pos => $step) {
146 if (!is_array($step)) {
147 throw new RuntimeException(
'Step #' . ($pos + 1) .
' ist ungueltig.');
149 $stepId = trim((
string)($step[
'id'] ?? (
'step_' . ($pos + 1))));
150 $action = trim((
string)($step[
'action'] ??
''));
151 if ($stepId ===
'' || $action ===
'') {
152 throw new RuntimeException(
'Step #' . ($pos + 1) .
' benoetigt id und action.');
154 if (!
$cms->bundleIsAllowedInPackage($action)) {
155 throw new RuntimeException(
'Aktion ist fuer direkte Jobs nicht freigegeben: ' . $action);
159 $plan =
$cms->bundleBuildPlan($action, $params);
164 echo json_encode(array(
'ok' => 1,
'results' =>
$results), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
166}
catch (Throwable $e) {
167 echo json_encode(array(
'ok' => 0,
'error' => $e->getMessage()), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;