class-campaign-item.php
1.84 KB
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
<?php
class campaignItemClass
{ //define campaignItemClass
/*private CHANGED TO PUBLIC BECAUSE THE PREVIOUS SYSTEM
IS TOO COUPLED TO THE FRONTEND AND WE NEED TO BYPASS IT */ public $item; //Define member variables
function __construct($item)
{
$this->item = $item;
}
public function getItemDate()
{
return $this->item->SentDate;
}
public function getItemName() {
return $this->item->Name;
}
public function getItemURL()
{
return str_replace('http://', 'https://', $this->item->WebVersionURL);
}
public function getItemTextURL() {
return str_replace('http://', 'https://', $this->item->WebVersionTextURL);
}
public function getContent() {
return $this->item->Content;
}
public function displayPerItem()
{
$output = '<tr><td><span class="title"><a href="' . $this->getItemURL() .
'" class="campaign" data-url="' . $this->getItemURL() . '" target="_blank">' . $this->getItemName() . '</a></span></td><td><span class="month">' . date("F", strtotime($this->getItemDate())) . '</span></td><td><span class="year">'.date("Y", strtotime($this->getItemDate())).'</span></td></tr>';
return $output;
}
public function displayNoPop()
{
$url = WP_PLUGIN_URL . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)) . '../';
// $url = '/broker-landing-page/campaign-monitor/';
$output = '<tr><td><span class="title"><a href="' . $url . 'campaignRetriever.php?campaignURL=' . $this->getItemURL() . '" target="_blank">' . $this->getItemName() . '</a></span></td><td><span class="month">' . date("F", strtotime($this->getItemDate())) . '</span></td><td><span class="year">'.date("Y", strtotime($this->getItemDate())).'</span></td></tr>';
return $output;
}
}