1 | <?php |
||
5 | class ThemeCustomisation extends DataObject { |
||
|
|||
6 | |||
7 | private static $location_for_scss_file = 'themes/main_mysite/src/variables/_themecustomisation.scss'; |
||
8 | |||
9 | private static $singular_name = 'Theme Customisation'; |
||
10 | |||
11 | function i18n_singular_name() |
||
15 | |||
16 | private static $plural_name = 'Theme Customisations'; |
||
17 | |||
18 | function i18n_plural_name() |
||
22 | |||
23 | private static $db = [ |
||
24 | 'BackgroundColour' => 'Color', |
||
25 | 'FontColour' => 'Color', |
||
26 | 'Accent1Colour' => 'Color', |
||
27 | 'Accent2Colour' => 'Color', |
||
28 | 'MenuBarBackgroundColour' => 'Color', |
||
29 | 'LinkColour' => 'Color', |
||
30 | 'ActiveColour' => 'Color', |
||
31 | 'HeaderFont' => 'Varchar(50)', |
||
32 | 'TextFont' => 'Varchar(50)', |
||
33 | 'MonoFont' => 'Varchar(50)' |
||
34 | ]; |
||
35 | |||
36 | private static $has_one = [ |
||
37 | 'LargeLogo' => 'Image', |
||
38 | 'SmallLogo' => 'Image' |
||
39 | ]; |
||
40 | |||
41 | private static $summary_fields = [ |
||
42 | 'LargeLogo.Stripthumbnail' => 'Name' |
||
43 | ]; |
||
44 | |||
45 | private static $field_labels = [ |
||
46 | 'MonoFont' => 'Mono spaced font' |
||
47 | ]; |
||
48 | |||
49 | private static $field_labels_right = [ |
||
50 | 'MonoFont' => 'Font similar to courier with identical width used for each character - great for numbers.' |
||
51 | ]; |
||
52 | |||
53 | |||
54 | public function CMSEditLink() |
||
60 | |||
61 | public function CMSAddLink() |
||
67 | |||
68 | public function getCMSFields() |
||
105 | |||
106 | /** |
||
107 | * exports to variable SCSS file ... |
||
108 | */ |
||
109 | function exportToThemeSCSS() |
||
116 | |||
117 | /** |
||
118 | * stuff to be inserted into head of html |
||
119 | * - custom css |
||
120 | * - link to google fonts ... |
||
121 | */ |
||
122 | function htmlForPageHeader() |
||
132 | |||
133 | function canCreate($member = null) |
||
141 | |||
142 | function canDelete($member = null) |
||
146 | |||
147 | protected function fontFields() |
||
151 | |||
152 | protected function colourFields() |
||
156 | |||
157 | protected function fieldsPerType($name) |
||
167 | |||
168 | } |
||
169 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.