1 |
joko |
1.1 |
<? |
2 |
|
|
/** |
3 |
|
|
* This file contains the abstract MVCPage class. |
4 |
|
|
* It inherits from phpHtmlLib's abstract PageWidget |
5 |
|
|
* class to seamlessly integrate into its render queue. |
6 |
|
|
* |
7 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
8 |
|
|
* @package phpHtmlLib |
9 |
|
|
* @module MVCPage |
10 |
|
|
* |
11 |
|
|
*/ |
12 |
|
|
|
13 |
|
|
/** |
14 |
|
|
* $Id: BaseController.php,v 1.1 2003/03/01 21:11:18 joko Exp $ |
15 |
|
|
* |
16 |
|
|
* $Log: BaseController.php,v $ |
17 |
|
|
* |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
/** |
22 |
|
|
* This class is used to build content |
23 |
|
|
* for an MVC controlled page. It instantiates |
24 |
|
|
* an concrete helper MVC object which does the |
25 |
|
|
* dispatching stuff. (phpHtmlLib::controller::WebMVC, |
26 |
|
|
* inherited from the abstract DesignPattern::MVC) |
27 |
|
|
* |
28 |
|
|
* This class is established here to act as a wrapper |
29 |
|
|
* bringing MVC and phpHtmlLib together. |
30 |
|
|
* |
31 |
|
|
* By now we inherit from the PageWidget, but this has |
32 |
|
|
* to be broken using the ProxyPattern or s.th.l.th. |
33 |
|
|
* I guess we'll have to dispatch to arbitrary concrete |
34 |
|
|
* Page-implementations here in future... |
35 |
|
|
* |
36 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
37 |
|
|
* @package phpHtmlLib |
38 |
|
|
* @module MVCPage |
39 |
|
|
* |
40 |
|
|
*/ |
41 |
|
|
|
42 |
|
|
// TODO: |
43 |
|
|
// x phpHtmlLib::PageWidget-Adapter |
44 |
|
|
// o php-include-file-Adapter |
45 |
|
|
|
46 |
|
|
/** |
47 |
|
|
* Make sure we have the required parent class |
48 |
|
|
*/ |
49 |
|
|
|
50 |
|
|
//class Site_WebPageMVC extends PageWidget { |
51 |
|
|
//loadModule('DesignPattern::MVC'); |
52 |
|
|
//class Site_GenericPage extends DesignPattern_MVC { |
53 |
|
|
|
54 |
|
|
//loadModule('DesignPattern::Proxy'); |
55 |
|
|
loadModule('DesignPattern::TransparentProxy'); |
56 |
|
|
|
57 |
|
|
//class Site_GenericPage extends DesignPattern_Proxy { |
58 |
|
|
class Site_GenericPage extends DesignPattern_TransparentProxy { |
59 |
|
|
|
60 |
|
|
/* |
61 |
|
|
var $_controller_module; |
62 |
|
|
var $_controller; |
63 |
|
|
*/ |
64 |
|
|
|
65 |
|
|
var $_page; |
66 |
|
|
|
67 |
|
|
|
68 |
|
|
function call_handler() { |
69 |
|
|
//print Dumper(func_get_args()); |
70 |
|
|
//print Dumper($this); |
71 |
|
|
//exit; |
72 |
|
|
//$this->make_handler_transparent(); |
73 |
|
|
} |
74 |
|
|
|
75 |
|
|
/* |
76 |
|
|
function render() { |
77 |
|
|
print "render!<br/>"; |
78 |
|
|
} |
79 |
|
|
*/ |
80 |
|
|
|
81 |
|
|
//function MVCPage($title, $render_type = HTML, $ub_view = 'UB_LIST') { |
82 |
|
|
function Site_GenericPage(&$args) { |
83 |
|
|
|
84 |
|
|
//print("<h1>Site::GenericPage!</h1><br/>"); |
85 |
|
|
|
86 |
|
|
if (!$args[adapter]) { |
87 |
|
|
user_error("Please specify adapter in constructor or s.th.l.th."); |
88 |
|
|
//$args[type] = 'Page::Overview'; |
89 |
|
|
return; |
90 |
|
|
} |
91 |
|
|
|
92 |
|
|
// merge args to object attributes |
93 |
|
|
// FIXME!!! |
94 |
|
|
//$this->merge_args($args); |
95 |
|
|
|
96 |
|
|
switch ($args[adapter]) { |
97 |
|
|
case 'phpHtmlLib': |
98 |
|
|
$this->_component_name = 'Site::Adapter::phpHtmlLib::PageWidget'; |
99 |
|
|
$this->_component_options[title] = $args[title]; |
100 |
|
|
break; |
101 |
|
|
case 'php_file': |
102 |
|
|
$this->_component_name = 'Site::Adapter::php::IncludeFile'; |
103 |
|
|
$this->_component_options = $args['block']; |
104 |
|
|
break; |
105 |
|
|
} |
106 |
|
|
|
107 |
|
|
|
108 |
|
|
//parent::constructor(); |
109 |
|
|
//exit; |
110 |
|
|
$this->create_handler(); |
111 |
|
|
$this->make_transparent(); |
112 |
|
|
|
113 |
|
|
//print Dumper($this); |
114 |
|
|
//exit; |
115 |
|
|
|
116 |
|
|
//return $this; |
117 |
|
|
|
118 |
|
|
} |
119 |
|
|
|
120 |
|
|
//switch ($thi |
121 |
|
|
|
122 |
|
|
/* |
123 |
|
|
|
124 |
|
|
// create controller instance |
125 |
|
|
$this->create_controller_instance(); |
126 |
|
|
|
127 |
|
|
// trace |
128 |
|
|
//print Dumper($this->_controller); |
129 |
|
|
//exit; |
130 |
|
|
|
131 |
|
|
// propagate phpHtmlLib page widget arguments: |
132 |
|
|
// - title: The title of the page |
133 |
|
|
// - render_type: An identifier specifying the output type: |
134 |
|
|
// used by now: HTML (possible: WML|SVG, i guess...? XML|DHTML also...?) |
135 |
|
|
$title = $args[title]; |
136 |
|
|
$render_type = $args[render_type]; |
137 |
|
|
$parent = get_parent_class($this); |
138 |
|
|
$this->$parent($title, $render_type); |
139 |
|
|
*/ |
140 |
|
|
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
/* |
144 |
|
|
function create_controller_instance() { |
145 |
|
|
// V1: |
146 |
|
|
//$this->_controller = mkObject('ExplorerController.inc'); |
147 |
|
|
|
148 |
|
|
// V2: |
149 |
|
|
//loadModule('widgets/explorer/modules/ExplorerController', 'inc'); |
150 |
|
|
//$this->_controller = mkObject('ExplorerController'); |
151 |
|
|
|
152 |
|
|
// V3: (now being completely abstract here...) |
153 |
|
|
$this->_controller = mkObject($this->_controller_module); |
154 |
|
|
} |
155 |
|
|
*/ |
156 |
|
|
|
157 |
|
|
} |
158 |
|
|
|
159 |
|
|
?> |