[pmwiki-users] ActionSkin question
carlos.ab at gmail.com
carlos.ab at gmail.com
Wed Apr 18 07:00:30 CDT 2007
I'm doing a script to convert wiki to word (.doc), the recipe creates a new
action called "doc" and inside the recipe I use :
$ActionSkin['doc'] = 'word';
The page shows that the wiki markups were translated to html , but the output
is not wrapped with the skin .
What am I doing wrong here?
Here is the script :
<?php
SDV($RecipeInfo['wiki2word']['Version'], '2007-04-17');
SDV($HandleActions['doc'], 'HandleDOC');
$ActionSkin['doc'] = 'word';
$Skin = 'word';
function HandleDOC($pagename, $auth=read){
global $FmtV, $HTTPHeaders, $HandleActions, $Charset;
$page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
if (PageExists($pagename)) $text = @$page['text'];
$opt = array();
$text = '(:groupheader:)'.@$text.'(:groupfooter:)';
$FmtV['$PageText'] = MarkupToHTML($pagename, $text, $opt);
SDV($WikiToWordContentType, 'application/vnd.ms-word');
#$HTTPHeaders = array(
# "Expires: Tue, 01 Jan 2002 00:00:00 GMT",
# "Cache-Control: no-store, no-cache, must-revalidate",
# "Content-Type: $WikiToWordContentType;charset=$Charset",
# "Content-disposition: attachment;filename=$pagename.doc");
foreach($HTTPHeaders as $h) header($h);
SDV($HandleWikiToWordFmt, array(&$PageStartFmt, '$PageText', &$PageEndFmt));
PrintFmt($pagename,$HandleWikiToWordFmt);
}
?>
Here is the skin :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$Charset}">
<base href="$ScriptUrl" />
<title>$WikiTitle | {$Group} / {$Title}</title>
<!--HTMLHeader-->
</head>
<body style="background-color: white; padding: 10px;">
<!--PageText-->
</body>
<!--HTMLFooter-->
</html>
TIA
CarlosAB
More information about the pmwiki-users
mailing list