1) is there something I haven't found that talks about the objects available in MW and their properties?
2) during the 'EditPage::showEditForm:initial' hook, I know that I can stuff $editpage->textbox1 with data ..
At this point what is the object/property for the title of the new page?
Thanks
DSig David Tod Sigafoos | SANMAR Corporation PICK Guy 206-770-5585 davesigafoos@sanmar.com
On 07/06/07, Dave Sigafoos davesigafoos@sanmar.com wrote:
At this point what is the object/property for the title of the new page?
Should be $editPage->mArticle->getTitle(), which returns a standard Title object.
Rob Church
That is what I had guessed but I get
This snippet is where I am having problems ..
I want to pre-stuff the new page depending on the title. So I have this *------------------------------------------------------------ if ( ereg("technical", $editpage->mArticle->mTitle) ){ $boilerplate_title = Title::newFromText('Template:Technical Design'); $boilerplate_article = new Article($boilerplate_title); $editpage->textbox1=$boilerplate_article->GetContent(); $editpage->textbox2=$editpage->textbox1; } else { $editpage->textbox1 = "text here"; $editpage->textbox2 = $editpage->textbox1; } *------------------------------------------------------------- Since this wasn't "working" I changed this
if ( ereg("technical", $editpage->mArticle->mTitle) ){
to
if ( 1 ){
With this it seemed to get the template and stuffed the editbox with the data. If I changed the 1 to 0 then it would stuff "text here" in the box
So I left it to 0 sor it would force the else and changed
$editpage->textbox1 = "text here";
To
$editpage->textbox1 = $editPage->mArticle->getTitle();
At this point I get ..
Catchable fatal error: Object of class Title could not be converted to string in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\EditPage.php on line 1016
If I change the line back to
$editpage->textbox1 = "simple text here"
It displays correctly.
Sure I must have hammered a property somewhere along the line
Hope this makes sense.
DSig David Tod Sigafoos | SANMAR Corporation PICK Guy 206-770-5585 davesigafoos@sanmar.com
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Rob Church Sent: Thursday, June 07, 2007 15:47 To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Docs on objects and properties/methods
On 07/06/07, Dave Sigafoos davesigafoos@sanmar.com wrote:
At this point what is the object/property for the title of the new
page?
Should be $editPage->mArticle->getTitle(), which returns a standard Title object.
Rob Church
On 08/06/07, Dave Sigafoos davesigafoos@sanmar.com wrote:
if ( ereg("technical", $editpage->mArticle->mTitle) ){
$editpage->mArticle->mTitle is a Title object. You need to look at the Title class and understand what it is, and then change the code above to call the appropriate accessor for the form of title required.
Rob Church
So the line would be more like
$editpage->textbox1 = $editpage->mArticle->mTitle->getText();
DSig David Tod Sigafoos | SANMAR Corporation PICK Guy 206-770-5585 davesigafoos@sanmar.com
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Rob Church Sent: Thursday, June 07, 2007 16:53 To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Docs on objects and properties/methods
On 08/06/07, Dave Sigafoos davesigafoos@sanmar.com wrote:
if ( ereg("technical", $editpage->mArticle->mTitle) ){
$editpage->mArticle->mTitle is a Title object. You need to look at the Title class and understand what it is, and then change the code above to call the appropriate accessor for the form of title required.
Rob Church
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org