Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -329,9 +329,9 @@ |
330 | 330 | $tpl->set( 'numberofwatchingusers', false ); |
331 | 331 | if ( $out->isArticle() && $this->getTitle()->exists() ) { |
332 | 332 | if ( $this->isRevisionCurrent() ) { |
333 | | - $article = new Article( $this->getTitle(), 0 ); |
| 333 | + $page = WikiPage::factory( $this->getTitle() ); |
334 | 334 | if ( !$wgDisableCounters ) { |
335 | | - $viewcount = $article->getCount(); |
| 335 | + $viewcount = $page->getCount(); |
336 | 336 | if ( $viewcount ) { |
337 | 337 | $tpl->set( 'viewcount', $this->msg( 'viewcount' )->numParams( $viewcount )->parse() ); |
338 | 338 | } |
— | — | @@ -351,9 +351,9 @@ |
352 | 352 | } |
353 | 353 | |
354 | 354 | if ( $wgMaxCredits != 0 ) { |
355 | | - $tpl->set( 'credits', Action::factory( 'credits', $article )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) ); |
| 355 | + $tpl->set( 'credits', Action::factory( 'credits', $page, $this->getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) ); |
356 | 356 | } else { |
357 | | - $tpl->set( 'lastmod', $this->lastModified( $article ) ); |
| 357 | + $tpl->set( 'lastmod', $this->lastModified( $page ) ); |
358 | 358 | } |
359 | 359 | } |
360 | 360 | $tpl->set( 'copyright', $this->getCopyright() ); |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -790,14 +790,14 @@ |
791 | 791 | /** |
792 | 792 | * Get the timestamp of the latest revision, formatted in user language |
793 | 793 | * |
794 | | - * @param $article Article object. Used if we're working with the current revision |
| 794 | + * @param $page WikiPage object. Used if we're working with the current revision |
795 | 795 | * @return String |
796 | 796 | */ |
797 | | - protected function lastModified( $article ) { |
| 797 | + protected function lastModified( $page ) { |
798 | 798 | if ( !$this->isRevisionCurrent() ) { |
799 | 799 | $timestamp = Revision::getTimestampFromId( $this->getTitle(), $this->getRevisionId() ); |
800 | 800 | } else { |
801 | | - $timestamp = $article->getTimestamp(); |
| 801 | + $timestamp = $page->getTimestamp(); |
802 | 802 | } |
803 | 803 | |
804 | 804 | if ( $timestamp ) { |
Index: trunk/phase3/includes/Action.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Page on which we're performing the action |
31 | | - * @var Article |
| 31 | + * @var Page |
32 | 32 | */ |
33 | 33 | protected $page; |
34 | 34 | |
— | — | @@ -72,14 +72,15 @@ |
73 | 73 | /** |
74 | 74 | * Get an appropriate Action subclass for the given action |
75 | 75 | * @param $action String |
76 | | - * @param $page Article |
| 76 | + * @param $page Page |
| 77 | + * @param $context IContextSource |
77 | 78 | * @return Action|false|null false if the action is disabled, null |
78 | 79 | * if it is not recognised |
79 | 80 | */ |
80 | | - public final static function factory( $action, Page $page ) { |
| 81 | + public final static function factory( $action, Page $page, IContextSource $context = null ) { |
81 | 82 | $class = self::getClass( $action, $page->getActionOverrides() ); |
82 | 83 | if ( $class ) { |
83 | | - $obj = new $class( $page ); |
| 84 | + $obj = new $class( $page, $context ); |
84 | 85 | return $obj; |
85 | 86 | } |
86 | 87 | return $class; |
— | — | @@ -183,10 +184,12 @@ |
184 | 185 | /** |
185 | 186 | * Protected constructor: use Action::factory( $action, $page ) to actually build |
186 | 187 | * these things in the real world |
187 | | - * @param Page $page |
| 188 | + * @param $page Page |
| 189 | + * @param $context IContextSource |
188 | 190 | */ |
189 | | - protected function __construct( Page $page ) { |
| 191 | + protected function __construct( Page $page, IContextSource $context = null ) { |
190 | 192 | $this->page = $page; |
| 193 | + $this->context = $context; |
191 | 194 | } |
192 | 195 | |
193 | 196 | /** |