Source for file user.php
Documentation is available at user.php
* @package Joomla.Platform
* @subpackage Openstreetmap
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
defined('JPATH_PLATFORM') or die();
* Openstreetmap API User class for the Joomla Platform
* @package Joomla.Platform
* @subpackage Openstreetmap
* Method to get user details
* @return array The XML response
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'GET', $parameters);
* Method to get preferences
* @return array The XML response
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
$base =
'user/preferences';
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'GET', $parameters);
* Method to replace user preferences
* @param array $preferences Array of new preferences
* @return array The XML response
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
$base =
'user/preferences';
// Build the request path.
// Create a list of preferences
if (!empty($preferences))
foreach ($preferences as $key =>
$value)
$preference_list .=
'<preference k="' .
$key .
'" v="' .
$value .
'"/>';
$xml =
'<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="JOpenstreetmap">
$header['Content-Type'] =
'text/xml';
$response =
$this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header);
* Method to change user preferences
* @param string $key Key of the preference
* @param string $preference New value for preference
* @return array The XML response
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
$base =
'user/preferences/' .
$key;
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'PUT', $parameters, $preference);
Documentation generated on Tue, 19 Nov 2013 15:16:20 +0100 by phpDocumentor 1.4.3