1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
|
4
|
|
|
class DataObjectSorterRequirements extends Object |
5
|
|
|
{ |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* set to TRUE to add your own Requirements |
9
|
|
|
* |
10
|
|
|
* @var boolean |
11
|
|
|
*/ |
12
|
|
|
private static $popup_link_requirements_have_been_added = false; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* set to TRUE to add your own Requirements |
16
|
|
|
* |
17
|
|
|
* @var boolean |
18
|
|
|
*/ |
19
|
|
|
private static $popup_requirements_have_been_added = false; |
20
|
|
|
/** |
21
|
|
|
* set to TRUE to add your own Requirements |
22
|
|
|
* |
23
|
|
|
* @var boolean |
24
|
|
|
*/ |
25
|
|
|
private static $run_through_theme = false; |
26
|
|
|
|
27
|
|
|
public static function popup_link_requirements() |
28
|
|
|
{ |
29
|
|
|
$done = Config::inst()->get('DataObjectSorterRequirements', 'popup_link_requirements_have_been_added'); |
30
|
|
|
$isCMS = Config::inst()->get('SSViewer', 'theme_enabled') ? false : true; |
31
|
|
|
if ($done || $isCMS) { |
32
|
|
|
//do nothing |
33
|
|
|
} else { |
34
|
|
|
Config::inst()->update('DataObjectSorterRequirements', 'popup_link_requirements_have_been_added', true); |
35
|
|
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); |
36
|
|
|
Requirements::javascript('dataobjectsorter/javascript/jquery.simplemodal-1.4.4.js'); |
37
|
|
|
Requirements::javascript('dataobjectsorter/javascript/modalpopup.js'); |
38
|
|
|
Requirements::themedCSS('modalpopup', 'dataobjectsorter'); |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* |
44
|
|
|
* |
45
|
|
|
* @param string $type - one of the following: onefieldonerecord, onefield, onerecord, sorter |
46
|
|
|
* @return [type] [description] |
|
|
|
|
47
|
|
|
*/ |
48
|
|
|
public static function popup_requirements($type) |
49
|
|
|
{ |
50
|
|
|
if (! Config::inst()->get('DataObjectSorterRequirements', 'popup_requirements_have_been_added')) { |
51
|
|
|
Config::inst()->update('DataObjectSorterRequirements', 'popup_requirements_have_been_added', true); |
52
|
|
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); |
53
|
|
|
Requirements::themedCSS('sorter', 'dataobjectsorter'); |
54
|
|
|
$type = strtolower($type); |
55
|
|
|
switch ($type) { |
56
|
|
|
case "onefieldonerecord": |
57
|
|
|
Requirements::themedCSS('onefieldonerecord', 'dataobjectsorter'); |
58
|
|
|
Requirements::javascript('dataobjectsorter/javascript/onefieldonerecord.js'); |
59
|
|
|
break; |
60
|
|
|
case "onefield": |
61
|
|
|
Requirements::themedCSS('onefield', 'dataobjectsorter'); |
62
|
|
|
Requirements::javascript('dataobjectsorter/javascript/onefield.js'); |
63
|
|
|
break; |
64
|
|
|
case "onerecord": |
65
|
|
|
Requirements::themedCSS('onerecord', 'dataobjectsorter'); |
66
|
|
|
Requirements::javascript('dataobjectsorter/javascript/onerecord.js'); |
67
|
|
|
break; |
68
|
|
|
case "sorter": |
69
|
|
|
Requirements::javascript('dataobjectsorter/javascript/jquery-ui-1.9.1.custom.min.js'); |
70
|
|
|
Requirements::javascript('dataobjectsorter/javascript/sorter.js'); |
71
|
|
|
break; |
72
|
|
|
default: |
73
|
|
|
user_error("type $type is not a valid option"); |
74
|
|
|
} |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.