From: Alexandre Emsenhuber Date: Thu, 3 Nov 2011 09:21:45 +0000 (+0000) Subject: * Set constant default values in class definition and not constructor X-Git-Tag: 1.31.0-rc.0~26743 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=75f9eb10ec903ff3285f046ca5b401ed59225eb5;p=lhc%2Fweb%2Fwiklou.git * Set constant default values in class definition and not constructor * Added getTitle() * Mark constructor and getArticle() as public * Removed a PHP4-ism in constructor --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 43a14d92b2..0c808ef82b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -55,7 +55,7 @@ class EditPage { */ var $mTitle; private $mContextTitle = null; - var $action; + var $action = 'submit'; var $isConflict = false; var $isCssJsSubpage = false; var $isCssSubpage = false; @@ -96,15 +96,15 @@ class EditPage { # Placeholders for text injection by hooks (must be HTML) # extensions should take care to _append_ to the present value - public $editFormPageTop; // Before even the preview - public $editFormTextTop; - public $editFormTextBeforeContent; - public $editFormTextAfterWarn; - public $editFormTextAfterTools; - public $editFormTextBottom; - public $editFormTextAfterContent; - public $previewTextAfterContent; - public $mPreloadText; + public $editFormPageTop = ''; // Before even the preview + public $editFormTextTop = ''; + public $editFormTextBeforeContent = ''; + public $editFormTextAfterWarn = ''; + public $editFormTextAfterTools = ''; + public $editFormTextBottom = ''; + public $editFormTextAfterContent = ''; + public $previewTextAfterContent = ''; + public $mPreloadText = ''; /* $didSave should be set to true whenever an article was succesfully altered. */ public $didSave = false; @@ -116,30 +116,26 @@ class EditPage { * @todo document * @param $article Article */ - function __construct( $article ) { - $this->mArticle =& $article; + public function __construct( $article ) { + $this->mArticle = $article; $this->mTitle = $article->getTitle(); - $this->action = 'submit'; - - # Placeholders for text injection by hooks (empty per default) - $this->editFormPageTop = - $this->editFormTextTop = - $this->editFormTextBeforeContent = - $this->editFormTextAfterWarn = - $this->editFormTextAfterTools = - $this->editFormTextBottom = - $this->editFormTextAfterContent = - $this->previewTextAfterContent = - $this->mPreloadText = ""; } /** * @return Article */ - function getArticle() { + public function getArticle() { return $this->mArticle; } + /** + * @since 1.19 + * @return Title + */ + public function getTitle() { + return $this->mTitle; + } + /** * Set the context Title object *