Last active
December 17, 2015 05:58
-
-
Save betweenbrain/5561375 to your computer and use it in GitHub Desktop.
Proposed change to allow `JHtml::_('bootstrap.loadCss')` usage auto detect language direction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Loads CSS files needed by Bootstrap | |
* | |
* @param boolean $includeMainCss If true, main bootstrap.css files are loaded | |
* @param string $direction rtl or ltr direction. If empty, ltr is assumed | |
* @param array $attribs Optional array of attributes to be passed to JHtml::_('stylesheet') | |
* | |
* @return void | |
* | |
* @since 3.0 | |
*/ | |
public static function loadCss($includeMainCss = true, $direction = NULL, $attribs = array()) | |
{ | |
// Load Bootstrap main CSS | |
if ($includeMainCss) | |
{ | |
JHtml::_('stylesheet', 'jui/bootstrap.min.css', $attribs, true); | |
JHtml::_('stylesheet', 'jui/bootstrap-responsive.min.css', $attribs, true); | |
JHtml::_('stylesheet', 'jui/bootstrap-extended.css', $attribs, true); | |
} | |
// Load Bootstrap RTL CSS | |
if ($direction == 'rtl' || ($direction = NULL && JFactory::getDocument()->direction == 'rtl')) | |
{ | |
JHtml::_('stylesheet', 'jui/bootstrap-rtl.css', $attribs, true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment