Index: trunk/extensions/EditOwn/EditOwn.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * (at your option) any later version. |
8 | 8 | * |
9 | 9 | * @author Roan Kattouw <roan.kattouw@home.nl> |
10 | | - * @copyright Copyright (C) 2007 Roan Kattouw |
| 10 | + * @copyright Copyright © 2007 Roan Kattouw |
11 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License |
12 | 12 | * |
13 | 13 | * An extension that allows changing the author of a revision |
— | — | @@ -38,42 +38,37 @@ |
39 | 39 | |
40 | 40 | $wgEditOwnExcludedNamespaces = array(); |
41 | 41 | |
42 | | -function EditOwn($title, $user, $action, &$result) |
43 | | -{ |
| 42 | +function EditOwn($title, $user, $action, &$result) { |
44 | 43 | static $cache = array(); |
45 | 44 | global $wgEditOwnExcludedNamespaces; |
46 | 45 | if(!is_array($wgEditOwnExcludedNamespaces)) |
47 | 46 | // Prevent PHP from whining |
48 | 47 | $wgEditOwnExcludedNamespaces = array(); |
49 | 48 | |
50 | | - if($action != 'edit' || $user->isAllowed('editall') || in_array($title->getNamespace(), $wgEditOwnExcludedNamespaces)) |
51 | | - { |
| 49 | + if($action != 'edit' || $user->isAllowed('editall') || in_array($title->getNamespace(), $wgEditOwnExcludedNamespaces)) { |
52 | 50 | $result = null; |
53 | 51 | return true; |
54 | 52 | } |
55 | 53 | |
56 | | - if(isset($cache[$user->getName()][$title->getArticleId()])) |
57 | | - { |
| 54 | + if(isset($cache[$user->getName()][$title->getArticleId()])) { |
58 | 55 | $result = $cache[$user->getName()][$title->getArticleId()]; |
59 | 56 | return is_null($result); |
60 | 57 | } |
61 | 58 | |
62 | 59 | // Since there's no easy way to get the first revision, we'll just do a DB query |
63 | | - $dbr = wfGetDb(DB_SLAVE); |
| 60 | + $dbr = wfGetDB(DB_SLAVE); |
64 | 61 | $res = $dbr->select('revision', Revision::selectFields(), |
65 | 62 | array('rev_page' => $title->getArticleId()), |
66 | 63 | __METHOD__, array('ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1)); |
67 | | - if(!($row = $dbr->fetchObject($res))) |
68 | | - { |
| 64 | + if(!($row = $dbr->fetchObject($res))) { |
69 | 65 | // Nonexistent title? Creation is allowed |
70 | 66 | $result = $cache[$user->getName()][$title->getArticleId()] = null; |
71 | 67 | return true; |
72 | 68 | } |
73 | 69 | $rev = new Revision($row); |
74 | | - if($user->getName() == $rev->getRawUserText()) |
75 | | - { |
| 70 | + if($user->getName() == $rev->getRawUserText()) { |
76 | 71 | $result = $cache[$user->getName()][$title->getArticleId()] = null; |
77 | 72 | return true; |
78 | 73 | } |
79 | 74 | return($result = $cache[$user->getName()][$title->getArticleId()] = false); |
80 | | -} |
| 75 | +} |
\ No newline at end of file |
Index: trunk/extensions/EditOwn/EditOwn.i18n.php |
— | — | @@ -28,6 +28,13 @@ |
29 | 29 | 'editown-desc' => "Uzantoj sen la ''editall'' rajto nur povas redakti paĝojn kiujn ili mem kreis", |
30 | 30 | ); |
31 | 31 | |
| 32 | +/** Finnish (Suomi) |
| 33 | + * @author Jack Phoenix |
| 34 | + */ |
| 35 | +$messages['fi'] = array( |
| 36 | + 'editown-desc' => 'Käyttäjät ilman editall-oikeutta voivat muokata vain itse luomiaan sivuja', |
| 37 | +); |
| 38 | + |
32 | 39 | /** French (Français) |
33 | 40 | * @author Grondin |
34 | 41 | */ |