X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Factions%2FAction.php;h=43f03c3a4f759f12aa8fc3aa4c389a8bd3c9f57a;hb=9bba2d169ed968839b07c85be487e0185cb38ce0;hp=8d11d901a20fb06d2455b5eccbf46ce9599d4386;hpb=085ca26d696d63ecd33072c9b1a9efa0a89f706d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/Action.php b/includes/actions/Action.php index 8d11d901a2..43f03c3a4f 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -132,6 +132,8 @@ abstract class Action { if ( $actionName === 'historysubmit' ) { if ( $request->getBool( 'revisiondelete' ) ) { $actionName = 'revisiondelete'; + } elseif ( $request->getBool( 'editchangetags' ) ) { + $actionName = 'editchangetags'; } else { $actionName = 'view'; } @@ -374,6 +376,28 @@ abstract class Action { return $this->msg( strtolower( $this->getName() ) )->escaped(); } + /** + * Adds help link with an icon via page indicators. + * Link target can be overridden by a local message containing a wikilink: + * the message key is: lowercase action name + '-helppage'. + * @param string $to Target MediaWiki.org page title or encoded URL. + * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o. + * @since 1.25 + */ + public function addHelpLink( $to, $overrideBaseUrl = false ) { + global $wgContLang; + $msg = wfMessage( $wgContLang->lc( + Action::getActionName( $this->getContext() ) + ) . '-helppage' ); + + if ( !$msg->isDisabled() ) { + $helpUrl = Skin::makeUrl( $msg->plain() ); + $this->getOutput()->addHelpLink( $helpUrl, true ); + } else { + $this->getOutput()->addHelpLink( $to, $overrideBaseUrl ); + } + } + /** * The main action entry point. Do all output for display and send it to the context * output. Do not use globals $wgOut, $wgRequest, etc, in implementations; use @@ -383,4 +407,14 @@ abstract class Action { * @throws ErrorPageError */ abstract public function show(); + + /** + * Call wfTransactionalTimeLimit() if this request was POSTed + * @since 1.26 + */ + protected function useTransactionalTimeLimit() { + if ( $this->getRequest()->wasPosted() ) { + wfTransactionalTimeLimit(); + } + } }