+ protected function getSummaryMessage() {
+ return "apihelp-{$this->getModulePath()}-summary";
+ }
+
+ /**
+ * Return the extended help text message.
+ *
+ * This is additional text to display at the top of the help section, below
+ * the summary.
+ *
+ * @since 1.30
+ * @return string|array|Message
+ */
+ protected function getExtendedDescription() {
+ return [ [
+ "apihelp-{$this->getModulePath()}-extended-description",
+ 'api-help-no-extended-description',
+ ] ];
+ }
+
+ /**
+ * Get final module summary
+ *
+ * Ideally this will just be the getSummaryMessage(). However, for
+ * backwards compatibility, if that message does not exist then the first
+ * line of wikitext from the description message will be used instead.
+ *
+ * @since 1.30
+ * @return Message
+ */
+ public function getFinalSummary() {
+ $msg = ApiBase::makeMessage( $this->getSummaryMessage(), $this->getContext(), [
+ $this->getModulePrefix(),
+ $this->getModuleName(),
+ $this->getModulePath(),
+ ] );
+ if ( !$msg->exists() ) {
+ wfDeprecated( 'API help "description" messages', '1.30' );
+ $msg = ApiBase::makeMessage( $this->getDescriptionMessage(), $this->getContext(), [
+ $this->getModulePrefix(),
+ $this->getModuleName(),
+ $this->getModulePath(),
+ ] );
+ $msg = ApiBase::makeMessage( 'rawmessage', $this->getContext(), [
+ preg_replace( '/\n.*/s', '', $msg->text() )
+ ] );
+ }
+ return $msg;