You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2008/05/15 02:58:47 UTC
svn commit: r656481 - in /incubator/shindig/trunk: config/
javascript/samplecontainer/examples/ php/ php/src/gadgets/
php/src/gadgets/http/ php/src/socialdata/opensocial/model/
Author: chabotc
Date: Wed May 14 17:58:46 2008
New Revision: 656481
URL: http://svn.apache.org/viewvc?rev=656481&view=rev
Log:
- Made style in gadget configurable to allow a bit more layout flexibility
- Switched default view from 'default' to 'profile'. Combined with using the container.js alias values this creates a more robust situation
- Fixed a few typos and small bugs
Modified:
incubator/shindig/trunk/config/container.js
incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
incubator/shindig/trunk/php/config.php
incubator/shindig/trunk/php/src/gadgets/Gadget.php
incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
Modified: incubator/shindig/trunk/config/container.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/config/container.js?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/config/container.js (original)
+++ incubator/shindig/trunk/config/container.js Wed May 14 17:58:46 2008
@@ -100,7 +100,7 @@
"domain" : "shindig",
"enableCaja" : true,
"supportedFields" : {
- "person" : ["id", "name", "thumbnailUrl", "profileUrl"],
+ "person" : ["id", "name", "thumbnailUrl", "profileUrl", "gender", "aboutMe", "drinker", "smoker", "relationshipStatus"],
"activity" : ["id", "title"]
},
// If true, the restful wire format will be used.
Modified: incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml (original)
+++ incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml Wed May 14 17:58:46 2008
@@ -128,6 +128,7 @@
viewer = dataResponse.get('viewer').getData();
}
activities = dataResponse.get('viewerActivities').getData()['activities'].asArray();
+ console.log(dataResponse.get('activities').getData());
activities = activities.concat(dataResponse.get('activities').getData()['activities'].asArray());
document.getElementById('stream').style.display = 'block';
Modified: incubator/shindig/trunk/php/config.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/config.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/config.php (original)
+++ incubator/shindig/trunk/php/config.php Wed May 14 17:58:46 2008
@@ -20,6 +20,10 @@
'token_cipher_key' => 'INSECURE_DEFAULT_KEY',
'token_hmac_key' => 'INSECURE_DEFAULT_KEY',
+ // Configurable CSS rules that are injected to the gadget page,
+ // be careful when adjusting these not to break most gadget's layouts :)
+ 'gadget_css' => 'body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}',
+
// The html / javascript samples use a plain text demo token,
// set this to false on anything resembling a real site
'allow_plaintext_token' => true,
Modified: incubator/shindig/trunk/php/src/gadgets/Gadget.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/Gadget.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/Gadget.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/Gadget.php Wed May 14 17:58:46 2008
@@ -293,7 +293,12 @@
public function getView($viewName)
{
- return isset($this->views[$viewName]) ? $this->views[$viewName] : $this->views[DEFAULT_VIEW];
+ if (isset($this->views[$viewName])) {
+ return $this->views[$viewName];
+ } elseif (isset($this->views[DEFAULT_VIEW])) {
+ return $this->views[DEFAULT_VIEW];
+ }
+ throw new GadgetException("Invalid view specified for this gadget");
}
}
Modified: incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetContext.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/GadgetContext.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/GadgetContext.php Wed May 14 17:58:46 2008
@@ -18,7 +18,7 @@
*
*/
-define('DEFAULT_VIEW', 'default');
+define('DEFAULT_VIEW', 'profile');
/*
* GadgetContext contains all contextual variables and classes that are relevant for this request,
Modified: incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php Wed May 14 17:58:46 2008
@@ -125,10 +125,10 @@
if (isset($pref->EnumValue)) {
foreach ($pref->EnumValue as $enum) {
$attr = $enum->attributes();
- // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error
- if (empty($attr['value'])) {
+ // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error?
+ /*if (empty($attr['value'])) {
throw new SpecParserException("EnumValue must have a value field.");
- }
+ }*/
$valueText = trim($attr['value']);
$displayText = ! empty($attr['display_value']) ? trim($attr['display_value']) : $valueText;
$preference->enumValues[$valueText] = $displayText;
Modified: incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php Wed May 14 17:58:46 2008
@@ -150,7 +150,7 @@
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
}
echo "<html>\n<head>".
- "<style type=\"text/css\">body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}</style>".
+ "<style type=\"text/css\">".Config::get('gadget_css')."</style>".
"</head><body>".
"<script><!--\n";
foreach ( $gadget->getJsLibraries() as $library ) {
Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php (original)
+++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php Wed May 14 17:58:46 2008
@@ -28,17 +28,18 @@
abstract class Enum {
public $displayValue;
- private $jsonString;
+ public $key;
public $values = array();
- public function __construct($jsonString, $displayValue)
+ public function __construct($key, $displayValue = '')
{
//FIXME should add enum restriction checking to this
- if (!isset($this->values[$jsonString])) {
+ if (!isset($this->values[$key])) {
throw new Exception("Invalid Enum key");
}
- $this->jsonString = $jsonString;
- $this->displayValue = $displayValue;
+ $this->key = $key;
+ $this->displayValue = !empty($displayValue) ? $displayValue : $this->values[$key];
+ unset($this->values);
}
public function getDisplayValue()
Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php?rev=656481&r1=656480&r2=656481&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php (original)
+++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php Wed May 14 17:58:46 2008
@@ -239,7 +239,7 @@
public function getGender()
{
- return $this->$this->gender;
+ return $this->gender;
}
public function setGender($newGender)
@@ -519,7 +519,7 @@
public function getSmoker()
{
- return $this->$this->smoker;
+ return $this->smoker;
}
public function setSmoker($newSmoker)
Re: svn commit: r656481 - in /incubator/shindig/trunk: config/
javascript/samplecontainer/examples/ php/ php/src/gadgets/
php/src/gadgets/http/ php/src/socialdata/opensocial/model/
Posted by Cassie <do...@apache.org>.
nm. chris already fixed this. i'll blame the early hour for reading my
email out of order...
On Thu, May 15, 2008 at 6:58 AM, Cassie <do...@apache.org> wrote:
> On Thu, May 15, 2008 at 2:58 AM, <ch...@apache.org> wrote:
>> Author: chabotc
>> Date: Wed May 14 17:58:46 2008
>> New Revision: 656481
>>
>> URL: http://svn.apache.org/viewvc?rev=656481&view=rev
>> Log:
>> - Made style in gadget configurable to allow a bit more layout flexibility
>> - Switched default view from 'default' to 'profile'. Combined with using the container.js alias values this creates a more robust situation
>> - Fixed a few typos and small bugs
>>
>> Modified:
>> incubator/shindig/trunk/config/container.js
>> incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
>> incubator/shindig/trunk/php/config.php
>> incubator/shindig/trunk/php/src/gadgets/Gadget.php
>> incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
>> incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
>> incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
>> incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
>> incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
>>
>> Modified: incubator/shindig/trunk/config/container.js
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/config/container.js?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/config/container.js (original)
>> +++ incubator/shindig/trunk/config/container.js Wed May 14 17:58:46 2008
>> @@ -100,7 +100,7 @@
>> "domain" : "shindig",
>> "enableCaja" : true,
>> "supportedFields" : {
>> - "person" : ["id", "name", "thumbnailUrl", "profileUrl"],
>> + "person" : ["id", "name", "thumbnailUrl", "profileUrl", "gender", "aboutMe", "drinker", "smoker", "relationshipStatus"],
>> "activity" : ["id", "title"]
>> },
>> // If true, the restful wire format will be used.
>>
>> Modified: incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml (original)
>> +++ incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml Wed May 14 17:58:46 2008
>> @@ -128,6 +128,7 @@
>> viewer = dataResponse.get('viewer').getData();
>> }
>> activities = dataResponse.get('viewerActivities').getData()['activities'].asArray();
>> + console.log(dataResponse.get('activities').getData());
>
> you'll want to revert this one :)
>
>> activities = activities.concat(dataResponse.get('activities').getData()['activities'].asArray());
>> document.getElementById('stream').style.display = 'block';
>>
>>
>> Modified: incubator/shindig/trunk/php/config.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/config.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/config.php (original)
>> +++ incubator/shindig/trunk/php/config.php Wed May 14 17:58:46 2008
>> @@ -20,6 +20,10 @@
>> 'token_cipher_key' => 'INSECURE_DEFAULT_KEY',
>> 'token_hmac_key' => 'INSECURE_DEFAULT_KEY',
>>
>> + // Configurable CSS rules that are injected to the gadget page,
>> + // be careful when adjusting these not to break most gadget's layouts :)
>> + 'gadget_css' => 'body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}',
>> +
>> // The html / javascript samples use a plain text demo token,
>> // set this to false on anything resembling a real site
>> 'allow_plaintext_token' => true,
>>
>> Modified: incubator/shindig/trunk/php/src/gadgets/Gadget.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/Gadget.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/gadgets/Gadget.php (original)
>> +++ incubator/shindig/trunk/php/src/gadgets/Gadget.php Wed May 14 17:58:46 2008
>> @@ -293,7 +293,12 @@
>>
>> public function getView($viewName)
>> {
>> - return isset($this->views[$viewName]) ? $this->views[$viewName] : $this->views[DEFAULT_VIEW];
>> + if (isset($this->views[$viewName])) {
>> + return $this->views[$viewName];
>> + } elseif (isset($this->views[DEFAULT_VIEW])) {
>> + return $this->views[DEFAULT_VIEW];
>> + }
>> + throw new GadgetException("Invalid view specified for this gadget");
>> }
>> }
>>
>>
>> Modified: incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetContext.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/gadgets/GadgetContext.php (original)
>> +++ incubator/shindig/trunk/php/src/gadgets/GadgetContext.php Wed May 14 17:58:46 2008
>> @@ -18,7 +18,7 @@
>> *
>> */
>>
>> -define('DEFAULT_VIEW', 'default');
>> +define('DEFAULT_VIEW', 'profile');
>>
>> /*
>> * GadgetContext contains all contextual variables and classes that are relevant for this request,
>>
>> Modified: incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php (original)
>> +++ incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php Wed May 14 17:58:46 2008
>> @@ -125,10 +125,10 @@
>> if (isset($pref->EnumValue)) {
>> foreach ($pref->EnumValue as $enum) {
>> $attr = $enum->attributes();
>> - // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error
>> - if (empty($attr['value'])) {
>> + // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error?
>> + /*if (empty($attr['value'])) {
>> throw new SpecParserException("EnumValue must have a value field.");
>> - }
>> + }*/
>> $valueText = trim($attr['value']);
>> $displayText = ! empty($attr['display_value']) ? trim($attr['display_value']) : $valueText;
>> $preference->enumValues[$valueText] = $displayText;
>>
>> Modified: incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php (original)
>> +++ incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php Wed May 14 17:58:46 2008
>> @@ -150,7 +150,7 @@
>> echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
>> }
>> echo "<html>\n<head>".
>> - "<style type=\"text/css\">body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}</style>".
>> + "<style type=\"text/css\">".Config::get('gadget_css')."</style>".
>> "</head><body>".
>> "<script><!--\n";
>> foreach ( $gadget->getJsLibraries() as $library ) {
>>
>> Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php (original)
>> +++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php Wed May 14 17:58:46 2008
>> @@ -28,17 +28,18 @@
>>
>> abstract class Enum {
>> public $displayValue;
>> - private $jsonString;
>> + public $key;
>> public $values = array();
>>
>> - public function __construct($jsonString, $displayValue)
>> + public function __construct($key, $displayValue = '')
>> {
>> //FIXME should add enum restriction checking to this
>> - if (!isset($this->values[$jsonString])) {
>> + if (!isset($this->values[$key])) {
>> throw new Exception("Invalid Enum key");
>> }
>> - $this->jsonString = $jsonString;
>> - $this->displayValue = $displayValue;
>> + $this->key = $key;
>> + $this->displayValue = !empty($displayValue) ? $displayValue : $this->values[$key];
>> + unset($this->values);
>> }
>>
>> public function getDisplayValue()
>>
>> Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
>> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php?rev=656481&r1=656480&r2=656481&view=diff
>> ==============================================================================
>> --- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php (original)
>> +++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php Wed May 14 17:58:46 2008
>> @@ -239,7 +239,7 @@
>>
>> public function getGender()
>> {
>> - return $this->$this->gender;
>> + return $this->gender;
>> }
>>
>> public function setGender($newGender)
>> @@ -519,7 +519,7 @@
>>
>> public function getSmoker()
>> {
>> - return $this->$this->smoker;
>> + return $this->smoker;
>> }
>>
>> public function setSmoker($newSmoker)
>>
>>
>>
>
Re: svn commit: r656481 - in /incubator/shindig/trunk: config/
javascript/samplecontainer/examples/ php/ php/src/gadgets/
php/src/gadgets/http/ php/src/socialdata/opensocial/model/
Posted by Cassie <do...@apache.org>.
On Thu, May 15, 2008 at 2:58 AM, <ch...@apache.org> wrote:
> Author: chabotc
> Date: Wed May 14 17:58:46 2008
> New Revision: 656481
>
> URL: http://svn.apache.org/viewvc?rev=656481&view=rev
> Log:
> - Made style in gadget configurable to allow a bit more layout flexibility
> - Switched default view from 'default' to 'profile'. Combined with using the container.js alias values this creates a more robust situation
> - Fixed a few typos and small bugs
>
> Modified:
> incubator/shindig/trunk/config/container.js
> incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
> incubator/shindig/trunk/php/config.php
> incubator/shindig/trunk/php/src/gadgets/Gadget.php
> incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
> incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
> incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
> incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
> incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
>
> Modified: incubator/shindig/trunk/config/container.js
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/config/container.js?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/config/container.js (original)
> +++ incubator/shindig/trunk/config/container.js Wed May 14 17:58:46 2008
> @@ -100,7 +100,7 @@
> "domain" : "shindig",
> "enableCaja" : true,
> "supportedFields" : {
> - "person" : ["id", "name", "thumbnailUrl", "profileUrl"],
> + "person" : ["id", "name", "thumbnailUrl", "profileUrl", "gender", "aboutMe", "drinker", "smoker", "relationshipStatus"],
> "activity" : ["id", "title"]
> },
> // If true, the restful wire format will be used.
>
> Modified: incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml (original)
> +++ incubator/shindig/trunk/javascript/samplecontainer/examples/SocialActivitiesWorld.xml Wed May 14 17:58:46 2008
> @@ -128,6 +128,7 @@
> viewer = dataResponse.get('viewer').getData();
> }
> activities = dataResponse.get('viewerActivities').getData()['activities'].asArray();
> + console.log(dataResponse.get('activities').getData());
you'll want to revert this one :)
> activities = activities.concat(dataResponse.get('activities').getData()['activities'].asArray());
> document.getElementById('stream').style.display = 'block';
>
>
> Modified: incubator/shindig/trunk/php/config.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/config.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/config.php (original)
> +++ incubator/shindig/trunk/php/config.php Wed May 14 17:58:46 2008
> @@ -20,6 +20,10 @@
> 'token_cipher_key' => 'INSECURE_DEFAULT_KEY',
> 'token_hmac_key' => 'INSECURE_DEFAULT_KEY',
>
> + // Configurable CSS rules that are injected to the gadget page,
> + // be careful when adjusting these not to break most gadget's layouts :)
> + 'gadget_css' => 'body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}',
> +
> // The html / javascript samples use a plain text demo token,
> // set this to false on anything resembling a real site
> 'allow_plaintext_token' => true,
>
> Modified: incubator/shindig/trunk/php/src/gadgets/Gadget.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/Gadget.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/gadgets/Gadget.php (original)
> +++ incubator/shindig/trunk/php/src/gadgets/Gadget.php Wed May 14 17:58:46 2008
> @@ -293,7 +293,12 @@
>
> public function getView($viewName)
> {
> - return isset($this->views[$viewName]) ? $this->views[$viewName] : $this->views[DEFAULT_VIEW];
> + if (isset($this->views[$viewName])) {
> + return $this->views[$viewName];
> + } elseif (isset($this->views[DEFAULT_VIEW])) {
> + return $this->views[DEFAULT_VIEW];
> + }
> + throw new GadgetException("Invalid view specified for this gadget");
> }
> }
>
>
> Modified: incubator/shindig/trunk/php/src/gadgets/GadgetContext.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetContext.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/gadgets/GadgetContext.php (original)
> +++ incubator/shindig/trunk/php/src/gadgets/GadgetContext.php Wed May 14 17:58:46 2008
> @@ -18,7 +18,7 @@
> *
> */
>
> -define('DEFAULT_VIEW', 'default');
> +define('DEFAULT_VIEW', 'profile');
>
> /*
> * GadgetContext contains all contextual variables and classes that are relevant for this request,
>
> Modified: incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php (original)
> +++ incubator/shindig/trunk/php/src/gadgets/GadgetSpecParser.php Wed May 14 17:58:46 2008
> @@ -125,10 +125,10 @@
> if (isset($pref->EnumValue)) {
> foreach ($pref->EnumValue as $enum) {
> $attr = $enum->attributes();
> - // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error
> - if (empty($attr['value'])) {
> + // java based shindig doesn't throw an exception here, but it -is- invalid and should trigger a parse error?
> + /*if (empty($attr['value'])) {
> throw new SpecParserException("EnumValue must have a value field.");
> - }
> + }*/
> $valueText = trim($attr['value']);
> $displayText = ! empty($attr['display_value']) ? trim($attr['display_value']) : $valueText;
> $preference->enumValues[$valueText] = $displayText;
>
> Modified: incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php (original)
> +++ incubator/shindig/trunk/php/src/gadgets/http/GadgetRenderingServlet.php Wed May 14 17:58:46 2008
> @@ -150,7 +150,7 @@
> echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
> }
> echo "<html>\n<head>".
> - "<style type=\"text/css\">body,td,div,span,p{font-family:arial,sans-serif;} a {color:#0000cc;}a:visited {color:#551a8b;}a:active {color:#ff0000;}body{margin: 0px;padding: 0px;background-color:white;}</style>".
> + "<style type=\"text/css\">".Config::get('gadget_css')."</style>".
> "</head><body>".
> "<script><!--\n";
> foreach ( $gadget->getJsLibraries() as $library ) {
>
> Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php (original)
> +++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Enum.php Wed May 14 17:58:46 2008
> @@ -28,17 +28,18 @@
>
> abstract class Enum {
> public $displayValue;
> - private $jsonString;
> + public $key;
> public $values = array();
>
> - public function __construct($jsonString, $displayValue)
> + public function __construct($key, $displayValue = '')
> {
> //FIXME should add enum restriction checking to this
> - if (!isset($this->values[$jsonString])) {
> + if (!isset($this->values[$key])) {
> throw new Exception("Invalid Enum key");
> }
> - $this->jsonString = $jsonString;
> - $this->displayValue = $displayValue;
> + $this->key = $key;
> + $this->displayValue = !empty($displayValue) ? $displayValue : $this->values[$key];
> + unset($this->values);
> }
>
> public function getDisplayValue()
>
> Modified: incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php
> URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php?rev=656481&r1=656480&r2=656481&view=diff
> ==============================================================================
> --- incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php (original)
> +++ incubator/shindig/trunk/php/src/socialdata/opensocial/model/Person.php Wed May 14 17:58:46 2008
> @@ -239,7 +239,7 @@
>
> public function getGender()
> {
> - return $this->$this->gender;
> + return $this->gender;
> }
>
> public function setGender($newGender)
> @@ -519,7 +519,7 @@
>
> public function getSmoker()
> {
> - return $this->$this->smoker;
> + return $this->smoker;
> }
>
> public function setSmoker($newSmoker)
>
>
>