Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
info.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Openstreetmap
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die();
11 
12 /**
13  * Openstreetmap API Info class for the Joomla Platform
14  *
15  * @package Joomla.Platform
16  * @subpackage Openstreetmap
17  * @since 13.1
18 */
20 {
21  /**
22  * Method to get capabilities of the API
23  *
24  * @return array The XML response
25  *
26  * @since 13.1
27  */
28  public function getCapabilities()
29  {
30  // Set the API base
31  $base = 'capabilities';
32 
33  // Build the request path.
34  $path = $this->getOption('api.url') . $base;
35 
36  // Send the request.
37  $response = $this->oauth->oauthRequest($path, 'GET', array());
38 
39  $xml_string = simplexml_load_string($response->body);
40 
41  return $xml_string;
42  }
43 
44  /**
45  * Method to retrieve map data of a bounding box
46  *
47  * @param float $left Left boundary
48  * @param float $bottom Bottom boundary
49  * @param float $right Right boundary
50  * @param float $top Top boundary
51  *
52  * @return array The XML response
53  *
54  * @since 13.1
55  */
56  public function retrieveMapData($left, $bottom, $right, $top)
57  {
58  // Set the API base
59  $base = 'map?bbox=' . $left . ',' . $bottom . ',' . $right . ',' . $top;
60 
61  // Build the request path.
62  $path = $this->getOption('api.url') . $base;
63 
64  // Send the request.
65  $response = $this->oauth->oauthRequest($path, 'GET', array());
66 
67  $xml_string = simplexml_load_string($response->body);
68 
69  return $xml_string;
70  }
71 
72  /**
73  * Method to retrieve permissions for current user
74  *
75  * @return array The XML response
76  *
77  * @since 13.1
78  */
79  public function retrievePermissions()
80  {
81  // Set the API base
82  $base = 'permissions';
83 
84  // Build the request path.
85  $path = $this->getOption('api.url') . $base;
86 
87  // Send the request.
88  $response = $this->oauth->oauthRequest($path, 'GET', array());
89 
90  $xml_string = simplexml_load_string($response->body);
91 
92  return $xml_string;
93  }
94 }