示例#1
0
 /**
  * Prepare social profiles.
  *
  * @param Joomla\Registry\Registry $params
  *
  * @todo Move it to a trait when traits become mass.
  */
 protected function prepareIntegration($params)
 {
     // Get users IDs
     $usersIds = array();
     foreach ($this->comments as $comment) {
         $usersIds[] = $comment->user_id;
     }
     $usersIds[] = $this->item->user_id;
     $usersIds = array_unique($usersIds);
     // Get a social platform for integration
     $socialPlatform = $params->get("integration_social_platform");
     $this->socialProfiles = null;
     $this->avatarsSize = $params->get("integration_avatars_size", 50);
     $this->defaultAvatar = $params->get("integration_avatars_default", "/media/com_crowdfunding/images/no-profile.png");
     // If there is now users, do not continue.
     if (!$usersIds) {
         return;
     }
     // Load the class
     if (!empty($socialPlatform)) {
         jimport("itprism.integrate.profiles");
         $this->socialProfiles = ITPrismIntegrateProfiles::factory($socialPlatform, $usersIds);
     }
 }
示例#2
0
 /**
  * Prepare social profiles
  *
  * @param array     $items
  * @param Joomla\Registry\Registry $params
  *
  * @todo Move it to a trait when traits become mass.
  */
 protected function prepareIntegration($items, $params)
 {
     // Get users IDs
     $usersIds = array();
     foreach ($items as $item) {
         $usersIds[] = $item->user_id;
     }
     $this->socialProfiles = null;
     // If there is now users, do not continue.
     if (!$usersIds) {
         return;
     }
     // Get a social platform for integration
     $socialPlatform = $params->get("integration_social_platform");
     // Load the class
     if (!empty($socialPlatform)) {
         jimport("itprism.integrate.profiles");
         $this->socialProfiles = ITPrismIntegrateProfiles::factory($socialPlatform, $usersIds);
     }
 }
示例#3
0
 /**
  * Prepare social profiles
  *
  * @param array     $usersIds
  * @param Joomla\Registry\Registry $params
  *
  * @todo Move it to a trait when traits become mass.
  */
 protected function prepareIntegration($usersIds, $params)
 {
     $usersIds = array_filter($usersIds);
     // Get a social platform for integration
     $socialPlatform = $params->get("integration_social_platform");
     $this->avatarsSize = $params->get("integration_avatars_size", 50);
     $this->socialProfiles = null;
     $this->defaultAvatar = $params->get("integration_avatars_default", "/media/com_crowdfunding/images/no-profile.png");
     // If there is now users, do not continue.
     if (!$usersIds) {
         return;
     }
     // Load the class
     if (!empty($socialPlatform) or !empty($avatarsService)) {
         jimport("itprism.integrate.profiles");
     }
     // Load the social profiles
     if (!empty($socialPlatform)) {
         $this->socialProfiles = ITPrismIntegrateProfiles::factory($socialPlatform, $usersIds);
     }
 }