This is what I get when using UpdatePage:
http://www.natsim.net/ejswiki/Test/Page1
The new text gets where it should but the whole markup process is
broken halfway!
What's wrong with:
$old = RetrieveAuthPage('Test.Page1', 'read');
if ($old) {
$new = $old;
$new['text'] = "x".$old['text'];
$pn='Test.Page1';
UpdatePage($pn,$old,$new);
}
Frank
Frank Schweickert wrote:
I hope I did a good deed by adding
http://www.pmwiki.org/wiki/PmWiki/Functions#RetrieveAuthPage
---
But I still don't get it:
Using UpdatePage, pmwiki.php now complains in line 1650: $keys =
array_keys($new);
that $new should be an array. I did
$old = RetrieveAuthPage('Test.Page1', 'read');
if ($old) {
$new = $old;
$new[text] = "x".$old[text];
$pn=('Test.Page1');
UpdatePage($pn,$old,$new);
}
And do we need to call the first argument $pagename in UpdatePage by
reference anyway?
Frank
Hans wrote:
Sunday, March 29, 2009, 12:33:17 PM, Frank wrote:
http://www.pmwiki.org/wiki/PmWiki/Functions is a good start, but
somehow I found it hard to find, because I was looking for more
prominent a function reference of PMwiki. And it is not complete for
it doesn't tell us how to fetch a page like via RetrieveAuthPage (or
ReadPage?) in the first place. So I started relying on Google more than on pmwiki.org.
Re: RetrieveAuthPage()
use that generally in preference to ReadPage since it respects the
authorisation of the user, i.e. it checks the authorisation level
before loading the page, or it can be set to do so.
ReadPage() reads a page regardless of permission.
Hans
--
_______________________________________________________________________
Dr. Frank F. Schweickert
AMSTEL Institute, Faculty of Science, University of Amsterdam
Kruislaan 404, Amsterdam, 1098 SM, Netherlands
Room 1.09
Phone: +31 20 525-5969, Fax: +31 20 525-5866
http://www.science.uva.nl/amstel
http://www.natsim.net
--
_______________________________________________________________________
Dr. Frank F. Schweickert
AMSTEL Institute, Faculty of Science, University of Amsterdam
Kruislaan 404, Amsterdam, 1098 SM, Netherlands
Room 1.09
Phone: +31 20 525-5969, Fax: +31 20 525-5866
http://www.science.uva.nl/amstel
http://www.natsim.net
|
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel