From cfda0ae4acf20c0699b8833d2bf8bc0cb4ab17d5 Mon Sep 17 00:00:00 2001 From: carstenklapp Date: Mon, 25 Mar 2002 20:21:57 +0000 Subject: [PATCH] Added an option to control the suffix appended to filenames in the XHTML file dump. Comment the line out if you don't want any suffix added. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@2242 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- index.php | 6 +++++- lib/Template.php | 5 ++--- lib/Theme.php | 5 ++++- lib/loadsave.php | 11 ++++++++--- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 3de0b2d98..59f442b77 100644 --- a/index.php +++ b/index.php @@ -80,7 +80,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA define ('PHPWIKI_VERSION', '1.3.3-jeffs-hacks'); require "lib/prepend.php"; -rcs_id('$Id: index.php,v 1.83 2002-03-06 02:35:42 carstenklapp Exp $'); +rcs_id('$Id: index.php,v 1.84 2002-03-25 20:21:56 carstenklapp Exp $'); ///////////////////////////////////////////////////////////////////// // @@ -128,6 +128,10 @@ define('ZIPDUMP_AUTH', false); // raw ('binary' content-encoding) page dumps. define('STRICT_MAILABLE_PAGEDUMPS', false); +// Here you can change the filename suffix used for XHTML page dumps. +// If you don't want any suffix just comment this out. +$HTML_DUMP_SUFFIX = '.html'; + // The maximum file upload size. define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024); diff --git a/lib/Template.php b/lib/Template.php index ef0871120..030372fad 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -1,4 +1,4 @@ -_name = $theme_name; $themes_dir = defined('PHPWIKI_DIR') ? PHPWIKI_DIR . "/themes" : "themes"; @@ -382,6 +383,8 @@ class Theme { else $url = WikiURL($wikiword); + if ($this->HTML_DUMP_SUFFIX) + $url .= $this->HTML_DUMP_SUFFIX; $link = HTML::a(array('href' => $url)); if (!empty($linktext)) { diff --git a/lib/loadsave.php b/lib/loadsave.php index 92deb5e30..a3e2cca4b 100644 --- a/lib/loadsave.php +++ b/lib/loadsave.php @@ -1,4 +1,4 @@ -getDbh(); $pages = $dbi->getAllPages(); + global $HTML_DUMP_SUFFIX, $Theme; + if ($HTML_DUMP_SUFFIX) + $Theme->HTML_DUMP_SUFFIX = $HTML_DUMP_SUFFIX; + while ($page = $pages->next()) { if (! get_cfg_var('safe_mode')) set_time_limit(30); // Reset watchdog. - $filename = FilenameForPage($page->getName()); /* . ".html";*/ + $filename = FilenameForPage($page->getName()) . $Theme->HTML_DUMP_SUFFIX; $msg = HTML(HTML::br(), $page->getName(), ' ... '); @@ -254,7 +258,7 @@ function DumpHtmlToDir (&$request) } $num = fwrite($fd, $data, strlen($data)); - $msg->pushContent(HTML::small(fmt("%s bytes written", $num))); + $msg->pushContent(HTML::small(fmt("%s bytes written\n", $num))); PrintXML($msg); flush(); @@ -263,6 +267,7 @@ function DumpHtmlToDir (&$request) } //CopyImageFiles() will go here; + $Theme->$HTML_DUMP_SUFFIX = ''; EndLoadDump($request); } -- 2.45.0