Exemplo n.º 1
0
 /**
  * @param integer $group_id
  * @param array   $exclude types
  * @param bool    $has_twitter_marketing_tools
  *
  * @return array
  */
 public static function getGroupTokensArray($group_id, $exclude = array(), $has_twitter_marketing_tools = false)
 {
     $tokens = array();
     foreach (self::$types as $type) {
         if (in_array($type, $exclude)) {
             continue;
         }
         $has_configs = count(Available_config::getByTypeAsArray($type)) || $type == 'facebook' ? true : false;
         if ($has_configs && $type == 'twitter') {
             $has_configs = $has_twitter_marketing_tools;
         }
         $tokens_array = Social_group::getAccountByTypeAsArray($group_id, $type);
         foreach ($tokens_array as &$token) {
             $token['has_configs'] = $has_configs;
         }
         if (!empty($tokens_array)) {
             $tokens[$type] = $tokens_array;
         } else {
             $tokens[$type] = array();
         }
     }
     return $tokens;
 }
Exemplo n.º 2
0
 public function postGoogle()
 {
     $this->load->library('Socializer/socializer');
     $google = Socializer::factory('Google', $this->c_user->id, Social_group::getAccountByTypeAsArray($this->profile->id, 'google')[0]);
     $google->post();
 }