[Mediawiki-l] Redirecting

Michael Heyder Info at hafenvolleyballer.de
Thu Aug 16 11:13:05 UTC 2007


Hi @all,

the following code works at all. But if a user wants to create a news 
there should start a wizard leading him through some steps.

so a redirect to ?action=new

at the moment the url looks like ?title=abc&action=edit

  > $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 support
Michael




More information about the MediaWiki-l mailing list