From: John Du Hart Date: Sun, 23 Oct 2011 18:38:22 +0000 (+0000) Subject: Adding functions to HTMLForm for explicitly setting the content of the header and... X-Git-Tag: 1.31.0-rc.0~26946 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=86b9b0febd8b5419c098f97fbeb7877a078af0e6;p=lhc%2Fweb%2Fwiklou.git Adding functions to HTMLForm for explicitly setting the content of the header and footer. Also adds a function for setting the intro, as a counterpart to addPreText --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index f97519ce1f..b80f0d71d5 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -309,7 +309,16 @@ class HTMLForm extends ContextSource { * Set the introductory message, overwriting any existing message. * @param $msg String complete text of message to display */ - function setIntro( $msg ) { $this->mPre = $msg; } + function setIntro( $msg ) { + $this->setPreText( $msg ); + } + + /** + * Set the introductory message, overwriting any existing message. + * @since 1.19 + * @param $msg String complete text of message to display + */ + function setPreText( $msg ) { $this->mPre = $msg; } /** * Add introductory text. @@ -333,6 +342,20 @@ class HTMLForm extends ContextSource { } } + /** + * Set header text, inside the form. + * @since 1.19 + * @param $msg String complete text of message to display + * @param $section The section to add the header to + */ + function setHeaderText( $msg, $section = null ) { + if ( is_null( $section ) ) { + $this->mHeader = $msg; + } else { + $this->mSectionHeaders[$section] = $msg; + } + } + /** * Add footer text, inside the form. * @param $msg String complete text of message to display @@ -349,12 +372,32 @@ class HTMLForm extends ContextSource { } } + /** + * Set footer text, inside the form. + * @since 1.19 + * @param $msg String complete text of message to display + * @param $section string The section to add the footer text to + */ + function setFooterText( $msg, $section = null ) { + if ( is_null( $section ) ) { + $this->mFooter = $msg; + } else { + $this->mSectionFooters[$section] = $msg; + } + } + /** * Add text to the end of the display. * @param $msg String complete text of message to display */ function addPostText( $msg ) { $this->mPost .= $msg; } + /** + * Set text at the end of the display. + * @param $msg String complete text of message to display + */ + function setPostText( $msg ) { $this->mPost = $msg; } + /** * Add a hidden field to the output * @param $name String field name. This will be used exactly as entered