// Test to see if we have permissions $ok = folio_page_permission($page, $permissions, 'read', $profile_id); // If we have permissions to view the page, then continue loading controls. // Also has the side effect of not loading other controls if the page hasn't been // created yet. if ($ok && $page) { // Run the command to actually retrieve the content. $body = folio_control_historypagelist($username, $page, $page_owner); // Reset the side menu after defining the comment on variables. $comment_on_type = 'page'; $comment_on_ident = $page_ident; $comment_on_username = $username; $comment_on_name = $name; $comment_on_ident = $page_owner; // Build nice titles $html_title = "<a href='{$url}{$username}/subscribe/rss/page+page_comment/'><img border=0 src='{$url}_templates/icons/rss.png' /></a> {$name} : " . folio_control_breadcrumb($page, $username); $plain_title = $page->title; } elseif ($ok & !$page) { // Page hasn't been created yet. $html_title = 'Error: Can not view history for an uncreated page'; $plain_title = 'Error: Can not view history for an uncreated page'; $body = 'You can not view history for a page that does not exist.'; } else { // We don't have permissions, and so need some sort of title. $html_title = 'You do not have permission to view this page'; $plain_title = 'You do not have permission to view this page'; $body = 'You do not have permission to view this page. Please contact the page\'s' . ' owner and ask for the security to be set to <b>Public</b> or <b>Moderated</b>. ' . ' You will be able to view this page once that has been done. If this page belongs ' . ' to a community, you may also try to join the community. Once you are a member, ' . ' you will be able to see and edit the page.'; } // Transfer into template & write. templates_page_setup(); $body = templates_draw(array('context' => 'contentholder', 'title' => $html_title, 'body' => $body));
$page = folio_page_select($page_ident, $created); $permissions = folio_page_security_select($page_ident); // Pull up the title of the current version of the page. // Note that we use title instead of the one of the older version of page, as all of the // various pagelists, comments, etc.. all pull off of the $page_title variable. $currentpage = folio_page_select($page_ident, -1); $page_title = $currentpage->title; // Test to see if we have permissions $ok = folio_page_permission($page, $permissions, 'read', $profile_id); $ok_write = folio_page_permission($page, $permissions, 'write', $profile_id); // If we have permissions to view the page, then continue loading controls. // Also has the side effect of not loading other controls if the page hasnt' been // created yet. if ($ok) { // Build nice titles $html_title = "<a href='{$url}{$username}/subscribe/rss/page+page_comment/'><img border=0 src='{$url}_folio/images/xml.gif' /></a> {$name} : " . folio_control_breadcrumb($page, $username); $plain_title = $page->title; // See if we're trying to revert the page. Need to check security. if ($revert == 'T' && $ok_write) { // Revert $body = "<p align='center'><b>Restore this older version of the page.</b></p><br/>" . folio_page_edit($page, $permissions, $page_title, $username, $page->parentpage_ident); } else { // Just viewing. // Build warning if this is an older version of the page. if ($page->newest != 1) { // Create warning link $body = "<p align='center'><b>You are looking at an archived version of this page.</b><br/>" . "<a href='{$url}{$username}/page/" . folio_page_encodetitle($page_title) . "'>return to current version</a>"; if ($ok_write) { $body .= " :: " . "<a href='{$url}{$username}/page/{$page_ident}:{$created}/revert'>restore this version</a></p>\n"; } } else {