From 9f3cb07ad3776f9a8449cf13d88ad2c4f7674b58 Mon Sep 17 00:00:00 2001 From: Max Kremmel Date: Sat, 4 Feb 2006 19:04:35 +0000 Subject: remove more outdated code: $section and other old template assignments --- backlinks.php | 5 +-- display_bitpage_inc.php | 117 ++++++++++++++++++------------------------------ edit.php | 5 +-- like_pages.php | 5 +-- page.php | 5 +-- page_permissions.php | 5 +-- print.php | 26 +++++------ rename_page.php | 7 ++- rollback.php | 5 +-- slideshow.php | 14 +----- 10 files changed, 73 insertions(+), 121 deletions(-) diff --git a/backlinks.php b/backlinks.php index 673d370..23e45de 100644 --- a/backlinks.php +++ b/backlinks.php @@ -3,13 +3,13 @@ * assigned_modules * * @author spider - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * @package wiki * @subpackage functions * @copyright Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. * @license Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. */ -// $Header: /cvsroot/bitweaver/_bit_wiki/backlinks.php,v 1.4 2006/01/27 21:57:53 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_wiki/backlinks.php,v 1.5 2006/02/04 19:04:34 squareing Exp $ // All Rights Reserved. See copyright.txt for details and a complete list of authors. /** @@ -49,5 +49,4 @@ $gBitSmarty->assign_by_ref('backlinks', $backlinks); // Display the template $gBitSystem->display( 'bitpackage:wiki/backlinks.tpl'); -$gBitSmarty->assign('show_page_bar', 'y'); ?> diff --git a/display_bitpage_inc.php b/display_bitpage_inc.php index 69ee3f1..4bb5926 100644 --- a/display_bitpage_inc.php +++ b/display_bitpage_inc.php @@ -1,6 +1,6 @@ isFeatureActive( 'feature_wiki_comments' ) ) { include_once( LIBERTY_PKG_PATH.'comments_inc.php' ); } -$section='wiki'; if( $gBitSystem->isFeatureActive( 'feature_wiki_attachments' ) ) { - if(isset($_REQUEST["removeattach"])) { + if(isset($_REQUEST["removeattach"])) { - $owner = $wikilib->get_attachment_owner($_REQUEST["removeattach"]); - if( ($user && ($owner == $user) ) || ($gBitUser->hasPermission( 'bit_p_wiki_admin_attachments' )) ) { - $wikilib->remove_wiki_attachment($_REQUEST["removeattach"]); - } - } - if(isset($_REQUEST["attach"]) && ($gBitUser->hasPermission( 'bit_p_wiki_admin_attachments' ) || $gBitUser->hasPermission( 'bit_p_wiki_attach_files' ))) { + $owner = $wikilib->get_attachment_owner($_REQUEST["removeattach"]); + if( ($user && ($owner == $user) ) || ($gBitUser->hasPermission( 'bit_p_wiki_admin_attachments' )) ) { + $wikilib->remove_wiki_attachment($_REQUEST["removeattach"]); + } + } + if(isset($_REQUEST["attach"]) && ($gBitUser->hasPermission( 'bit_p_wiki_admin_attachments' ) || $gBitUser->hasPermission( 'bit_p_wiki_attach_files' ))) { - // Process an attachment here - if(isset($_FILES['userfile1'])&&is_uploaded_file($_FILES['userfile1']['tmp_name'])) { - $fp = fopen($_FILES['userfile1']['tmp_name'],"rb"); - $data = ''; - $fhash=''; - if($w_use_db == 'n') { - $fhash = md5($name = $_FILES['userfile1']['name']); - $fw = fopen($w_use_dir.$fhash,"wb"); - if(!$fw) { - $gBitSmarty->assign('msg',tra('Cannot write to this file:').$fhash); - $gBitSystem->display( 'error.tpl' ); - die; - } - } - while(!feof($fp)) { - if($w_use_db == 'y') { - $data .= fread($fp,8192*16); - } else { - $data = fread($fp,8192*16); - fwrite($fw,$data); - } - } - fclose($fp); - if($w_use_db == 'n') { - fclose($fw); - $data=''; - } - $size = $_FILES['userfile1']['size']; - $name = $_FILES['userfile1']['name']; - $type = $_FILES['userfile1']['type']; - $wikilib->wiki_attach_file($gContent->mInfo['title'],$name,$type,$size, $data, $_REQUEST["attach_comment"], $user,$fhash); - } - } - $gBitSmarty->assign('atts',$gContent->mStorage); - $gBitSmarty->assign('atts_count',count($gContent->mStorage)); + // Process an attachment here + if(isset($_FILES['userfile1'])&&is_uploaded_file($_FILES['userfile1']['tmp_name'])) { + $fp = fopen($_FILES['userfile1']['tmp_name'],"rb"); + $data = ''; + $fhash=''; + if($w_use_db == 'n') { + $fhash = md5($name = $_FILES['userfile1']['name']); + $fw = fopen($w_use_dir.$fhash,"wb"); + if(!$fw) { + $gBitSmarty->assign('msg',tra('Cannot write to this file:').$fhash); + $gBitSystem->display( 'error.tpl' ); + die; + } + } + while(!feof($fp)) { + if($w_use_db == 'y') { + $data .= fread($fp,8192*16); + } else { + $data = fread($fp,8192*16); + fwrite($fw,$data); + } + } + fclose($fp); + if($w_use_db == 'n') { + fclose($fw); + $data=''; + } + $size = $_FILES['userfile1']['size']; + $name = $_FILES['userfile1']['name']; + $type = $_FILES['userfile1']['type']; + $wikilib->wiki_attach_file($gContent->mInfo['title'],$name,$type,$size, $data, $_REQUEST["attach_comment"], $user,$fhash); + } + } + $gBitSmarty->assign('atts',$gContent->mStorage); + $gBitSmarty->assign('atts_count',count($gContent->mStorage)); } if( $gBitSystem->isFeatureActive( 'feature_wiki_footnotes' ) && $gBitUser->isValid() ) { @@ -277,7 +276,6 @@ if( $gBitSystem->isFeatureActive( 'wiki_feature_copyrights' ) ) { $gBitSmarty->assign('pageCopyrights', $copyrights["data"]); } -$gBitSmarty->assign('wiki_extras','y'); // Watches if( $gBitSystem->isFeatureActive( 'feature_user_watches' ) ) { if( isset( $_REQUEST['watch_event'] ) ) { @@ -299,35 +297,8 @@ if( $gBitSystem->isFeatureActive( 'feature_user_watches' ) ) { } } $sameurl_elements=Array('title','page'); -//echo $gContent->mInfo["data"]; -if(isset($_REQUEST['mode']) && $_REQUEST['mode']=='mobile') { -/* - require_once(HAWHAW_PKG_PATH."hawhaw.inc"); - require_once(HAWHAW_PKG_PATH."hawiki_cfg.inc"); - require_once(HAWHAW_PKG_PATH."hawiki_parser.inc"); - require_once(HAWHAW_PKG_PATH."hawiki.inc"); - error_reporting(E_ALL & ~E_NOTICE); - $myWiki = new HAWIKI_page($gContent->mInfo["data"], WIKI_PKG_URL."index.php?mode=mobile&page="); - $myWiki->set_navlink(tra("Home Page"), WIKI_PKG_URL."index.php?mode=mobile", HAWIKI_NAVLINK_TOP | HAWIKI_NAVLINK_BOTTOM); - $myWiki->set_navlink(tra("Menu"), HAWHAW_PKG_URL."mobile.php", HAWIKI_NAVLINK_TOP | HAWIKI_NAVLINK_BOTTOM); - $myWiki->set_smiley_dir("img/smiles"); - $myWiki->set_link_jingle(HAWHAW_PKG_PATH."link.wav"); - $myWiki->set_hawimconv(HAWHAW_PKG_PATH."hawimconv.php"); - $myWiki->display(); - die; - */ - include_once( HAWHAW_PKG_PATH."hawtiki_lib.php" ); - HAWBIT_index($gContent->mInfo); -} - -// Flag for 'page bar' that currently 'Page view' mode active -// so it is needed to show comments & attachments panels -$gBitSmarty->assign('show_page','y'); // Display the Index Template -$gBitSmarty->assign('dblclickedit','y'); -$gBitSmarty->assign('print_page','n'); -$gBitSmarty->assign('show_page_bar','y'); $gBitSmarty->assign_by_ref( 'pageInfo', $gContent->mInfo ); if( isset( $_REQUEST['s5'] ) ) { diff --git a/edit.php b/edit.php index 619fb1b..772275a 100644 --- a/edit.php +++ b/edit.php @@ -1,6 +1,6 @@ mInfo['title'] ) ) ? $gContent $gBitSmarty->assign_by_ref( 'pageInfo', $formInfo ); $gBitSmarty->assign_by_ref( 'errors', $gContent->mErrors ); -$gBitSmarty->assign( 'show_page_bar', 'y' ); // load the ajax library for this page $gBitSmarty->assign( 'loadAjax', TRUE ); diff --git a/like_pages.php b/like_pages.php index 22496f1..b8cffe5 100644 --- a/like_pages.php +++ b/like_pages.php @@ -1,6 +1,6 @@ assign_by_ref('likepages', $likepages); // Display the template $gBitSystem->display( 'bitpackage:wiki/like_pages.tpl'); -$gBitSmarty->assign('show_page_bar', 'y'); ?> diff --git a/page.php b/page.php index 3abc7d2..b78b1a7 100644 --- a/page.php +++ b/page.php @@ -1,6 +1,6 @@ assign('refresh', $page_data["refresh"]); $gBitSmarty->assign('title', $_REQUEST["title"]); $parsed = $htmlpageslib->parse_html_page($_REQUEST["title"], $page_data["content"]); $gBitSmarty->assign_by_ref('parsed', $parsed); -$section = 'html_pages'; // Display the template $gBitSystem->display( 'bitpackage:wiki/page.tpl'); diff --git a/page_permissions.php b/page_permissions.php index e279845..084c4ed 100644 --- a/page_permissions.php +++ b/page_permissions.php @@ -1,6 +1,6 @@ assign_by_ref('perms', $perms); $gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'permissions').'TabSelect', 'tdefault' ); -$gBitSmarty->assign('show_page_bar', 'y'); $gBitSystem->display( 'bitpackage:wiki/page_permissions.tpl'); ?> diff --git a/print.php b/print.php index e891b81..e923d93 100644 --- a/print.php +++ b/print.php @@ -1,6 +1,6 @@ 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 = $gBitSystem->getUTCTime(); - if($cache_info['cache_timestamp']+$wiki_cache > $now) { - $pdata = $cache_info['cache']; - $gBitSmarty->assign('cached_page','y'); - } else { - $pdata = $gContent->parseData(); - $wikilib->update_cache($page,$pdata); - } + $cache_info = $wikilib->get_cache_info($page); + $now = $gBitSystem->getUTCTime(); + if($cache_info['cache_timestamp']+$wiki_cache > $now) { + $pdata = $cache_info['cache']; + $gBitSmarty->assign('cached_page','y'); + } else { + $pdata = $gContent->parseData(); + $wikilib->update_cache($page,$pdata); + } } else { - $pdata = $gContent->parseData(); + $pdata = $gContent->parseData(); } $gBitSmarty->assign_by_ref('parsed', $pdata); $gBitSmarty->assign_by_ref('last_modified', $info["last_modified"]); @@ -98,8 +98,6 @@ if ($http_domain) { // Display the Index Template $gBitSmarty->assign('print_page','y'); -$gBitSystem->display( 'bitpackage:wiki/show_page.tpl'); $gBitSmarty->assign('show_page_bar', 'n'); -$gBitSmarty->assign('print_page', 'y'); $gBitSmarty->display("bitpackage:wiki/print.tpl"); ?> diff --git a/rename_page.php b/rename_page.php index 95abaaa..5b4c8f2 100644 --- a/rename_page.php +++ b/rename_page.php @@ -1,6 +1,6 @@ pageExists($page,true)) { // true: casesensitive check here die; } if (isset($_REQUEST["rename"])) { - + if (!$wikilib->wiki_rename_page($_REQUEST['oldpage'], $_REQUEST['newpage'])) { $gBitSmarty->assign('msg', tra("Cannot rename page maybe new page already exists")); $gBitSystem->display( 'error.tpl' ); @@ -54,5 +54,4 @@ if (isset($_REQUEST["rename"])) { } $gBitSystem->display( 'bitpackage:wiki/rename_page.tpl'); -$gBitSmarty->assign('show_page_bar', 'y'); ?> diff --git a/rollback.php b/rollback.php index e385245..b2af872 100644 --- a/rollback.php +++ b/rollback.php @@ -1,6 +1,6 @@ display( 'bitpackage:wiki/rollback.tpl'); -$gBitSmarty->assign('show_page_bar', 'y'); ?> diff --git a/slideshow.php b/slideshow.php index 4d21af3..32e9b12 100755 --- a/slideshow.php +++ b/slideshow.php @@ -1,6 +1,6 @@ assign_by_ref('lastUser', $info["user"]); - -$section = 'wiki'; - -$gBitSmarty->assign('wiki_extras', 'y'); - - - -// Display the Index Template -$gBitSmarty->assign('show_page_bar', 'y'); $gBitSmarty->display("bitpackage:wiki/slideshow.tpl"); - ?> -- cgit v1.3