test
function he_custom_theme() { $theme = _is_mobile () ? 'bootstrap_example' : 'bartik'; // Allow the user to request a particular theme via a query parameter. if (isset ( $_GET ['theme'] )) { $theme = $_GET ['theme']; } return $theme; } function _is_mobile() { if (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'android' )) { return true; } elseif (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'iphone' )) { return true; } elseif (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'ipad' )) { return true; } else { return false; } }
板块
Drupal 版本