1 | <?php |
||
17 | class GlobalAutoLinkSettings extends DataObject{ |
||
18 | |||
19 | public static $enabled = true; |
||
20 | public static $encoding = 'UTF-8'; |
||
21 | |||
22 | private static $db = array( |
||
23 | 'MaxLinksPerPage' => 'INT', |
||
24 | 'ExcludeTags' => 'VARCHAR(255)', |
||
25 | 'IncludeIn' => 'Text', |
||
26 | 'AddTo' => 'Text', |
||
27 | 'CrawlID' => 'VARCHAR(15)' |
||
28 | ); |
||
29 | |||
30 | private static $defaults = array( |
||
31 | 'IncludeIn' => 'Content' |
||
32 | ); |
||
33 | |||
34 | public static $default_create_config = array( |
||
35 | 'MaxLinksPerPage' => 0, |
||
36 | 'ExcludeTags' => 'pre,h1,h2,h3,h4,h5,h6', |
||
37 | 'IncludeIn' => 'Content' |
||
38 | ); |
||
39 | |||
40 | /** |
||
41 | * Return an array of all html tags we'll exclude |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | public function ExcludeTags(){ |
||
48 | |||
49 | /** |
||
50 | * Return an array of where automated links can be created |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | public function IncludeInFields(){ |
||
57 | |||
58 | public function requireDefaultRecords() { |
||
74 | |||
75 | /** |
||
76 | * Create a random CrawlID |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | private function createCrawlID() { |
||
90 | |||
91 | /** |
||
92 | * Returns a list of ClassNames where |
||
93 | * auto links are allowed in |
||
94 | * |
||
95 | * Note: This function tries to cleanup user input |
||
96 | * |
||
97 | * @return array |
||
98 | */ |
||
99 | public function AllowedIn(){ |
||
122 | |||
123 | /** |
||
124 | * Gets the current config |
||
125 | * |
||
126 | * @return \DataObject |
||
127 | * @throws \ValidationException |
||
128 | * @throws null |
||
129 | */ |
||
130 | public static function get_current() { |
||
138 | } |
||
139 |