if (rex::isBackend() && rex::getUser() && rex::getUser()->hasPerm('history[article_rollback]')) { rex_extension::register(['ART_SLICES_COPY', 'SLICE_ADD', 'SLICE_UPDATE', 'SLICE_MOVE', 'SLICE_DELETE'], function (rex_extension_point $ep) { switch ($ep->getName()) { case 'ART_SLICES_COPY': $type = 'slices_copy'; break; case 'SLICE_MOVE': $type = 'slice_' . $ep->getParam('direction'); break; default: $type = strtolower($ep->getName()); } $article_id = $ep->getParam('article_id'); $clang_id = $ep->getParam('clang_id'); $slice_revision = $ep->getParam('slice_revision'); rex_article_slice_history::makeSnapshot($article_id, $clang_id, $type, $slice_revision); }); rex_view::addCssFile($this->getAssetsUrl('history.css')); rex_view::addJsFile($this->getAssetsUrl('history.js')); $info = ''; switch (rex_request('rex_history_function', 'string')) { case 'snap': $article_id = rex_request('history_article_id', 'int'); $clang_id = rex_request('history_clang_id', 'int'); $revision = rex_request('history_revision', 'int', 0); $history_date = rex_request('history_date', 'string'); rex_article_slice_history::restoreSnapshot($history_date, $article_id, $clang_id, $revision); $info = $version['history_snapshot_history_reactivate_snapshot']; case 'layer': // article_id und clang_id und revision noch nötig $article_id = rex_request('history_article_id', 'int');