72240dcf465c4439bd25bd3d56a4888b6738ac87
5 var $params = array () ;
7 function setVal ( $key , &$value ) {
8 $this->param
[strtolower($key)] = $value ;
11 function getVal ( $key , $default = "" ) {
12 $key = strtolower ( $key ) ;
13 if ( isset ( $this->params
[$key] ) ) {
14 return $this->params
[$key] ;
19 function initializeArticle ( &$title , $action ) {
21 if ( NS_MEDIA
== $title->getNamespace() ) {
22 $title = Title
::makeTitle( NS_IMAGE
, $title->getDBkey() );
25 $ns = $title->getNamespace();
27 // Namespace might change when using redirects
28 $article = new Article( $title );
29 if($action == 'view' && !$wgRequest->getVal( 'oldid' ) ) {
30 $rTitle = Title
::newFromRedirect( $article->fetchContent() );
32 # Reload from the page pointed to later
33 $article->mContentLoaded
= false;
34 $ns = $rTitle->getNamespace();
38 // Categories and images are handled by a different class
39 if ( $ns == NS_IMAGE
) {
41 require_once( 'includes/ImagePage.php' );
42 return new ImagePage( $title );
43 } elseif ( $ns == NS_CATEGORY
) {
45 require_once( 'includes/CategoryPage.php' );
46 return new CategoryPage( $title );
51 function performAction ( $action , &$output , &$article , &$title , &$user , &$request ) {
54 $output->setSquidMaxage( $this->getVal('SquidMaxage') );
68 case 'deletetrackback':
76 if( !$this->getVal('EnableDublinCoreRdf') ) {
77 wfHttpError( 403, 'Forbidden', wfMsg( 'nodublincore' ) );
79 require_once( 'includes/Metadata.php' );
80 wfDublinCoreRdf( $article );
83 case 'creativecommons':
84 if( !$this->getVal('EnableCreativeCommonsRdf') ) {
85 wfHttpError( 403, 'Forbidden', wfMsg('nocreativecommons') );
87 require_once( 'includes/Metadata.php' );
88 wfCreativeCommonsRdf( $article );
92 require_once( 'includes/Credits.php' );
93 showCreditsPage( $article );
96 if( !$this->getVal('CommandLineMode') && !$request->checkSessionCookie() ) {
97 # Send a cookie so anons get talk message notifications
102 $internal = $request->getVal( 'internaledit' );
103 $external = $request->getVal( 'externaledit' );
104 $section = $request->getVal( 'section' );
105 $oldid = $request->getVal( 'oldid' );
106 if(!$this->getVal('UseExternalEditor') ||
$action=='submit' ||
$internal ||
107 $section ||
$oldid ||
(!$user->getOption('externaleditor') && !$external)) {
108 require_once( 'includes/EditPage.php' );
109 $editor = new EditPage( $article );
111 } elseif($this->getVal('UseExternalEditor') && ($external ||
$user->getOption('externaleditor'))) {
112 require_once( 'includes/ExternalEdit.php' );
113 $mode = $request->getVal( 'mode' );
114 $extedit = new ExternalEdit( $article, $mode );
119 if ($_SERVER['REQUEST_URI'] == $title->getInternalURL('action=history')) {
120 $output->setSquidMaxage( $this->getVal('SquidMaxage') );
122 require_once( 'includes/PageHistory.php' );
123 $history = new PageHistory( $article );
127 require_once( 'includes/RawPage.php' );
128 $raw = new RawPage( $article );
132 if (wfRunHooks('UnknownAction', array($action, $article))) {
133 $output->errorpage( 'nosuchaction', 'nosuchactiontext' );
138 } ; # End of class MediaWiki