4 |
* $Id$ |
* $Id$ |
5 |
* |
* |
6 |
* $Log$ |
* $Log$ |
7 |
|
* Revision 1.3 2003/04/04 01:28:13 jonen |
8 |
|
* + added function to purge unwanted merged vars |
9 |
|
* + handle form submit's now |
10 |
|
* |
11 |
|
* Revision 1.2 2003/03/20 07:54:52 jonen |
12 |
|
* + added docu |
13 |
|
* |
14 |
* Revision 1.1 2003/03/20 03:48:47 jonen |
* Revision 1.1 2003/03/20 03:48:47 jonen |
15 |
* + initial commit |
* + initial commit |
16 |
* |
* |
29 |
* |
* |
30 |
* |
* |
31 |
*/ |
*/ |
32 |
|
|
33 |
|
/** |
34 |
|
* WebExplorer::MVC - this the MVC used by the WebExplorer. |
35 |
|
* Its derived from the 'Site::WebAppMVC' module. |
36 |
|
* |
37 |
|
* @author Sebastian Utz <seut@tunemedia.de> |
38 |
|
* @package org.netfrag.app |
39 |
|
* @name WebExplorer::MVC |
40 |
|
*/ |
41 |
|
|
42 |
loadModule('Site::WebAppMVC'); |
loadModule('Site::WebAppMVC'); |
43 |
|
|
44 |
class WebExplorer_MVC extends Site_WebAppMVC { |
class WebExplorer_MVC extends Site_WebAppMVC { |
68 |
|
|
69 |
$this->add_model( array( |
$this->add_model( array( |
70 |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
71 |
request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_action', 'ecom_data_locator_key', |
request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode', 'ecom_data_locator_key', |
72 |
'ecom_data_ident', 'ecom_data_meta' ), |
'ecom_data_ident', 'ecom_data_meta', 'ecom_form_edit' ), |
73 |
request_arg => array( |
request_arg => array( |
74 |
'ap' => array( query_arg => 'ap' ), |
'ap' => array( query_arg => 'ap' ), |
75 |
'ecom_label' => array( query_arg => 'ecl' ), |
'ecom_label' => array( query_arg => 'ecl' ), |
76 |
'ecom_type' => array( query_arg => 'ect' ), |
'ecom_type' => array( query_arg => 'ect' ), |
77 |
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
78 |
'ecom_action' => array( query_arg => 'ecac' ), |
'ecom_mode' => array( query_arg => 'ecmod' ), |
79 |
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
80 |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
81 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
82 |
|
'ecom_form_edit' => array( query_arg => 'ecfedit' ), |
83 |
), |
), |
84 |
|
|
85 |
/* |
/* |
140 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
141 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
142 |
$page_state = $requestTracker->getPointer(); |
$page_state = $requestTracker->getPointer(); |
143 |
$_out = $page_state[options]; |
$pre_out = $page_state[options]; |
144 |
|
//print Dumper($pre_out); |
145 |
|
// clean-up unwanted variables |
146 |
|
$label = $_in[ecom_label]; |
147 |
|
switch ($_in[ecom_abstract_type]) { |
148 |
|
case "list": |
149 |
|
if($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
150 |
|
break; |
151 |
|
} |
152 |
|
$_out = $pre_out; |
153 |
'), |
'), |
154 |
|
|
155 |
|
|
156 |
// rewrite idents |
// rewrite idents |
157 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
158 |
$idents = array ( ap, ); |
$idents = array ( ap, ); |
166 |
|
|
167 |
// write components variables to out |
// write components variables to out |
168 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
169 |
$vars = array( ecom_type, ecom_abstract_type, ecom_action, ecom_data_locator_key, ecom_data_ident, ecom_data_meta ); |
$vars = array( ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta ); |
170 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
171 |
foreach($vars as $key) { |
foreach($vars as $key) { |
172 |
if($_in[$key]) { |
if($_in[$key]) { |
186 |
nav => array( |
nav => array( |
187 |
ecom_type => "nav", |
ecom_type => "nav", |
188 |
ecom_abstract_type => "list", |
ecom_abstract_type => "list", |
189 |
ecom_action => "nav", |
ecom_mode => "nav", |
190 |
ecom_data_locator_key => "rpc", |
ecom_data_locator_key => "rpc", |
191 |
), |
), |
192 |
); |
); |
195 |
return; |
return; |
196 |
'), |
'), |
197 |
|
|
198 |
|
create_function('&$_in, &$_out', ' |
199 |
|
$label = $_in[ecom_label]; |
200 |
|
if($_in[ecom_form_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; } |
201 |
|
'), |
202 |
/* |
/* |
203 |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
// translate value of argument "action" (olist => list.view, oedit => item.edit) |
204 |
// action dispatcher |
// action dispatcher |