Revised design of Special:Userlogin
[lhc/web/wiklou.git] / includes / Article.php
index ed9c305..d2f52bc 100644 (file)
@@ -134,7 +134,7 @@ class Article implements Page {
 
        /**
         * Constructor from a page id
-        * @param $id Int article ID to load
+        * @param int $id article ID to load
         * @return Article|null
         */
        public static function newFromID( $id ) {
@@ -393,7 +393,6 @@ class Article implements Page {
                return $this->mContent;
        }
 
-
        /**
         * Get text content object
         * Does *NOT* follow redirects.
@@ -767,6 +766,8 @@ class Article implements Page {
                $this->showViewFooter();
                $this->mPage->doViewUpdates( $user );
 
+               $outputPage->addModules( 'mediawiki.action.view.postEdit' );
+
                wfProfileOut( __METHOD__ );
        }
 
@@ -852,7 +853,7 @@ class Article implements Page {
 
        /**
         * Get the robot policy to be used for the current view
-        * @param $action String the action= GET parameter
+        * @param string $action the action= GET parameter
         * @param $pOutput ParserOutput
         * @return Array the policy that should be set
         * TODO: actions other than 'view'
@@ -987,8 +988,9 @@ class Article implements Page {
 
                                // Set the fragment if one was specified in the redirect
                                if ( strval( $this->getTitle()->getFragment() ) != '' ) {
-                                       $fragment = Xml::escapeJsString( $this->getTitle()->getFragmentForURL() );
-                                       $outputPage->addInlineScript( "redirectToFragment(\"$fragment\");" );
+                                       $outputPage->addInlineScript( Xml::encodeJsCall(
+                                               'redirectToFragment', array( $this->getTitle()->getFragmentForURL() )
+                                       ) );
                                }
 
                                // Add a <link rel="canonical"> tag
@@ -1187,7 +1189,7 @@ class Article implements Page {
                } elseif ( $this->getContext()->getRequest()->getInt( 'unhide' ) != 1 ) {
                        # Give explanation and add a link to view the revision...
                        $oldid = intval( $this->getOldID() );
-                       $link = $this->getTitle()->getFullUrl( "oldid={$oldid}&unhide=1" );
+                       $link = $this->getTitle()->getFullURL( "oldid={$oldid}&unhide=1" );
                        $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ?
                                'rev-suppressed-text-unhide' : 'rev-deleted-text-unhide';
                        $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
@@ -1210,7 +1212,7 @@ class Article implements Page {
         *   Revision as of \<date\>; view current revision
         *   \<- Previous version | Next Version -\>
         *
-        * @param $oldid int: revision ID of this article revision
+        * @param int $oldid revision ID of this article revision
         */
        public function setOldSubtitle( $oldid = 0 ) {
                if ( !wfRunHooks( 'DisplayOldSubtitle', array( &$this, &$oldid ) ) ) {
@@ -1518,7 +1520,7 @@ class Article implements Page {
        /**
         * Output deletion confirmation dialog
         * @todo FIXME: Move to another file?
-        * @param $reason String: prefilled reason
+        * @param string $reason prefilled reason
         */
        public function confirmDelete( $reason ) {
                wfDebug( "Article::confirmDelete\n" );
@@ -1726,7 +1728,7 @@ class Article implements Page {
         *
         * @param $oldid mixed integer Revision ID or null
         * @param $user User The relevant user
-        * @return ParserOutput or false if the given revsion ID is not found
+        * @return ParserOutput or false if the given revision ID is not found
         */
        public function getParserOutput( $oldid = null, User $user = null ) {
                //XXX: bypasses mParserOptions and thus setParserOptions()
@@ -1886,8 +1888,8 @@ class Article implements Page {
         *
         * @deprecated in 1.18; call OutputPage::redirect() directly
         * @param $noRedir Boolean: add redirect=no
-        * @param $sectionAnchor String: section to redirect to, including "#"
-        * @param $extraQuery String: extra query params
+        * @param string $sectionAnchor section to redirect to, including "#"
+        * @param string $extraQuery extra query params
         */
        public function doRedirect( $noRedir = false, $sectionAnchor = '', $extraQuery = '' ) {
                wfDeprecated( __METHOD__, '1.18' );
@@ -1907,7 +1909,7 @@ class Article implements Page {
         * Use PHP's magic __get handler to handle accessing of
         * raw WikiPage fields for backwards compatibility.
         *
-        * @param $fname String Field name
+        * @param string $fname Field name
         */
        public function __get( $fname ) {
                if ( property_exists( $this->mPage, $fname ) ) {
@@ -1921,7 +1923,7 @@ class Article implements Page {
         * Use PHP's magic __set handler to handle setting of
         * raw WikiPage fields for backwards compatibility.
         *
-        * @param $fname String Field name
+        * @param string $fname Field name
         * @param $fvalue mixed New value
         */
        public function __set( $fname, $fvalue ) {
@@ -1940,8 +1942,8 @@ class Article implements Page {
         * Use PHP's magic __call handler to transform instance calls to
         * WikiPage functions for backwards compatibility.
         *
-        * @param $fname String Name of called method
-        * @param $args Array Arguments to the method
+        * @param string $fname Name of called method
+        * @param array $args Arguments to the method
         * @return mixed
         */
        public function __call( $fname, $args ) {