Created
May 27, 2015 11:59
-
-
Save anonymous/a8d79770ce92cb4f50dd to your computer and use it in GitHub Desktop.
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
<?php | |
class BusinessDetails extends DataExtension { | |
private static $db = array( | |
'BusinessName' => 'text', | |
'BusinessAddress' => 'text', | |
'BusinessLandPhone' => 'text', | |
'BusinessMobilePhone' => 'text', | |
'BusinessFax' => 'text', | |
'BusinessEmail' => 'text', | |
'BusinessID' => 'int', | |
); | |
private static $has_one = array( | |
"logo_portrait" => "image", | |
"logo_landscape" => "image", | |
"brand_image" => "image", | |
); | |
public function updateCMSFields(FieldList $fields) { | |
$newFields = array( | |
TextField::Create('BusinessName')->setRightTitle('If different from Site Title'), | |
TextField::Create('BusinessAddress'), | |
TextField::Create('BusinessLandPhone'), | |
TextField::Create('BusinessMobilePhone'), | |
TextField::Create('BusinessFax'), | |
EmailField::Create('BusinessEmail'), | |
NumericField::create("BusinessID", 'Business ID (ABN/ACN)'), | |
); | |
$fields->addFieldsToTab("Root.BusinessDetails.GeneralDetails", $newFields); | |
$newFields = array( | |
// UploadField::Create("brand_image"), | |
// UploadField::Create("logo_landscape"), | |
// UploadField::Create("logo_portrait"), | |
UploadField::Create("brand_image", "Brand Image"), | |
UploadField::Create("logo_landscape", "Logo (Landscape)"), | |
UploadField::Create("logo_portrait", "Logo (Portrait)"), | |
); | |
$fields->addFieldsToTab("Root.BusinessDetails.Images", $newFields); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment