|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Phpsa\Datastore\Ams; |
|
4
|
|
|
use Phpsa\Datastore\Asset; |
|
5
|
|
|
|
|
6
|
|
|
use Phpsa\Datastore\Ams\Article\ItemAsset; |
|
7
|
|
|
use Phpsa\Datastore\Ams\ContentAsset; |
|
8
|
|
|
class TestAsset extends Asset { |
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
public $name = 'Test Content'; |
|
12
|
|
|
public $shortname = 'Tests'; |
|
13
|
|
|
|
|
14
|
|
|
//public $children = ContentAsset::class; |
|
15
|
|
|
|
|
16
|
|
|
//public $accept = ItemAsset::class; |
|
17
|
|
|
public $accept_limit = "-1"; |
|
18
|
|
|
|
|
19
|
|
|
public $max_instances = 5; |
|
20
|
|
|
|
|
21
|
|
|
public $private = false; |
|
22
|
|
|
|
|
23
|
|
|
public $meta_description = "this is my default meta descriptoin"; |
|
24
|
|
|
|
|
25
|
|
|
/* |
|
26
|
|
|
@TODO's |
|
27
|
|
|
const AUTOCALLBACKADDER = AutoCallBackAdderAsset::class; // ajax powered autocomplete backed on a callback |
|
28
|
|
|
const AUTOCALLBACK = AutoCallBackAsset::class; // ajax powered autocomplete backed on a callback |
|
29
|
|
|
const AUTOCOMPLETE = AutoCompleteAsset::class; |
|
30
|
|
|
const METATEXT = MetatextAsset::class; |
|
31
|
|
|
const FOLDER = "amsFolderAsset"; |
|
32
|
|
|
*/ |
|
33
|
|
|
|
|
34
|
|
|
// map our value as equal to whatever the title property is set on save. |
|
35
|
|
|
public $value_equals = 'title'; |
|
36
|
|
|
public $properties = array( |
|
37
|
|
|
'title' => array( |
|
38
|
|
|
'name' => 'String', |
|
39
|
|
|
'type' => self::STRING, |
|
40
|
|
|
'required' => false |
|
41
|
|
|
), |
|
42
|
|
|
/*'intro' => array( |
|
43
|
|
|
'name' => 'Text', |
|
44
|
|
|
'type' => self::TEXT |
|
45
|
|
|
), |
|
46
|
|
|
'content' => array( |
|
47
|
|
|
'name' => 'Html', |
|
48
|
|
|
'type' => self::HTML |
|
49
|
|
|
), |
|
50
|
|
|
'status' => array( |
|
51
|
|
|
'name' => 'Dropdown', |
|
52
|
|
|
'type' => self::DROPDOWN, |
|
53
|
|
|
'options' => ['published' => 'Published', 'unpublished' => 'Unpublished'] |
|
54
|
|
|
), |
|
55
|
|
|
'switch' => array( |
|
56
|
|
|
'name' => 'Boolean', |
|
57
|
|
|
'type' => self::BOOL |
|
58
|
|
|
), |
|
59
|
|
|
'file' => array( |
|
60
|
|
|
'name' => 'File', |
|
61
|
|
|
'type' => self::FILE |
|
62
|
|
|
), |
|
63
|
|
|
'image' => array( |
|
64
|
|
|
'name' => 'image', |
|
65
|
|
|
'type' => self::IMG |
|
66
|
|
|
), |
|
67
|
|
|
'identity' => [ |
|
68
|
|
|
'name' => 'Author', |
|
69
|
|
|
'type' => self::IDENTITY |
|
70
|
|
|
], |
|
71
|
|
|
'heading' => [ |
|
72
|
|
|
'name' => 'Heading', |
|
73
|
|
|
'type' => self::HEADING |
|
74
|
|
|
], |
|
75
|
|
|
'subheading' => [ |
|
76
|
|
|
'name' => 'SubHeading', |
|
77
|
|
|
'type' => self::SUBHEADING |
|
78
|
|
|
], |
|
79
|
|
|
'datepicker' => [ |
|
80
|
|
|
'name' => 'Datepicker', |
|
81
|
|
|
'type' => self::DATEPICKER |
|
82
|
|
|
], |
|
83
|
|
|
'autocp' => [ |
|
84
|
|
|
'name' => 'AutoComplete', |
|
85
|
|
|
'type' => self::AUTOCOMPLETE, |
|
86
|
|
|
'callback' => '/admin/ams/autocomplete/identity', |
|
87
|
|
|
'required' => false |
|
88
|
|
|
], |
|
89
|
|
|
'autocp2' => [ |
|
90
|
|
|
'name' => 'AutoComplete - Post', |
|
91
|
|
|
'type' => self::AUTOCOMPLETE, |
|
92
|
|
|
'callback' => ['url'=> '/admin/ams/autocomplete/identity', 'method' => 'post'], |
|
93
|
|
|
'required' => false |
|
94
|
|
|
],*/ |
|
95
|
|
|
'autoCallback' => [ |
|
96
|
|
|
'name' => 'AutoCallBack', |
|
97
|
|
|
'type' => self::AUTOCALLBACK, |
|
98
|
|
|
'options' => [ |
|
99
|
|
|
'checkbox' => 'Checkbox', 'radio' => 'Radio', 'textarea' => 'TextArea', 'textfield' => 'textField', |
|
100
|
|
|
], |
|
101
|
|
|
'callback' => ['url' => '/admin/ams/gettypedata'] // holds the callback route components |
|
102
|
|
|
], |
|
103
|
|
|
'autoCallbackAd' => [ |
|
104
|
|
|
'name' => 'AutoCallBackAdd', |
|
105
|
|
|
'type' => self::AUTOCALLBACKADDER, |
|
106
|
|
|
'options' => [ |
|
107
|
|
|
'checkbox' => 'Checkbox', 'radio' => 'Radio', 'textarea' => 'TextArea', 'textfield' => 'textField', |
|
108
|
|
|
], |
|
109
|
|
|
'callback' => ['url' => '/admin/ams/gettypedata'], // holds the callback route components |
|
110
|
|
|
] |
|
111
|
|
|
); |
|
112
|
|
|
|
|
113
|
|
|
public static function about() { |
|
114
|
|
|
return 'This asset is a collection of content items to build tabs / accordions etc.'; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
} |
|
118
|
|
|
|