$defaultColor) { if (!isset($_GET[$paramName])) { $c = new Color($defaultColor); } else { try { $c = new Color($_GET[$paramName]); } catch (Exception $e) { $myCrowdfunding->decease(sprintf($e->getMessage(), $paramName)); } } $colorsHex[$paramName] = '#' . $c->getHex(); } /* ===== Set dimensions ================================================== */ $iconSize = 25; $qrCodeSize = 111; $qrCodeSpaceAround = 32; $logoSize = 150; $progressbarBorderSize = 1; $svgBorderSize = 1; /* ===== Set dimensions : height and Y positionning ======================= */ $verticalSpacing = 20; $progressbarHeight = 25; $progressbarContainerHeight = $progressbarHeight + 2*$progressbarBorderSize; $originY = 4*$svgBorderSize + $verticalSpacing; $titlePosY = $originY; $pubkeyPosY = $titlePosY; $pubkeyPosY += $myCrowdfunding->getMustHideTitle() ? 0 : (27 + $verticalSpacing); $progressbarContainerPosY = $pubkeyPosY; $progressbarContainerPosY += $myCrowdfunding->getMustDisplayPubkey() ? (15 + $verticalSpacing) : 0; $progressbarPosY = $progressbarContainerPosY + $progressbarBorderSize; $statsPosY = $progressbarPosY + $progressbarHeight + $verticalSpacing; $statNumberPosY = 0 + $iconSize + $verticalSpacing; $statLabelPosY = $statNumberPosY + 21; $qrCodePosY = $progressbarPosY + $progressbarBorderSize + $progressbarHeight/2- $qrCodeSpaceAround/2; $svgHeight = $statsPosY + $statLabelPosY + 21 + $verticalSpacing; $statsHeight = $svgHeight - $progressbarPosY - $progressbarHeight - $verticalSpacing; if ($myCrowdfunding->getMustDisplayPubkey()){ $svgHeight += 10 + $verticalSpacing; } if (($daysLeft = $myCrowdfunding->getDaysLeft()) AND isset($daysLeft) AND ($daysLeft > 0)) { $colNb = 4; } else { $colNb = 3; } /* ===== Set dimensions : width and X positionning ======================= */ $guttersWidth = 40; $originX = $guttersWidth; $progressbarContainerWidth = 500; $svgWidth = $progressbarContainerWidth + (2 * $guttersWidth); $colWidth = $progressbarContainerWidth / $colNb; $iconX = $colWidth/2 - $iconSize/2; $progressbarWidth = $progressbarContainerWidth * min(1, $myCrowdfunding->getPercentage()/100) - 2*$progressbarBorderSize; if ($myCrowdfunding->getMustDisplayQRCode()) { $svgWidth += $qrCodeSize + $guttersWidth; $qrCodePosX = $originX + $logoSize + $guttersWidth + $progressbarContainerWidth + $guttersWidth; } if ($myCrowdfunding->hasLogo()) { $svgWidth += $logoSize + $guttersWidth; $originX += $logoSize + $guttersWidth; } /* ===== SVG ====================================================== */ echo ''; // We must display this that way because hasLogo()) { ?> getMustHideTitle()) { ?> getTitle(); ?> getMustDisplayPubkey()) { ?> Pubkey : getPubkey(); ?> getPercentage() > 7) { ?> getPercentage() . '%'; ?> getPercentage() . '%'; ?> getDonorsNb(); ?> getAmountCollected()) . ' ' . $myCrowdfunding->printUnit(); ?> getTarget(), $myCrowdfunding->printUnit()); ?> getDaysLeft(); ?> getMustDisplayQRCode()) { ?>