Example #1
0
 public function testCreateAndDelete()
 {
     $uid = 9999;
     $nprops = array('name' => 'somenetwork', 'auth_url' => 'someurl', 'login_url' => 'someurl2', 'canvas_url' => 'someurl3', 'web_url' => 'someurl4');
     // TODO: TESTING: If this test fails, it can cause subsequent test failures
     Api_Dao_Network::createNetwork($uid, 'somekey', $nprops);
     $nlist = Api_Dao_Network::getNetworkProperties($uid);
     $this->assertEquals(4, count($nlist));
     $testNetwork = null;
     foreach ($nlist as $net) {
         if ($net['key'] == 'somekey') {
             $testNetwork = $net;
             break;
         }
     }
     $this->assertNotNull($testNetwork, 'Expected to find a network with key somekey');
     $this->assertEquals('somekey', $testNetwork['key']);
     $this->assertEquals('somenetwork', $testNetwork['name']);
     $this->assertEquals('someurl', $testNetwork['auth_url']);
     $this->assertEquals('someurl2', $testNetwork['login_url']);
     $this->assertEquals('someurl3', $testNetwork['canvas_url']);
     $this->assertEquals('someurl4', $testNetwork['web_url']);
     Api_Dao_Network::deleteNetwork('somekey');
     $nlist = Api_Dao_Network::getNetworkProperties($uid);
     $this->assertEquals(3, count($nlist));
 }
Example #2
0
 /**
  * Field map
  *
  * @return unknown
  */
 protected static function initFieldMap()
 {
     if (self::$fieldMap == null) {
         self::$fieldMap = array('key' => 'trust_key', 'name' => 'trust_name', 'auth_url' => 'trust_auth_url', 'login_url' => 'trust_login_url', 'canvas_url' => 'trust_canvas_url', 'web_url' => 'trust_web_url', 'social_url' => 'trust_social_url', 'auth_class' => 'trust_auth_class', 'postmap_url' => 'trust_postmap_url');
         self::$reverseFieldMap = array_flip(self::$fieldMap);
     }
     return self::$fieldMap;
 }
Example #3
0
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 ******************************************************************************/
// print "<pre>";
// print_r($_SERVER);
// print "</pre>";
// require_once("ringside/web/RingsideWebUtils.php");
// require_once("ringside/web/config/RingsideWebConfig.php");
// require_once("ringside/api/clients/RingsideApiClients.php");
//
require_once "ringside/api/dao/Network.php";
//This lines should be move to an include file?
// $client = new RingsideApiClients(RingsideSocialConfig::$apiKey, RingsideSocialConfig::$secretKey);
// $client->setLocalClient(true);
// $uid = $client->require_login();
$networks = Api_Dao_Network::getNetworksPropertiesForUser($this->uid);
//This db call needs to be fixed. It is not filtering by userid!
//$networks = Api_Dao_Network::getNetworksPropertiesForUser($user);
//$numberOfNetworks = count( $networks );
//$resp = $client->api_client->admin_getNetworkProperties(array(), array('name', 'key', 'trust_login_url'));
//Get the url for the widget code for the code generat
$socialWidgetUrl = RingsideApiClientsConfig::$socialUrl . "/widget.php";
$defaultIconUrl = 'http://localhost:8080/web/images/default-app.png';
$ajaxUrl = $this->url_for($controller = "communities", $action = null, $only_path = false);
?>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
        google.load("visualization", "1", {packages:["piechart","barchart","columnchart"]});
    </script>

<h1>Communities (<?php 
Example #4
0
 /**
  * Enter description here...
  *
  * @param unknown_type $uid
  * @param unknown_type $nids
  * @param unknown_type $props
  * @return unknown
  */
 public static function getNetworkProperties($uid, $nids = array(), $props = null)
 {
     return Api_Dao_Network::getNetworkProperties($uid, $nids, $props)->toArray();
 }