~ubuntu-branches/ubuntu/maverick/mediawiki/maverick

« back to all changes in this revision

Viewing changes to includes/PatrolLog.php

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2009-06-19 01:38:50 UTC
  • mfrom: (16.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090619013850-dsn4lrxvs90ab4rx
Tags: 1:1.15.0-1
* New upstream release. 
* Upstream added support for OASIS documents.
Closes: #530328
* Refreshed quilt patches
* Bumped standards versions to 3.8.2
* Bumped compat to 7
* Pointed to GPL-2 in debian/copyright
* Added php5-sqlite to possible DB backend dependencies.
Closes: #501569
* Proofread README.Debian, upgrade is documented there.
Closes: #520121

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
         * @param mixed $change Change identifier or RecentChange object
15
15
         * @param bool $auto Was this patrol event automatic?
16
16
         */
17
 
        public static function record( $change, $auto = false ) {
18
 
                if( !( is_object( $change ) && $change instanceof RecentChange ) ) {
19
 
                        $change = RecentChange::newFromId( $change );
20
 
                        if( !is_object( $change ) )
 
17
        public static function record( $rc, $auto = false ) {
 
18
                if( !( $rc instanceof RecentChange ) ) {
 
19
                        $rc = RecentChange::newFromId( $rc );
 
20
                        if( !is_object( $rc ) )
21
21
                                return false;
22
22
                }
23
 
                $title = Title::makeTitleSafe( $change->getAttribute( 'rc_namespace' ),
24
 
                                        $change->getAttribute( 'rc_title' ) );
 
23
                $title = Title::makeTitleSafe( $rc->getAttribute( 'rc_namespace' ), $rc->getAttribute( 'rc_title' ) );
25
24
                if( is_object( $title ) ) {
26
 
                        $params = self::buildParams( $change, $auto );
27
 
                        $log = new LogPage( 'patrol', false ); # False suppresses RC entries
 
25
                        $params = self::buildParams( $rc, $auto );
 
26
                        $log = new LogPage( 'patrol', false, $auto ? "skipUDP" : "UDP" ); # False suppresses RC entries
28
27
                        $log->addEntry( 'patrol', $title, '', $params );
29
28
                        return true;
30
 
                } else {
31
 
                        return false;
32
29
                }
 
30
                return false;
33
31
        }
34
32
 
35
33
        /**
41
39
         * @return string
42
40
         */
43
41
        public static function makeActionText( $title, $params, $skin ) {
44
 
                # This is a bit of a hack, but...if $skin is not a Skin, then *do nothing*
45
 
                # -- this is fine, because the action text we would be queried for under
46
 
                # these conditions would have gone into recentchanges, which we aren't
47
 
                # supposed to be updating
 
42
                list( $cur, /* $prev */, $auto ) = $params;
48
43
                if( is_object( $skin ) ) {
49
 
                        list( $cur, /* $prev */, $auto ) = $params;
50
44
                        # Standard link to the page in question
51
45
                        $link = $skin->makeLinkObj( $title );
52
46
                        if( $title->exists() ) {
64
58
                        # Put it all together
65
59
                        return wfMsgHtml( 'patrol-log-line', $diff, $link, $auto );
66
60
                } else {
67
 
                        return '';
 
61
                        $text = $title->getPrefixedText();
 
62
                        return wfMsgForContent( 'patrol-log-line', wfMsgHtml('patrol-log-diff',$cur), "[[$text]]", '' );
68
63
                }
69
64
        }
70
65