forked from jastreich/digital-measures-wordpress-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaward.inc.php
64 lines (57 loc) · 1.3 KB
/
award.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @file award.inc.php
* This file contains the award class.
* @author Jeremy Streich
**/
/**
* @class award
* This class represents an award or honor.
**/
class award
{
public $name;
public $org;
public $year;
public $month;
public $day;
/**
* Constructor for the award class
* @param string $name The name of award.
* @param string $org The name of the orginization that bestowed the award.
* @param string $year The year it was awarded.
* @param string $month The month it was awarded.
* @param string $day The day it was awarded.
**/
public function __construct($name,$org,$year = '',$month = '',$day = '')
{
$this->name = trim($name);
$this->org = trim($org);
$this->year = trim($year);
$this->month = trim($month);
$this->day = trim($day);
}
/**
* Display the award.
**/
public function display($limit = 0)
{
$cite = '<div class="award"><span class="name">' . $this->name . '</span> ';
if($this->year)
{
$cite .= '(' . $this->year;
if($this->month)
{
$cite .= ', ' . $this->month;
if($this->day)
{
$cite .= ' ' . $this->day;
}
}
$cite .= ') ';
}
$cite .= '<span class="org">' . $this->org . '</span>.</div>';
return $cite;
}
}
?>