コード例 #1
0
 /**
  * Build a social profile object.
  *
  * <code>
  * $options = array(
  *    "social_platform" => "socialcommunity",
  *    "users_ids" => array(1,2,3)
  * );
  *
  * $profilesBuilder = new Prism\Integration\Profiles\Builder($options);
  * $profilesBuilder->build();
  *
  * $profiles = $profilesBuilder->getProfiles();
  * </code>
  */
 public function build()
 {
     $type = ArrayHelper::getValue($this->config, 'social_platform');
     $usersIds = ArrayHelper::getValue($this->config, 'users_ids');
     switch ($type) {
         case 'socialcommunity':
             jimport('Socialcommunity.init');
             /** @var  $params Registry */
             $params = \JComponentHelper::getParams('com_socialcommunity');
             $filesystemHelper = new Helper($params);
             $url = $filesystemHelper->getMediaFolderUri();
             $profiles = new Socialcommunity(\JFactory::getDbo());
             $profiles->load(array('user_ids' => $usersIds));
             $profiles->setMediaUrl($url);
             break;
         case 'gravatar':
             $profiles = new Gravatar(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'kunena':
             $profiles = new Kunena(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'jomsocial':
             // Register JomSocial Router
             if (!class_exists('CRoute')) {
                 \JLoader::register('CRoute', JPATH_SITE . '/components/com_community/libraries/core.php');
             }
             $profiles = new JomSocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             // Load language file.
             $lang = \JFactory::getLanguage();
             $lang->load('com_community.country', JPATH_BASE);
             break;
         case 'easysocial':
             $profiles = new EasySocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'easyprofile':
             $profiles = new EasyProfile(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'communitybuilder':
             $profiles = new CommunityBuilder(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         default:
             $profiles = null;
             break;
     }
     $this->profiles = $profiles;
 }
コード例 #2
0
ファイル: Builder.php プロジェクト: pashakiz/crowdf
 /**
  * Build a social profile object.
  *
  * <code>
  * $options = array(
  *    "social_platform" => "socialcommunity",
  *    "users_ids" => array(1,2,3)
  * );
  *
  * $profilesBuilder = new Prism\Integration\Profiles\Builder($options);
  * $profilesBuilder->build();
  *
  * $profiles = $profilesBuilder->getProfiles();
  * </code>
  */
 public function build()
 {
     $type = ArrayHelper::getValue($this->config, "social_platform");
     $usersIds = ArrayHelper::getValue($this->config, "users_ids");
     switch ($type) {
         case "socialcommunity":
             jimport("socialcommunity.init");
             /** @var  $params Registry */
             $params = \JComponentHelper::getParams("com_socialcommunity");
             $path = $params->get("images_directory", "/images/profiles");
             $profiles = new SocialCommunity(\JFactory::getDbo());
             $profiles->load($usersIds);
             $profiles->setPath($path);
             break;
         case "gravatar":
             $profiles = new Gravatar(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case "kunena":
             $profiles = new Kunena(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case "jomsocial":
             // Register JomSocial Router
             if (!class_exists("CRoute")) {
                 \JLoader::register("CRoute", JPATH_SITE . "/components/com_community/libraries/core.php");
             }
             $profiles = new JomSocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case "easysocial":
             $profiles = new EasySocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case "easyprofile":
             $profiles = new EasyProfile(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case "communitybuilder":
             $profiles = new CommunityBuilder(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         default:
             $profiles = null;
             break;
     }
     $this->profiles = $profiles;
 }
コード例 #3
0
ファイル: Builder.php プロジェクト: bellodox/PrismLibrary
 /**
  * Build a social profile object.
  *
  * <code>
  * $options = array(
  *    "social_platform" => "socialcommunity",
  *    "users_ids" => array(1,2,3)
  * );
  *
  * $profilesBuilder = new Prism\Integration\Profiles\Builder($options);
  * $profilesBuilder->build();
  *
  * $profiles = $profilesBuilder->getProfiles();
  * </code>
  */
 public function build()
 {
     $type = ArrayHelper::getValue($this->config, 'social_platform');
     $usersIds = ArrayHelper::getValue($this->config, 'users_ids');
     switch ($type) {
         case 'socialcommunity':
             jimport('SocialCommunity.init');
             /** @var  $params Registry */
             $params = \JComponentHelper::getParams('com_socialcommunity');
             $path = $params->get('images_directory', '/images/profiles');
             $profiles = new SocialCommunity(\JFactory::getDbo());
             $profiles->load($usersIds);
             $profiles->setPath($path);
             break;
         case 'gravatar':
             $profiles = new Gravatar(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'kunena':
             $profiles = new Kunena(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'jomsocial':
             // Register JomSocial Router
             if (!class_exists('CRoute')) {
                 \JLoader::register('CRoute', JPATH_SITE . '/components/com_community/libraries/core.php');
             }
             $profiles = new JomSocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'easysocial':
             $profiles = new EasySocial(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'easyprofile':
             $profiles = new EasyProfile(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         case 'communitybuilder':
             $profiles = new CommunityBuilder(\JFactory::getDbo());
             $profiles->load($usersIds);
             break;
         default:
             $profiles = null;
             break;
     }
     $this->profiles = $profiles;
 }
コード例 #4
0
 /**
  * Build a social profile object.
  *
  * <code>
  * $options = new Joomla\Registry\Registry(array(
  *    'platform' => 'socialcommunity',
  *    'user_ids' => array(1,2,3)
  * ));
  *
  * $factory = new Prism\Integration\Profiles\Factory($options);
  * $profile = $factory->create();
  * </code>
  */
 public function create()
 {
     switch ($this->options->get('platform')) {
         case 'socialcommunity':
             jimport('Socialcommunity.init');
             /** @var  $params Registry */
             $params = \JComponentHelper::getParams('com_socialcommunity');
             $filesystemHelper = new Helper($params);
             $url = $filesystemHelper->getMediaFolderUri();
             $profiles = new Socialcommunity(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             $profiles->setMediaUrl($url);
             break;
         case 'gravatar':
             $profiles = new Gravatar(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         case 'kunena':
             $profiles = new Kunena(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         case 'jomsocial':
             // Register JomSocial Router
             if (!class_exists('CRoute')) {
                 \JLoader::register('CRoute', JPATH_SITE . '/components/com_community/libraries/core.php');
             }
             $profiles = new JomSocial(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         case 'easysocial':
             $profiles = new EasySocial(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         case 'easyprofile':
             $profiles = new EasyProfile(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         case 'communitybuilder':
             $profiles = new CommunityBuilder(\JFactory::getDbo());
             $profiles->load($this->options->get('user_ids'));
             break;
         default:
             $profiles = null;
             break;
     }
     return $profiles;
 }