| 1 |
<?php |
<?php |
| 2 |
// $Id: browscap.module,v 1.6.2.5 2008/09/12 18:02:33 robloach Exp $ |
// $Id: browscap.module,v 1.6.2.6 2009/03/08 11:10:09 robloach Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 70 |
$items[] = array( |
$items[] = array( |
| 71 |
'path' => 'admin/logs/browscap/useragent', |
'path' => 'admin/logs/browscap/useragent', |
| 72 |
'callback' => 'browscap_useragent_properties', |
'callback' => 'browscap_useragent_properties', |
| 73 |
'title' => arg(4), |
'title' => 'Useragent details', |
| 74 |
'access' => $access, |
'access' => $access, |
| 75 |
'weight' => 5, |
'weight' => 5, |
| 76 |
'type' => MENU_LOCAL_TASK |
'type' => MENU_LOCAL_TASK |
| 206 |
$parent = l($useragent->parent, 'admin/logs/browscap/useragent/'. urlencode($useragent->parent)); |
$parent = l($useragent->parent, 'admin/logs/browscap/useragent/'. urlencode($useragent->parent)); |
| 207 |
} |
} |
| 208 |
else { |
else { |
| 209 |
$parent = $useragent->parent; |
$parent = check_plain($useragent->parent); |
| 210 |
} |
} |
| 211 |
if ($view == 'all') { |
if ($view == 'all') { |
| 212 |
if ($useragent->is_crawler) { |
if ($useragent->is_crawler) { |
| 366 |
} |
} |
| 367 |
} |
} |
| 368 |
|
|
| 369 |
|
/** |
| 370 |
|
* Page callback to show details about known useragents. |
| 371 |
|
* |
| 372 |
|
* @param string $useragent a useragent, taken from the url. |
| 373 |
|
* @return string an HTMl blob representing the data about this useragent. |
| 374 |
|
*/ |
| 375 |
function browscap_useragent_properties($useragent = NULL) { |
function browscap_useragent_properties($useragent = NULL) { |
| 376 |
|
drupal_set_title(check_plain(arg(4))); |
| 377 |
if ($useragent == NULL) { |
if ($useragent == NULL) { |
| 378 |
drupal_not_found(); |
drupal_not_found(); |
| 379 |
return; |
return; |
| 386 |
$data = unserialize($row->data); |
$data = unserialize($row->data); |
| 387 |
$headers = array(t('property'), t('value')); |
$headers = array(t('property'), t('value')); |
| 388 |
foreach($data as $key => $val) { |
foreach($data as $key => $val) { |
| 389 |
$rows[] = array($key, $val); |
$rows[] = array(check_plain($key), check_plain($val)); |
| 390 |
} |
} |
| 391 |
$output = theme('table', $header, $rows); |
$output = theme('table', $headers, $rows); |
| 392 |
return $output; |
return $output; |
| 393 |
} |
} |