r108345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108344‎ | r108345 | r108346 >
Date:01:49, 8 January 2012
Author:krinkle
Status:reverted (Comments)
Tags:bug27930 
Comment:
[Skin] Add CSS hook for action ("action-.." class on body)
* Fixes bug 4438
* Depends on r108342. See also r108343 which did a similar thing for mw.config wgAction

Previously attempted in r91871, which was reverted in r94131.

Added in OutputPage instead of Skin::getPageClasses, as this is not directly page nor skin related. It also ensures independency from skins, this CSS class should be always available so that it can be relied on by the front-end.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -231,6 +231,7 @@
232232 * (bug 33587) Remove action "historysubmit" from history pages.
233233 * (bug 25800) mw.config wgAction should contain the actually performed action instead
234234 of whatever the query value contains.
 235+* (bug 4438) Add CSS hook for current WikiPage action.
235236
236237 === API changes in 1.19 ===
237238 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/OutputPage.php
@@ -2380,7 +2380,8 @@
23812381 * @return String: The doctype, opening <html>, and head element.
23822382 */
23832383 public function headElement( Skin $sk, $includeStyle = true ) {
2384 - global $wgContLang;
 2384+ global $wgContLang, $mediaWiki;
 2385+
23852386 $userdir = $this->getLanguage()->getDir();
23862387 $sitedir = $wgContLang->getDir();
23872388
@@ -2425,6 +2426,7 @@
24262427 }
24272428 $bodyAttrs['class'] .= ' ' . $sk->getPageClasses( $this->getTitle() );
24282429 $bodyAttrs['class'] .= ' skin-' . Sanitizer::escapeClass( $sk->getSkinName() );
 2430+ $bodyAttrs['class'] .= ' action-' . Sanitizer::escapeClass( $mediaWiki->getPerformedAction() );
24292431
24302432 $sk->addToBodyAttributes( $this, $bodyAttrs ); // Allow skins to add body attributes they need
24312433 wfRunHooks( 'OutputPageBodyAttributes', array( $this, $sk, &$bodyAttrs ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r108625MFT r108345, r108145 without tests/release-notesreedy15:31, 11 January 2012
r108626Revert r108345 out of r108625, also revert r94131 out of r108622reedy15:37, 11 January 2012
r108632Add @since to getPerformedAction, added in r108342...reedy15:51, 11 January 2012
r109223[Actions] Move action logic out of MediaWiki::getAction/MediaWiki::performAct...krinkle21:49, 17 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91871Add action-* class to body. Bug 4438. Based on patch by Subfaderdiebuche10:57, 11 July 2011
r94131Reverted r91871 per CR: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/......aaron18:36, 9 August 2011
r108342Implement MediaWiki::getPerformedAction()...krinkle01:31, 8 January 2012
r108343[mw.config] wgAction shouldn't use direct URL values...krinkle01:34, 8 January 2012

Comments

#Comment by Krinkle (talk | contribs)   01:50, 8 January 2012

Tagging for backport to 1.18. Only merge if r94131 is also merged!, as that revision removed the "wrong" way.

#Comment by Hashar (talk | contribs)   14:22, 10 January 2012

Just like r108343 , shouldn't getPerformedAction() be part of the RequestContext ?

That would save global :b

Status & tagging log