diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 06:12:45 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 06:12:45 +0000 |
| commit | 850713ed26ff34d8fe37feed30bb94de4adc957c (patch) | |
| tree | 7ceb5eaad8a84eb8796fd2d53ed62f17052acc35 /print.php | |
| download | wiki-850713ed26ff34d8fe37feed30bb94de4adc957c.tar.gz wiki-850713ed26ff34d8fe37feed30bb94de4adc957c.tar.bz2 wiki-850713ed26ff34d8fe37feed30bb94de4adc957c.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'print.php')
| -rw-r--r-- | print.php | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/print.php b/print.php new file mode 100644 index 0000000..28ff45f --- /dev/null +++ b/print.php @@ -0,0 +1,93 @@ +<?php +// $Header: /cvsroot/bitweaver/_bit_wiki/print.php,v 1.1 2005/06/19 06:12:44 bitweaver Exp $ +// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. +// All Rights Reserved. See copyright.txt for details and a complete list of authors. +// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. +// Initialization +require_once( '../bit_setup_inc.php' ); +include_once( WIKI_PKG_PATH.'BitPage.php'); + +$gBitSystem->verifyPackage( 'wiki' ); + +// If the page doesn't exist then display an error +$requirePage = TRUE; +include( WIKI_PKG_PATH.'lookup_page_inc.php' ); + +// Now check permissions to access this page +if (!$gContent->hasUserPermission( 'bit_p_view' )) { + $smarty->assign('msg', tra("Permission denied you cannot view this page")); + $gBitSystem->display( 'error.tpl' ); + die; +} + +require_once ( WIKI_PKG_PATH.'page_setup_inc.php' ); +// Check if we have to perform an action for this page +// for example lock/unlock +if (isset($_REQUEST["action"])) { + + if ($_REQUEST["action"] == 'lock') { + $gContent->lock(); + } elseif ($_REQUEST["action"] == 'unlock') { + $gContent->unlock_page(); + } +} + +// Now increment page hits since we are visiting this page +if ($count_admin_pvs == 'y' || $bit_p_admin!='y') { + $gContent->addHit(); +} +// Get page data +$info = $gContent->mInfo; +if (isset($wiki_feature_copyrights) && $wiki_feature_copyrights == 'y' && isset($wikiLicensePage)) { + // insert license if wiki copyrights enabled +// $license_info = $wikilib->get_page_info($wikiLicensePage); +// $wikilib->add_hit($wikiLicensePage); + $info["data"] = $info["data"] . "\n<HR>\n" . $license_info["data"]; + $_REQUEST['copyrightpage'] = $page; +} +// Verify lock status +if ($info["flag"] == 'L') { + $smarty->assign('lock', true); +} else { + $smarty->assign('lock', false); +} +$smarty->assign('cached_page','n'); +if(isset($gContent->mInfo['wiki_cache']) && $gContent->mInfo['wiki_cache']>0) {$wiki_cache=$gContent->mInfo['wiki_cache'];} +if($wiki_cache>0) { + $cache_info = $wikilib->get_cache_info($page); + $now = date('U'); + if($cache_info['cache_timestamp']+$wiki_cache > $now) { + $pdata = $cache_info['cache']; + $smarty->assign('cached_page','y'); + } else { + $pdata = $gContent->parseData(); + $wikilib->update_cache($page,$pdata); + } +} else { + $pdata = $gContent->parseData(); +} +$smarty->assign_by_ref('parsed', $pdata); +$smarty->assign_by_ref('last_modified', $info["last_modified"]); +if (empty($info["user"])) { + $info["user"] = 'anonymous'; +} +$smarty->assign_by_ref('lastUser', $info["user"]); +//Store the page URL to be displayed on print page +$http_domain = $wikilib->getPreference('http_domain', false); +$http_port = $wikilib->getPreference('http_port', 80); +$http_prefix = $wikilib->getPreference('http_prefix', '/'); +if ($http_domain) { + $prefix = 'http://' . $http_domain; + if ($http_port != 80) + $prefix .= ':' . $http_port; + $prefix .= $https_prefix; + $smarty->assign('urlprefix', $prefix); +} + +// Display the Index Template +$smarty->assign('print_page','y'); +$gBitSystem->display( 'bitpackage:wiki/show_page.tpl'); +$smarty->assign('show_page_bar', 'n'); +$smarty->assign('print_page', 'y'); +$smarty->display("bitpackage:wiki/print.tpl"); +?> |
