Permalink
Browse files

Merge remote-tracking branch 'upstream/staging' into JGithubLabels

  • Loading branch information...
2 parents 534b55b + 92b45de commit 2f271103d8bd1c42fc210dcee57da555a9223c7c @nprasath002 nprasath002 committed Oct 13, 2012
Showing with 11,262 additions and 56 deletions.
  1. +2 −0 docs/manual/en-US/chapters/packages.xml
  2. +95 −0 docs/manual/en-US/chapters/packages/google.xml
  3. +1 −1 libraries/joomla/crypt/password/simple.php
  4. +25 −1 libraries/joomla/form/field.php
  5. +15 −0 libraries/joomla/github/github.php
  6. +230 −0 libraries/joomla/github/milestones.php
  7. +89 −0 libraries/joomla/google/auth.php
  8. +125 −0 libraries/joomla/google/auth/oauth2.php
  9. +184 −0 libraries/joomla/google/data.php
  10. +405 −0 libraries/joomla/google/data/adsense.php
  11. +605 −0 libraries/joomla/google/data/calendar.php
  12. +145 −0 libraries/joomla/google/data/picasa.php
  13. +466 −0 libraries/joomla/google/data/picasa/album.php
  14. +357 −0 libraries/joomla/google/data/picasa/photo.php
  15. +95 −0 libraries/joomla/google/data/plus.php
  16. +194 −0 libraries/joomla/google/data/plus/activities.php
  17. +133 −0 libraries/joomla/google/data/plus/comments.php
  18. +171 −0 libraries/joomla/google/data/plus/people.php
  19. +132 −0 libraries/joomla/google/embed.php
  20. +327 −0 libraries/joomla/google/embed/analytics.php
  21. +678 −0 libraries/joomla/google/embed/maps.php
  22. +161 −0 libraries/joomla/google/google.php
  23. +2 −2 libraries/joomla/html/tabs.php
  24. +18 −6 libraries/joomla/log/log.php
  25. +370 −0 libraries/joomla/oauth2/client.php
  26. +1 −3 tests/core/case/case.php
  27. +1 −3 tests/core/case/database.php
  28. +147 −37 tests/suites/legacy/model/JModelLegacyTest.php
  29. +330 −0 tests/suites/unit/joomla/github/JGithubMilestonesTest.php
  30. +212 −0 tests/suites/unit/joomla/google/JGoogleAuthOauth2Test.php
  31. +436 −0 tests/suites/unit/joomla/google/JGoogleDataAdsenseTest.php
  32. +607 −0 tests/suites/unit/joomla/google/JGoogleDataCalendarTest.php
  33. +524 −0 tests/suites/unit/joomla/google/JGoogleDataPicasaAlbumTest.php
  34. +461 −0 tests/suites/unit/joomla/google/JGoogleDataPicasaPhotoTest.php
  35. +381 −0 tests/suites/unit/joomla/google/JGoogleDataPicasaTest.php
  36. +243 −0 tests/suites/unit/joomla/google/JGoogleDataPlusActivitiesTest.php
  37. +201 −0 tests/suites/unit/joomla/google/JGoogleDataPlusCommentsTest.php
  38. +240 −0 tests/suites/unit/joomla/google/JGoogleDataPlusPeopleTest.php
  39. +150 −0 tests/suites/unit/joomla/google/JGoogleDataPlusTest.php
  40. +362 −0 tests/suites/unit/joomla/google/JGoogleEmbedAnalyticsTest.php
  41. +816 −0 tests/suites/unit/joomla/google/JGoogleEmbedMapsTest.php
  42. +160 −0 tests/suites/unit/joomla/google/JGoogleTest.php
  43. +39 −0 tests/suites/unit/joomla/google/album.txt
  44. +104 −0 tests/suites/unit/joomla/google/albumlist.txt
  45. BIN tests/suites/unit/joomla/google/logo.bmp
  46. BIN tests/suites/unit/joomla/google/logo.gif
  47. BIN tests/suites/unit/joomla/google/logo.jpg
  48. BIN tests/suites/unit/joomla/google/logo.png
  49. +58 −0 tests/suites/unit/joomla/google/paloalto.txt
  50. +46 −0 tests/suites/unit/joomla/google/photo.txt
  51. +130 −0 tests/suites/unit/joomla/google/photolist.txt
  52. +58 −0 tests/suites/unit/joomla/google/sanfrancisco.txt
  53. +113 −3 tests/suites/unit/joomla/log/JLogTest.php
  54. +417 −0 tests/suites/unit/joomla/oauth2/JOauth2ClientTest.php
@@ -15,6 +15,8 @@
<xi:include href="packages/github.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="packages/google.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="packages/http.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="packages/input.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "../../Developer_Manual.ent">
+%BOOK_ENTITIES;
+]>
+<section id="chap-Joomla_Platform_Manual-Google">
+ <title>The Google Package</title>
+
+ <section>
+ <title>Using the Google Package</title>
+
+ <para>The Google package is designed to be a straightforward interface for working with various Google APIs. You can find a list of APIs and documentation for each API at <ulink
+ url="https://developers.google.com/products/">https://developers.google.com/products/.</ulink></para>
+
+ <section>
+ <title>Instantiating JGoogle</title>
+
+ <para>Instantiating JGoogle is easy:</para>
+
+ <programlisting>$google = new JGoogle;</programlisting>
+
+ <para>This creates a generic JGoogle object that can be used to instantiate objects for specific Google APIs.</para>
+
+ <para>Sometimes it is necessary to specify additional options. This can be done by injecting in a JRegistry object with your
+ preferred options:<programlisting>$options = new JRegistry;
+$options-&gt;set('clientid', 'google_client_id.apps.googleusercontent.com');
+$options-&gt;set('clientsecret', 'google_client_secret');
+
+$google = new JGoogle($options);</programlisting></para>
+ </section>
+
+ <section>
+ <title>Accessing the JGoogle APIs</title>
+
+ <para>The Google Package divides APIs into two types: data APIs and embed APIs. Data APIs use JHttp to send and receive data from Google.
+ Embed APIs output HTML, JavaScript, and XML in order to embed information from Google in a webpage.</para>
+
+ <para>The Google package is still incomplete, but there are five object APIs that have currently been
+ implemented:</para>
+
+ <para>Data: <simplelist>
+ <member>Google Calendar</member>
+
+ <member>Google AdSense</member>
+
+ <member>Google Picasa</member>
+ </simplelist></para>
+
+ <para>Data: <simplelist>
+ <member>Google Maps</member>
+
+ <member>Google Analytics</member>
+ </simplelist></para>
+
+ <para>Once a JGoogle object has been created, it is simple to use it to create objects for each individual API:<programlisting>$calendar = $google-&gt;data('calendar');</programlisting> or <programlisting>$analytics = $google-&gt;data('analytics');</programlisting></para>
+ </section>
+
+ <section>
+ <title>Using an API</title>
+
+ <para>See below for an example demonstrating the use of the Calendar API:<programlisting>$options = new JRegistry;
+
+// Client ID and Client Secret can be obtained through the Google API Console (https://code.google.com/apis/console/).
+$options-&gt;set('clientid', 'google_client_id.apps.googleusercontent.com');
+$options-&gt;set('clientsecret', 'google_client_secret');
+$options-&gt;set('redirecturi', JURI::current());
+
+$google = new JGoogle($options);
+
+// Get a calendar API object
+$calendar = $google->data('calendar');
+
+// If the client hasn't been authenticated via OAuth yet, redirect to the appropriate URL and terminate the program
+if (!$calendar->isAuth())
+{
+ JResponse::sendHeaders();
+ die();
+}
+
+// Create a new Google Calendar called "Hello World."
+$calendar->createCalendar('Hello World');</programlisting></para>
+ </section>
+
+ <section>
+ <title>More Information</title>
+
+ <para>The following resources contain more information:<simplelist>
+ <member><ulink url="http://api.joomla.org">Joomla! API Reference</ulink></member>
+
+ <member><ulink url="https://developers.google.com/">Google Developers Homepage</ulink></member>
+ </simplelist></para>
+ </section>
+ </section>
+</section>
@@ -99,7 +99,7 @@ protected function getSalt($length)
{
$bytes = ceil($length * 6 / 8);
- $randomData = str_replace('+', '.', base64_encode(JCrypt::getRandomBytes($bytes)));
+ $randomData = str_replace('+', '.', base64_encode(JCrypt::genRandomBytes($bytes)));
return substr($randomData, 0, $length);
}
@@ -141,6 +141,24 @@
protected $required = false;
/**
+ * The disabled state for the form field. If true then there must not be a possibility
+ * to change the pre-selected value, and the value must not be submitted by the browser.
+ *
+ * @var boolean
+ * @since 12.3
+ */
+ protected $disabled = false;
+
+ /**
+ * The readonly state for the form field. If true then there must not be a possibility
+ * to change the pre-selected value, and the value must submitted by the browser.
+ *
+ * @var boolean
+ * @since 12.3
+ */
+ protected $readonly = false;
+
+ /**
* The form field type.
*
* @var string
@@ -240,6 +258,8 @@ public function __get($name)
case 'multiple':
case 'name':
case 'required':
+ case 'disabled':
+ case 'readonly':
case 'type':
case 'validate':
case 'value':
@@ -324,9 +344,13 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
$multiple = (string) $element['multiple'];
$name = (string) $element['name'];
$required = (string) $element['required'];
+ $disabled = (string) $element['disabled'];
+ $readonly = (string) $element['readonly'];
- // Set the required and validation options.
+ // Set the required, disabled and validation options.
$this->required = ($required == 'true' || $required == 'required' || $required == '1');
+ $this->disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1');
+ $this->readonly = ($readonly == 'true' || $readonly == 'readonly' || $readonly == '1');
$this->validate = (string) $element['validate'];
// Add the required class if the field is required.
@@ -74,6 +74,12 @@ class JGithub
protected $commits;
/**
+ * @var JGithubMilestones GitHub API object for milestones.
+ * @since 12.3
+ */
+ protected $milestones;
+
+ /**
* Constructor.
*
* @param JRegistry $options GitHub options object.
@@ -154,6 +160,15 @@ public function __get($name)
}
return $this->commits;
}
+
+ if ($name == 'milestones')
+ {
+ if ($this->milestones == null)
+ {
+ $this->milestones = new JGithubMilestones($this->options, $this->client);
+ }
+ return $this->milestones;
+ }
}
/**
Oops, something went wrong.

0 comments on commit 2f27110

Please sign in to comment.