From: Sam Reed Date: Tue, 9 Feb 2010 20:47:35 +0000 (+0000) Subject: * (bug 18608) - API should provide list of CSS styles to apply to rendered output X-Git-Tag: 1.31.0-rc.0~37848 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=66693868099f414dda068eff1be9644f6b451658;p=lhc%2Fweb%2Fwiklou.git * (bug 18608) - API should provide list of CSS styles to apply to rendered output --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7d44e0015f..145844206a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -842,6 +842,7 @@ comment from another wiki. * (bug 18758) API read of watchlist's wl_notificationtimestamp * (bug 20809) Expose EditFormPreloadText via the API * (bug 18427) Comment (edit summary) parser option for API +* (bug 18608) - API should provide list of CSS styles to apply to rendered output === Languages updated in 1.16 === diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index b47a7ac95d..c24872b323 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -165,9 +165,18 @@ class ApiParse extends ApiBase { $result_array['displaytitle'] = $p_result->getDisplayTitle() ? $p_result->getDisplayTitle() : $titleObj->getPrefixedText(); - + if ( isset( $prop['headitems'] ) ) $result_array['headitems'] = $this->formatHeadItems( $p_result->getHeadItems() ); + + if ( isset( $prop['headhtml'] ) ) { + + $out = new OutputPage; + $out->addParserOutputNoText( $p_result ); // PO object generated by action=parse + + $result_array['stylesheets'] = array(); + $result->setContent( $result_array['headhtml'], $out->headElement( $wgUser->getSkin() ) ); + } if ( !is_null( $oldid ) ) $result_array['revid'] = intval( $oldid ); @@ -267,7 +276,8 @@ class ApiParse extends ApiBase { 'sections', 'revid', 'displaytitle', - 'headitems' + 'headitems', + 'headhtml' ) ), 'pst' => false,