forked from Toxantron/scrumonline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
// Defintion of a sponsor object. It contains the necessary information | ||
// sponsors need to provide | ||
class Sponsor | ||
{ | ||
// Link url of the sponsor | ||
private $linkURL; | ||
|
||
// URL of the sponsors logo | ||
private $logoURL; | ||
|
||
function __construct($linkURL, $logoURL) | ||
{ | ||
$this->linkURL = $linkURL; | ||
$this->logoURL = $logoURL; | ||
} | ||
|
||
// Render this sponsor instance | ||
public function render() | ||
{ | ||
return "<a href=\"" . $this->linkURL . "\"><img src=\"" . $this->logoURL . "\"></a>"; | ||
} | ||
|
||
public static function renderFooter() | ||
{ | ||
$sponsors = [ | ||
// All sponsors for the footer | ||
//new Sponsor("https://example.com", "https://example.com/logo.png"), | ||
]; | ||
|
||
Sponsor::renderSponsors($sponsors); | ||
} | ||
|
||
public static function renderOthers() | ||
{ | ||
$sponsors = [ | ||
// All sponsors for the sponsors tab | ||
//new Sponsor("https://example.com", "https://example.com/logo.png"), | ||
]; | ||
|
||
Sponsor::renderSponsors($sponsors); | ||
} | ||
|
||
private static function renderSponsors($sponsors) | ||
{ | ||
echo "<div class=\"sponsors\">"; | ||
|
||
foreach($sponsors as $sponsor) | ||
echo $sponsor->render(); | ||
|
||
echo "</div>"; | ||
} | ||
|
||
private static $donors = [ | ||
//"Author" => "Message" | ||
]; | ||
|
||
public static function donorCount() | ||
{ | ||
return sizeof(Sponsor::$donors); | ||
} | ||
|
||
public static function renderDonors() | ||
{ | ||
echo "<div class=\"donors\">"; | ||
|
||
foreach (Sponsor::$donors as $donorName => $message) { | ||
echo "<div><div class=\"message\">\"" . $message ."\"</div><div class=\"donor\">" . $donorName . "</div></div>"; | ||
} | ||
|
||
echo "</div>"; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div> | ||
<h1>Other Sponsors:</h1> | ||
|
||
<?= Sponsor::renderOthers() ?> | ||
</div> | ||
|
||
<div> | ||
<h1>Donors (<?= Sponsor::donorCount() ?> total):</h1> | ||
|
||
<?= Sponsor::renderDonors() ?> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters