if (!$projectId) { return; } $container = Prism\Container::getContainer(); /** @var $container Joomla\DI\Container */ $containerHelper = new Crowdfunding\Container\Helper(); // Get Project object from the container. $project = $containerHelper->fetchProject($container, $projectId); if (!$project->getId()) { return; } // Get component params $componentParams = JComponentHelper::getParams('com_crowdfunding'); /** @var $componentParams Joomla\Registry\Registry */ $money = $containerHelper->fetchMoneyFormatter($container, $componentParams); $socialPlatform = $componentParams->get('integration_social_platform'); $imageFolder = $componentParams->get('images_directory', 'images/crowdfunding'); $imageWidth = $componentParams->get('image_width', 200); $imageHeight = $componentParams->get('image_height', 200); // Get social platform and a link to the profile $config = new Joomla\Registry\Registry(array('platform' => $socialPlatform, 'user_id' => $project->getUserId())); $socialBuilder = new Prism\Integration\Profile\Factory($config); $socialProfile = $socialBuilder->create(); $socialProfileLink = !$socialProfile ? null : $socialProfile->getLink(); // Get amounts $fundedAmount = $money->setAmount($project->getGoal())->formatCurrency(); $raised = $money->setAmount($project->getFunded())->formatCurrency(); // Prepare the value that I am going to display $fundedPercents = JHtml::_('crowdfunding.funded', $project->getFundedPercent()); $user = JFactory::getUser($project->getUserId()); require JModuleHelper::getLayoutPath('mod_crowdfundingdetails', $params->get('layout', 'default'));
/** * Prepare social profile. * * @param string $platform * @param array|int $userIds * * @return Prism\Integration\Profile\ProfileInterface|Prism\Integration\Profile\ProfileInterface */ public static function prepareIntegration($platform, $userIds) { if (is_array($userIds)) { // Multiple profiles. $options = new \Joomla\Registry\Registry(array('platform' => $platform, 'user_ids' => $userIds)); $profile = new Prism\Integration\Profiles\Factory($options); } else { $options = new \Joomla\Registry\Registry(array('platform' => $platform, 'user_id' => $userIds)); $profile = new Prism\Integration\Profile\Factory($options); } return $profile->create(); }