Hi,
at the moment I#ve quite some problems. I'm working to implement a
wizard class which leads users through the first steps on writing new
articles. There fore I'want to redirect the url under the conditions of
a new article to something like ?title={title}&action=new
####################### CORE ###########################################
# Register hooks
$wgHooks['ArticleFromTitle'][]='wizardBaseInterface';
function wizardBaseInterface($title, $article)
{
/* If the article already exists, make sure to forward to
* editpage->view
* otherwise start wizard
*/
if ($title->exists())
{
return true;
}
global $wgHooks;
if (($title->mArticleID != '0') && $article->exists())
$wgHooks['AlternateEdit'][]='wbiSkipToArticleView';
else
$wgHooks['AlternateEdit'][]='wbiSkipToNewArticleWizard';
/* Give other extensions a chance to run */
return true;
}
/**
* Forwards to Article->view() - meant to be attached to 'AlternateEdit'
dynamically.
* @param EditPage $editPage An instance of EditPage whose mArticle will
be viewed.
*/
function wbiSkipToArticleView($editPage)
{
$editPage->mArticle->view();
return false;
}
/**
* Forwards to WizardBase - meant to be attached to 'AlternateEdit'
dynamically.
*/
function wbiSkipToNewArticleWizard()
{
global $title;
$newPageWizard=new newPageWizard($title);
return false;
}
##################################################################################
Thanks for some advices
mic
Show replies by date