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