Index: xrds_simple.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/xrds_simple/xrds_simple.info,v retrieving revision 1.1 diff -u -r1.1 xrds_simple.info --- xrds_simple.info 3 Jun 2008 06:07:33 -0000 1.1 +++ xrds_simple.info 8 Jun 2008 19:10:30 -0000 @@ -1,4 +1,4 @@ ; $Id: xrds_simple.info,v 1.1 2008/06/03 06:07:33 walkah Exp $ name = XRDS Simple description = Implements the XRDS-Simple spec for discovering services -core = 6.x +core = 5.x Index: xrds_simple.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/xrds_simple/xrds_simple.module,v retrieving revision 1.1 diff -u -r1.1 xrds_simple.module --- xrds_simple.module 3 Jun 2008 06:07:33 -0000 1.1 +++ xrds_simple.module 8 Jun 2008 19:10:30 -0000 @@ -1,38 +1,37 @@ 'xrds_simple_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['user/%user/xrds'] = array( - 'page callback' => 'xrds_simple_page', - 'page arguments' => array(1), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK - ); - - return $items; -} - -function xrds_simple_init() { - if (arg(0) == 'user' && is_numeric(arg(1))) { - $path = 'user/'. arg(1) .'/xrds'; + + if ($may_cache) { + $items[] = array( + 'path' => 'xrds', + 'callback' => 'xrds_simple_page', + 'access' => TRUE, + 'type' => MENU_CALLBACK, + ); } else { $path = 'xrds'; - } + if (arg(0) == 'user' && is_numeric(arg(1)) && $account = user_load(array('uid' => arg(1)))) { + $path = 'user/'. $account->uid .'/xrds'; + $items[] = array( + 'path' => $path, + 'callback' => 'xrds_simple_page', + 'callback arguments' => array($account), + 'access' => TRUE, + 'type' => MENU_CALLBACK + ); + } + $url = url($path, null, null, true); + drupal_set_header('X-XRDS-Location: '. $url); + drupal_set_header('X-Yadis-Location: '. $url); + drupal_set_html_head(''); + drupal_set_html_head(''); + } - $url = url($path, array('absolute' => TRUE)); - drupal_set_header('X-XRDS-Location: '. $url); - drupal_set_header('X-Yadis-Location: '. $url); - drupal_set_html_head(''); - drupal_set_html_head(''); + return $items; } function xrds_simple_page($account = NULL) { @@ -50,14 +49,13 @@ */ function xrds_simple_document($account = NULL) { $xrds = module_invoke_all('xrds', $account); - + if (empty($xrds)) { return FALSE; } $output = '' . "\n"; $output .= '' . "\n"; - foreach ($xrds as $xrd) { $output .= '