r34980 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34979‎ | r34980 | r34981 >
Date:14:13, 17 May 2008
Author:ashley
Status:old
Tags:
Comment:
EditOwn:
*standard coding style
*proper copyright symbol as per http://en.wikipedia.org/wiki/Copyright_symbol
*Finnish i18n
Modified paths:
  • /trunk/extensions/EditOwn/EditOwn.i18n.php (modified) (history)
  • /trunk/extensions/EditOwn/EditOwn.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EditOwn/EditOwn.php
@@ -6,7 +6,7 @@
77 * (at your option) any later version.
88 *
99 * @author Roan Kattouw <roan.kattouw@home.nl>
10 - * @copyright Copyright (C) 2007 Roan Kattouw
 10+ * @copyright Copyright © 2007 Roan Kattouw
1111 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
1212 *
1313 * An extension that allows changing the author of a revision
@@ -38,42 +38,37 @@
3939
4040 $wgEditOwnExcludedNamespaces = array();
4141
42 -function EditOwn($title, $user, $action, &$result)
43 -{
 42+function EditOwn($title, $user, $action, &$result) {
4443 static $cache = array();
4544 global $wgEditOwnExcludedNamespaces;
4645 if(!is_array($wgEditOwnExcludedNamespaces))
4746 // Prevent PHP from whining
4847 $wgEditOwnExcludedNamespaces = array();
4948
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)) {
5250 $result = null;
5351 return true;
5452 }
5553
56 - if(isset($cache[$user->getName()][$title->getArticleId()]))
57 - {
 54+ if(isset($cache[$user->getName()][$title->getArticleId()])) {
5855 $result = $cache[$user->getName()][$title->getArticleId()];
5956 return is_null($result);
6057 }
6158
6259 // 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);
6461 $res = $dbr->select('revision', Revision::selectFields(),
6562 array('rev_page' => $title->getArticleId()),
6663 __METHOD__, array('ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1));
67 - if(!($row = $dbr->fetchObject($res)))
68 - {
 64+ if(!($row = $dbr->fetchObject($res))) {
6965 // Nonexistent title? Creation is allowed
7066 $result = $cache[$user->getName()][$title->getArticleId()] = null;
7167 return true;
7268 }
7369 $rev = new Revision($row);
74 - if($user->getName() == $rev->getRawUserText())
75 - {
 70+ if($user->getName() == $rev->getRawUserText()) {
7671 $result = $cache[$user->getName()][$title->getArticleId()] = null;
7772 return true;
7873 }
7974 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 @@
2929 'editown-desc' => "Uzantoj sen la ''editall'' rajto nur povas redakti paĝojn kiujn ili mem kreis",
3030 );
3131
 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+
3239 /** French (Français)
3340 * @author Grondin
3441 */

Status & tagging log