|
@@ -69,7 +69,7 @@ discard block |
|
|
block discarded – undo |
|
69
|
69
|
$mainTab->setTitle(_t('SiteTree.TABMAIN', 'Main')); |
|
70
|
70
|
|
|
71
|
71
|
// human readable title |
|
72
|
|
- $fields->addFieldToTab('Root.Main', new TextField('Title', |
|
|
72
|
+ $fields->addFieldToTab('Root.Main', new TextField('Title', |
|
73
|
73
|
'Human readable title for the advert')); |
|
74
|
74
|
|
|
75
|
75
|
// a Javascript toggle on this field displays either the adbroker text field, or an image with URL |
|
@@ -89,10 +89,10 @@ discard block |
|
|
block discarded – undo |
|
89
|
89
|
} |
|
90
|
90
|
|
|
91
|
91
|
// quick tags, faster than the grid editor - these are processed prior to save to create/assign tags |
|
92
|
|
- $fields->addFieldToTab('Root.Main', new TextField('WebsiteLink', |
|
|
92
|
+ $fields->addFieldToTab('Root.Main', new TextField('WebsiteLink', |
|
93
|
93
|
'The URL that will be shown when the advert image is clicked')); |
|
94
|
94
|
|
|
95
|
|
- $fields->addFieldToTab('Root.Main', new TextareaField('AdbrokerJavascript', |
|
|
95
|
+ $fields->addFieldToTab('Root.Main', new TextareaField('AdbrokerJavascript', |
|
96
|
96
|
'JavaScript provided by the adbroker')); |
|
97
|
97
|
|
|
98
|
98
|
$fields->addFieldToTab('Root.Main', $sdf = new DateField('StartDate', 'The date the advert becomes active')); |
|
@@ -103,7 +103,7 @@ discard block |
|
|
block discarded – undo |
|
103
|
103
|
$categoryfield = new DropdownField('AdvertCategoryID', 'Category', AdvertCategory::get()->sort('Title')->map('ID', 'Title')); |
|
104
|
104
|
$categoryfield->setEmptyString('-- Select one --'); |
|
105
|
105
|
$mapping = AdvertLayoutType::get()->sort('Title')->map('ID', 'Title')->toArray(); |
|
106
|
|
- error_log(print_r($mapping,1)); |
|
|
106
|
+ error_log(print_r($mapping, 1)); |
|
107
|
107
|
$layoutfield = new DropdownField('AdvertLayoutTypeID', 'Layout Type', $mapping); |
|
108
|
108
|
$layoutfield->setEmptyString('-- Select one --'); |
|
109
|
109
|
|
|
@@ -129,8 +129,8 @@ discard block |
|
|
block discarded – undo |
|
129
|
129
|
- last edited |
|
130
|
130
|
Otherwise the clickthrough will fail |
|
131
|
131
|
*/ |
|
132
|
|
- $data = $this->ID.'_'.$this->AdvertCategory()->Title.'_'.$this->AdvertLayoutType()->Title.'_'.$this->AdbrokerJavascript; |
|
133
|
|
- $data .= '_'.$this->StartDate.'_'.$this->FinishDate.'_'.$this->ClickThroughs.'_advert'; |
|
|
132
|
+ $data = $this->ID . '_' . $this->AdvertCategory()->Title . '_' . $this->AdvertLayoutType()->Title . '_' . $this->AdbrokerJavascript; |
|
|
133
|
+ $data .= '_' . $this->StartDate . '_' . $this->FinishDate . '_' . $this->ClickThroughs . '_advert'; |
|
134
|
134
|
$hashed = hash('sha512', $data); |
|
135
|
135
|
//error_log("HASH CREATED:".$hashed); |
|
136
|
136
|
return $hashed; |