Projet

Général

Profil

Révision 74f6bef0

Ajouté par Assos Assos il y a plus de 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/themes/adaptivetheme/at_core/inc/get.inc
63 63
 * @param $theme_name
64 64
 */
65 65
function at_get_info($theme_name) {
66
  $info = drupal_static(__FUNCTION__, array());
66
  $info = &drupal_static(__FUNCTION__, array());
67 67
  if (empty($info)) {
68 68
    $lt = list_themes();
69 69
    foreach ($lt as $key => $value) {
......
86 86
 * @param $theme_name, usually the active theme.
87 87
 */
88 88
function at_get_info_trail($theme_name) {
89
  $info_trail = drupal_static(__FUNCTION__, array());
89
  $info_trail = &drupal_static(__FUNCTION__, array());
90 90
  if (empty($info_trail)) {
91 91
    $lt = list_themes();
92 92

  
......
206 206

  
207 207
/**
208 208
 * Return a device context.
209
 * Wrapper for browscap_get_browser().
209
 * Wrapper for mobile_detect_get_object() and
210
 * browscap_get_browser().
210 211
 */
211 212
function at_get_browser() {
212
  $is_mobile = &drupal_static(__FUNCTION__, array());
213
  if (empty($is_mobile)) {
214
    $is_mobile = FALSE;
215
    if (function_exists('browscap_get_browser')) {
216
      $browser = browscap_get_browser();
217
      if ($browser['ismobiledevice'] == 1) {
218
        $is_mobile = TRUE;
213
  $browser = &drupal_static(__FUNCTION__, array());
214
  if (empty($browser)) {
215
    $browser['is_mobile'] = NULL;
216
    $browser['is_tablet'] = NULL;
217

  
218
    if (function_exists('mobile_detect_get_object')) {
219
      $detect = mobile_detect_get_object();
220
      if ($detect) {
221
        $browser['is_mobile'] = $detect->isMobile();
222
        $browser['is_tablet'] = $detect->isTablet();
223
      }
224
    }
225
    else if (function_exists('browscap_get_browser')) {
226
      $browscap = browscap_get_browser();
227
      if ($browscap) {
228
        if (filter_var($browscap['ismobiledevice'], FILTER_VALIDATE_BOOLEAN) == TRUE) {
229
          $browser['is_mobile'] = TRUE;
230
        }
219 231
      }
220 232
    }
221 233
  }
222 234

  
223
  return $is_mobile;
235
  return $browser;
224 236
}

Formats disponibles : Unified diff