Esempio n. 1
0
 /**
  * Loads the social twitter accounts into a static variable
  *
  * @return void
  */
 static function get_social_accounts()
 {
     $social_twitter = Social::instance()->service('twitter');
     // If we don't have a Social_Twitter object, get out
     if (is_null($social_twitter)) {
         return;
     }
     // If we don't have any Social Twitter accounts, get out
     $social_accounts = $social_twitter->accounts();
     if (empty($social_accounts)) {
         return;
     }
     /* Loop over our social twitter accounts and create AKTT_Account objects 
     		that will store the various configuration options for the twitter accounts. */
     foreach ($social_accounts as $obj_id => $acct_obj) {
         // If this account has already been assigned, continue on
         if (isset(self::$accounts[$obj_id]) || !$acct_obj->universal()) {
             continue;
         }
         /* Call a static method to load the object, so we 
         			can ensure it was instantiated properly */
         $o = AKTT_Account::load($acct_obj);
         // Assign the object, only if we were successfully created
         if (is_a($o, 'AKTT_Account')) {
             self::$accounts[$obj_id] = $o;
         }
     }
 }