UIkitComponents.php in UIkit Components 7.2
File
src/UIkitComponents.php
View source
<?php
namespace Drupal\uikit_components;
use Drupal\uikit\UIkit;
class UIkitComponents {
public static function getUIkitAsset($component = NULL) {
if (!path_is_admin(current_path()) || self::isAdminThemeUIkitSubtheme()) {
UIkit::getCdnAsset($component);
}
}
private function isAdminThemeUIkitSubtheme() {
$admin_theme = variable_get('admin_theme', 'none');
$admin_theme_info_file = drupal_get_path('theme', $admin_theme) . "/{$admin_theme}.info";
$admin_theme_info = drupal_parse_info_file($admin_theme_info_file);
if (isset($admin_theme_info['base theme']) && $admin_theme_info['base theme'] == 'uikit') {
return TRUE;
}
else {
return FALSE;
}
}
}