/[drupal]/contributions/modules/browscap/browscap.module
ViewVC logotype

Diff of /contributions/modules/browscap/browscap.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6.2.6, Sun Mar 8 11:10:09 2009 UTC revision 1.6.2.7, Wed Sep 30 17:18:22 2009 UTC
# Line 1  Line 1 
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
# Line 70  function browscap_menu($may_cache) { Line 70  function browscap_menu($may_cache) {
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
# Line 206  function browscap_top_useragents($view = Line 206  function browscap_top_useragents($view =
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) {
# Line 366  function browscap_unmonitor() { Line 366  function browscap_unmonitor() {
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;
# Line 379  function browscap_useragent_properties($ Line 386  function browscap_useragent_properties($
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  }  }

Legend:
Removed from v.1.6.2.6  
changed lines
  Added in v.1.6.2.7

  ViewVC Help
Powered by ViewVC 1.1.2