-
Notifications
You must be signed in to change notification settings - Fork 3
/
exportPhocoaBuilderIntegrationInfo.php
113 lines (104 loc) · 2.96 KB
/
exportPhocoaBuilderIntegrationInfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
require_once('/Users/alanpinstein/dev/sandbox/phocoadev/phocoadev/conf/webapp.conf');
$classesToExport = array(
'WFCheckbox',
'WFCheckboxGroup',
'WFDieselKeyword',
'WFDieselNav',
'WFDynamic',
'WFDynarchMenu',
'WFForm',
'WFHidden',
'WFHTMLArea',
'WFImage',
'WFJumpSelect',
'WFLabel',
'WFLink',
'WFMessageBox',
'WFModuleView',
'WFPaginatorNavigation',
'WFPaginatorPageInfo',
'WFPaginatorSortLink',
'WFPaginatorSortSelect',
'WFPaginatorState',
'WFPassword',
'WFRadio',
'WFRadioGroup',
'WFSelect',
'WFSelectionCheckbox',
'WFSubmit',
'WFTabContent',
'WFTabView',
'WFTextArea',
'WFTextField',
'WFTimeSelect',
'WFUpload',
'WFYAHOO_widget_AutoComplete',
'WFYAHOO_widget_Calendar',
'WFYAHOO_widget_ColorPicker',
'WFYAHOO_widget_Dialog',
'WFYAHOO_widget_Logger',
'WFYAHOO_widget_Menu',
'WFYAHOO_widget_Module',
'WFYAHOO_widget_Overlay',
'WFYAHOO_widget_Panel',
'WFYAHOO_widget_PhocoaDialog',
'WFYAHOO_widget_TabView',
'WFYAHOO_widget_Tab',
'WFYAHOO_widget_TreeView',
'WFYAHOO_widget_Uploader',
'WFYAHOO_widget_YahooScript',
);
$plist = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
';
foreach ($classesToExport as $class) {
$plist .= "<key>$class</key>
<dict>
";
$plist .= "<key>properties</key>\n<dict>\n";
if (is_callable(array($class, 'exposedProperties')))
{
$exposedProperties = call_user_func( array($class, 'exposedProperties') );
// fix integer keys into keys... this allows exposedProperties to return ('myProp' => array(1,2,3), 'myProp2', 'myProp3')
foreach ( array_keys($exposedProperties) as $k ) {
if (gettype($k) == 'integer')
{
$exposedProperties[$exposedProperties[$k]] = NULL;
unset($exposedProperties[$k]);
}
}
foreach ($exposedProperties as $prop => $values) {
$plist .= "<key>{$prop}</key>\n";
if ($values)
{
$plist .= "<array>\n";
foreach ($values as $v) {
$plist .= "<string>{$v}</string>\n";
}
$plist .= "</array>\n";
}
else
{
$plist .= "<array/>\n";
}
}
}
$plist .= "</dict>";
$plist .= "<key>bindings</key>\n<array>\n";
if (is_callable(array($class, 'setupExposedBindings')))
{
$bindings = call_user_func( array($class, 'setupExposedBindings') );
foreach ($bindings as $bo) {
$plist .= "<string>" . $bo->boundProperty() . "</string>\n";
}
}
$plist .= "</array>";
$plist .= "</dict>";
}
$plist .= '
</dict>
</plist>';
file_put_contents('WFViewPhocoaBuilderIntegration.plist', $plist);