1 | <?php |
||
24 | class ContentReviewDefaultSettings extends DataExtension |
||
25 | { |
||
26 | /** |
||
27 | * @config |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private static $db = array( |
||
|
|||
32 | 'ReviewPeriodDays' => 'Int', |
||
33 | 'ReviewFrom' => 'Varchar(255)', |
||
34 | 'ReviewSubject' => 'Varchar(255)', |
||
35 | 'ReviewBody' => 'HTMLText', |
||
36 | ); |
||
37 | |||
38 | /** |
||
39 | * @config |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | private static $defaults = array( |
||
44 | 'ReviewSubject' => 'Page(s) are due for content review', |
||
45 | 'ReviewBody' => '<h2>Page(s) due for review</h2><p>There are $PagesCount pages that are due for review today by you.</p>', |
||
46 | ); |
||
47 | |||
48 | /** |
||
49 | * @config |
||
50 | * |
||
51 | * @var array |
||
52 | */ |
||
53 | private static $many_many = array( |
||
54 | 'ContentReviewGroups' => Group::class, |
||
55 | 'ContentReviewUsers' => Member::class, |
||
56 | ); |
||
57 | |||
58 | /** |
||
59 | * Template to use for content review emails. |
||
60 | * |
||
61 | * This should contain an $EmailBody variable as a placeholder for the user-defined copy |
||
62 | * |
||
63 | * @config |
||
64 | * |
||
65 | * @var string |
||
66 | */ |
||
67 | private static $content_review_template = 'SilverStripe\\ContentReview\\ContentReviewEmail'; |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getOwnerNames() |
||
86 | |||
87 | /** |
||
88 | * @return ManyManyList |
||
89 | */ |
||
90 | public function OwnerGroups() |
||
94 | |||
95 | /** |
||
96 | * @return ManyManyList |
||
97 | */ |
||
98 | public function OwnerUsers() |
||
102 | |||
103 | /** |
||
104 | * @param FieldList $fields |
||
105 | */ |
||
106 | public function updateCMSFields(FieldList $fields) |
||
174 | |||
175 | /** |
||
176 | * Get all Members that are default Content Owners. This includes checking group hierarchy |
||
177 | * and adding any direct users. |
||
178 | * |
||
179 | * @return ArrayList |
||
180 | */ |
||
181 | public function ContentReviewOwners() |
||
185 | |||
186 | /** |
||
187 | * Get the review body, falling back to the default if left blank. |
||
188 | * |
||
189 | * @return string HTML text |
||
190 | */ |
||
191 | public function getReviewBody() |
||
195 | |||
196 | /** |
||
197 | * Get the review subject line, falling back to the default if left blank. |
||
198 | * |
||
199 | * @return string plain text value |
||
200 | */ |
||
201 | public function getReviewSubject() |
||
205 | |||
206 | /** |
||
207 | * Get the "from" field for review emails. |
||
208 | * |
||
209 | * @return string |
||
210 | */ |
||
211 | public function getReviewFrom() |
||
221 | |||
222 | /** |
||
223 | * Get the value of a user-configured field, falling back to the default if left blank. |
||
224 | * |
||
225 | * @param string $field |
||
226 | * |
||
227 | * @return string |
||
228 | */ |
||
229 | protected function getWithDefault($field) |
||
241 | } |
||
242 |
This check marks private properties in classes that are never used. Those properties can be removed.