1 |
jonen |
1.1 |
<? |
2 |
|
|
/* |
3 |
|
|
## ----------------------------------------------------------------------------- |
4 |
joko |
1.6 |
## $Id: DataItem.php,v 1.5 2003/05/10 18:27:17 jonen Exp $ |
5 |
jonen |
1.1 |
## ----------------------------------------------------------------------------- |
6 |
jonen |
1.2 |
## $Log: DataItem.php,v $ |
7 |
joko |
1.6 |
## Revision 1.5 2003/05/10 18:27:17 jonen |
8 |
|
|
## + supports now mode 'create' via widget 'CreateDataItem' |
9 |
|
|
## |
10 |
jonen |
1.5 |
## Revision 1.4 2003/04/11 00:52:19 joko |
11 |
|
|
## minor update: prepared for being one level more abstract by using $negotiation_options |
12 |
|
|
## |
13 |
joko |
1.4 |
## Revision 1.3 2003/04/10 06:27:36 joko |
14 |
|
|
## ++ _args[mode] == 'delete' => new FlexibleDataItem |
15 |
|
|
## |
16 |
joko |
1.3 |
## Revision 1.2 2003/04/06 01:33:45 jonen |
17 |
|
|
## + purged code |
18 |
|
|
## |
19 |
jonen |
1.2 |
## Revision 1.1 2003/04/04 00:50:44 jonen |
20 |
|
|
## + initial commit |
21 |
|
|
## |
22 |
jonen |
1.1 |
## Revision 1.1 2003/03/01 22:57:23 cvsmax |
23 |
|
|
## + inital commit |
24 |
|
|
## |
25 |
|
|
## |
26 |
|
|
## ----------------------------------------------------------------------------- |
27 |
|
|
*/ |
28 |
|
|
|
29 |
joko |
1.3 |
|
30 |
|
|
loadModule('WebExplorer::Module::AbstractGUIModule'); |
31 |
|
|
|
32 |
jonen |
1.1 |
class WebExplorer_Module_DataItem extends WebExplorer_Module_AbstractGUIModule { |
33 |
|
|
|
34 |
|
|
|
35 |
|
|
function set_gui_object() { |
36 |
joko |
1.6 |
|
37 |
|
|
// NEW [2003-04-22]: inject metadata about chooser (item|list|tree) into _args[options] |
38 |
|
|
// Please visit WebExplorer::Module::DataTree - there is a similar chooser at the top!!! |
39 |
|
|
// TODO: abstract this out into some reusable, generic component sometimes (SimpleChooser?) |
40 |
|
|
$this->_args[options][links] = array( |
41 |
|
|
'list' => array( |
42 |
|
|
array( name => 'item', url => url::view_as('item') ), |
43 |
|
|
array( name => 'tree', url => url::view_as('tree', array( ecdid => $_GET[ecdm] )) ), |
44 |
|
|
//array( name => 'reset filter', url => url::filter('tree') ), |
45 |
|
|
), |
46 |
|
|
'meta' => array( |
47 |
|
|
'selected' => $this->_args[options][data_locator_meta][abstract_type] |
48 |
|
|
) |
49 |
|
|
); |
50 |
|
|
|
51 |
|
|
// debug |
52 |
joko |
1.3 |
//print Dumper($this->_args); |
53 |
joko |
1.6 |
|
54 |
jonen |
1.1 |
if($this->_args['mode'] == 'view') { |
55 |
|
|
$this->_gui_object = new DataItem($this->_args['caption'], $this->_args['options']); |
56 |
|
|
} |
57 |
|
|
elseif($this->_args['mode'] == 'edit') { |
58 |
|
|
$this->_gui_object = new EditDataItem($this->_args['caption'], $this->_args['options'] ); |
59 |
joko |
1.3 |
} |
60 |
|
|
elseif($this->_args['mode'] == 'delete') { |
61 |
|
|
// 'EditDataItem' already has an infrastructure to do "Confirm"ations, |
62 |
|
|
// so we just try to use it here to let the user confirm the new "delete"-action. |
63 |
|
|
|
64 |
|
|
// TODO: |
65 |
|
|
// Try to implement this aspect of the required infrastructure independent of |
66 |
|
|
// an 'EditDataItem'. Maybe it should become a 'GenericNegotiation'-ecom-component?! |
67 |
|
|
// Aim: Abstract way of handling 'Confirm', 'Cancel' actions on arbitrary "question"??? |
68 |
joko |
1.4 |
$negotiation_options = array( |
69 |
|
|
); |
70 |
|
|
|
71 |
|
|
$this->_gui_object = new FlexibleNegotiation($this->_args['caption'], $this->_args['options'], $negotiation_options ); |
72 |
jonen |
1.5 |
} |
73 |
|
|
|
74 |
|
|
elseif($this->_args['mode'] == 'create') { |
75 |
|
|
$this->_gui_object = new CreateDataItem($this->_args['caption'], $this->_args['options'] ); |
76 |
jonen |
1.1 |
} |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
|
80 |
|
|
} |
81 |
|
|
|
82 |
|
|
?> |