Skip to content

Commit

Permalink
CRM-17352 - Use CiviCRM to load scripts for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Jan 11, 2018
1 parent e7c93dd commit 670a34b
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions CRM/Utils/System/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,52 +207,6 @@ public function addHTMLHead($header) {
\Drupal::service('civicrm.page_state')->addHtmlHeader($header);
}

/**
* @inheritDoc
*/
public function addScriptUrl($url, $region) {
static $weight = 0;

switch ($region) {
case 'html-header':
break;

default:
return FALSE;
}

$script = array(
'#tag' => 'script',
'#attributes' => array(
'src' => $url,
),
'#weight' => $weight,
);
$weight++;
\Drupal::service('civicrm.page_state')->addJS($script);
return TRUE;
}

/**
* @inheritDoc
*/
public function addScript($code, $region) {
switch ($region) {
case 'html-header':
break;

default:
return FALSE;
}

$script = array(
'#tag' => 'script',
'#value' => $code,
);
\Drupal::service('civicrm.page_state')->addJS($script);
return TRUE;
}

/**
* @inheritDoc
*/
Expand Down

0 comments on commit 670a34b

Please sign in to comment.