<?php if (!defined('PmWiki')) exit();
# vim: set ts=4 sw=4 et:
##
##        File: upform.php
##     Version: 2010-06-20
##      SVN ID: $Id: $
##      Status: alpha
##      Author: Peter Bowers
## Create Date: June 20, 2010
##   Copyright: 2010, Peter Bowers
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, Version 2, as
## published by the Free Software Foundation.
## http://www.gnu.org/copyleft/gpl.html
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## upform allows the ?action=upload form to be loaded from a page
##

$RecipeInfo['UpForm']['Version'] = '2010-06-20';

$PostConfig['InitUpload'] = 100;
function InitUpload($pagename)
{
    global $PageUploadFmt, $UpformPage, $FmtV;
    SDV($UpformPage, "Site.UploadForm");
    if (!PageExists($UpformPage)) return false;
    $page = ReadPage($UpformPage, READPAGE_CURRENT);
    if (!$page || !$page['text']) return false;
    $PageUploadFmt = "markup:$page[text]";
    #$FmtV['$PageText'] = MarkupToHTML($pagename, $page['text'], array());
    #$FmtV['$PageText'] = "page:$UpformPage";
    #$PageUploadFmt = "page:$UpformPage";
    return true;
}