* @return \CRM_Core_Resources_Bundle
*/
public static function createBootstrap3Bundle($name) {
- $bundle = new CRM_Core_Resources_Bundle($name);
- $bundle->addStyleFile('civicrm', 'css/bootstrap3.css');
- $bundle->addScriptFile('civicrm', 'js/bootstrap3.js', [
- 'translate' => FALSE,
- ]);
+ $bundle = new CRM_Core_Resources_Bundle($name, ['script', 'scriptFile', 'scriptUrl', 'settings', 'style', 'styleFile', 'styleUrl', 'markup']);
+ // Leave it to the theme/provider to register specific resources.
+ // $bundle->addStyleFile('civicrm', 'css/bootstrap3.css');
+ // $bundle->addScriptFile('civicrm', 'js/bootstrap3.js', [
+ // 'translate' => FALSE,
+ //]);
+
+ // This warning will show if bootstrap is unavailable. Normally it will be hidden by the bootstrap .collapse class.
+ $bundle->addMarkup('
+ <div id="bootstrap-theme">
+ <div class="messages warning no-popup collapse">
+ <p>
+ <i class="crm-i fa-exclamation-triangle" aria-hidden="true"></i>
+ <strong>' . ts('Bootstrap theme not found.') . '</strong>
+ </p>
+ <p>' . ts('This screen may not work correctly without a bootstrap-based theme such as Shoreditch installed.') . '</p>
+ </div>
+ </div>',
+ ['region' => 'page-header']
+ );
+
CRM_Utils_Hook::alterBundle($bundle);
self::useRegion($bundle, self::REGION);
return $bundle;
{{:: ts('CiviCRM APIv4') }}{{ entity ? (' (' + entity + '::' + action + ')') : '' }}
</h1>
- <!--This warning will show if bootstrap is unavailable. Normally it will be hidden by the bootstrap .collapse class.-->
- <div class="messages warning no-popup collapse">
- <p>
- <i class="crm-i fa-exclamation-triangle" aria-hidden="true"></i>
- <strong>{{:: ts('Bootstrap theme not found.') }}</strong>
- </p>
- <p>{{:: ts('This screen may not work correctly without a bootstrap-based theme such as Shoreditch installed.') }}</p>
- </div>
-
<div class="api4-explorer-row">
<form name="api4-explorer" class="panel panel-default explorer-params-panel">
<div class="panel-heading">