JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
link to archived versions from page edit page
authorJason Woofenden <jason@jasonwoof.com>
Wed, 21 Jun 2017 03:10:56 +0000 (23:10 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 21 Jun 2017 03:10:56 +0000 (23:10 -0400)
admin_pages.html
admin_pages.php

index 798cdcb..638b630 100644 (file)
 
                <h2><!--~id unset {~-->Add a new page<!--~}~--><!--~id {~-->Edit page "~title html~"<!--~}~--></h2>
 
+               <!--~archived_versions {~-->
+                       <p><a href="admin_pages?history_page_id=~id~">View archived versions of this page</a></p>
+               <!--~}~-->
+
                <form action="admin_pages" method="post"><!--~id {~--><div style="display: none"><input type="hidden" name="edit_id" value="~id attr~"></div><!--~}~-->
 
                        <div class="caption">Title</div>
index 910acef..ae0fa33 100644 (file)
@@ -173,6 +173,10 @@ function admin_pages_main_form($id = false, $history_id = false) {
                        return './admin_pages';
                }
                $id = $history_data['id'];
+       } elseif ($id) {
+               if (db_count('history_cms_pages', 'where id=%i', $id) > 1) {
+                       tem_set('archived_versions');
+               }
        }
        if($id) {
                tem_set('id', $id);