/**
* Page on which we're performing the action
- * @var Article
+ * @var Page
*/
protected $page;
/**
* Get an appropriate Action subclass for the given action
* @param $action String
- * @param $page Article
+ * @param $page Page
+ * @param $context IContextSource
* @return Action|false|null false if the action is disabled, null
* if it is not recognised
*/
- public final static function factory( $action, Page $page ) {
+ public final static function factory( $action, Page $page, IContextSource $context = null ) {
$class = self::getClass( $action, $page->getActionOverrides() );
if ( $class ) {
- $obj = new $class( $page );
+ $obj = new $class( $page, $context );
return $obj;
}
return $class;
/**
* Protected constructor: use Action::factory( $action, $page ) to actually build
* these things in the real world
- * @param Page $page
+ * @param $page Page
+ * @param $context IContextSource
*/
- protected function __construct( Page $page ) {
+ protected function __construct( Page $page, IContextSource $context = null ) {
$this->page = $page;
+ $this->context = $context;
}
/**