コード例 #1
0
ファイル: boot.php プロジェクト: redaxo/redaxo
 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');
         $clang_id = rex_request('history_clang_id', 'int');
         $revision = rex_request('history_revision', 'int', 0);
         $versions = rex_article_slice_history::getSnapshots($article_id, $clang_id, $revision);
         $select = '<option value="" selected="selected">' . $this->i18n('current_version') . '</option>';
         foreach ($versions as $version) {
             $select .= '<option value="' . $version['history_date'] . '">' . $version['history_date'] . '</option>';
         }
         $content1select = '<select id="content-history-select-date-1" class="content-history-select" data-iframe="content-history-iframe-1" style="">' . $select . '</select>';
         $content1iframe = '<iframe id="content-history-iframe-1" class="history-iframe"></iframe>';
         $content2select = '<select id="content-history-select-date-2" class="content-history-select" data-iframe="content-history-iframe-2">' . $select . '</select>';
         $content2iframe = '<iframe id="content-history-iframe-2" class="history-iframe"></iframe>';
         $button_restore = '<a class="btn btn-apply" href="javascript:rex_history_snapVersion(\'content-history-select-date-2\');">' . $this->i18n('snapshot_reactivate') . '</a>';
         // fragment holen und ausgeben
         $fragment = new rex_fragment();
         $fragment->setVar('title', $this->i18n('overview_versions'));
         $fragment->setVar('info', $info, false);
         $fragment->setVar('content1select', $content1select, false);
         $fragment->setVar('content1iframe', $content1iframe, false);
コード例 #2
0
ファイル: system.history.php プロジェクト: DECAF/redaxo
<?php

if (rex_request('func', 'string') == 'clearall') {
    rex_article_slice_history::clearAllHistory();
    echo rex_view::success($this->i18n('deleted'));
}
$content = rex_i18n::rawMsg('structure_history_info_content');
$content .= '<p><a href="' . rex_url::currentBackendPage(['func' => 'clearall']) . '" class="btn btn-setup">' . $this->i18n('button_delete_history') . '</a></p>';
$fragment = new rex_fragment();
$fragment->setVar('title', $this->i18n('title_info'));
$fragment->setVar('body', $content, false);
echo $fragment->parse('core/page/section.php');
$fragment = new rex_fragment();
$fragment->setVar('title', $this->i18n('todos'));
$fragment->setVar('body', rex_i18n::rawMsg('structure_history_todos_content', true), false);
echo $fragment->parse('core/page/section.php');