1 |
<?php |
2 |
|
3 |
/** |
4 |
* This file contains the phpHtmlLib::controller::WebMVC class, |
5 |
* which inherits from the DesignPattern::MVC class. |
6 |
* |
7 |
* @author Andreas Motl <andreas.motl@ilo.de> |
8 |
* @package org.netfrag.glib |
9 |
* @name Site::WebAppMVC |
10 |
* @uses DesignPattern::MVC |
11 |
* |
12 |
*/ |
13 |
|
14 |
/** |
15 |
* <b>Cvs-Log:</b> |
16 |
* |
17 |
* <pre> |
18 |
* $Id: WebAppMVC.php,v 1.4 2003/03/11 01:22:27 joko Exp $ |
19 |
* |
20 |
* $Log: WebAppMVC.php,v $ |
21 |
* Revision 1.4 2003/03/11 01:22:27 joko |
22 |
* + fixed metadata for phpDocumentor |
23 |
* |
24 |
* Revision 1.3 2003/03/05 18:54:45 joko |
25 |
* updated docu - phpDocumentor is very strict about its 'blocks'... |
26 |
* |
27 |
* Revision 1.2 2003/03/05 16:10:20 joko |
28 |
* updated docu (phpDocumentor testing....) |
29 |
* |
30 |
* Revision 1.1 2003/03/03 22:08:43 joko |
31 |
* refactored from com.newsblob.phphtmllib/controller/WebMVC.inc |
32 |
* |
33 |
* Revision 1.3 2003/03/01 22:43:56 joko |
34 |
* propagating options properly |
35 |
* |
36 |
* Revision 1.2 2003/03/01 21:19:02 joko |
37 |
* now actually does something via '->handle' |
38 |
* established static component registry here |
39 |
* |
40 |
* Revision 1.1 2003/03/01 17:02:09 joko |
41 |
* + initial commit, inheriting from DesignPattern::MVC |
42 |
* </pre> |
43 |
* |
44 |
*/ |
45 |
|
46 |
|
47 |
loadModule('DesignPattern::MVC'); |
48 |
|
49 |
|
50 |
/** |
51 |
* This tries to implement some parts of the MVC Pattern |
52 |
* suitable to work together with phpHtmlLib or maybe |
53 |
* another Web-Framework written in php. |
54 |
* |
55 |
* |
56 |
* @author Andreas Motl <andreas.motl@ilo.de> |
57 |
* @copyright (c) 2003 - All Rights reserved. |
58 |
* @license GNU LGPL (GNU Lesser General Public License) |
59 |
* |
60 |
* @link http://www.netfrag.org/~joko/ |
61 |
* @link http://www.gnu.org/licenses/lgpl.txt |
62 |
* |
63 |
* @package org.netfrag.glib |
64 |
* @subpackage Site |
65 |
* @name Site::WebAppMVC |
66 |
* @uses DesignPattern::MVC |
67 |
* |
68 |
*/ |
69 |
class Site_WebAppMVC extends DesignPattern_MVC { |
70 |
|
71 |
|
72 |
/** |
73 |
* The constructor ... |
74 |
* ... just does nothing again. |
75 |
* |
76 |
* @param registry |
77 |
*/ |
78 |
function Site_WebAppMVC() { |
79 |
parent::constructor(); |
80 |
// new!!! user_setup (like phpHtmlLib... coming closer...) |
81 |
$this->user_setup(); |
82 |
} |
83 |
|
84 |
function user_setup() { |
85 |
$this->_abstract_method('user_setup'); |
86 |
} |
87 |
|
88 |
function handle() { |
89 |
|
90 |
// trace |
91 |
//print "MVC - performed result: " . Dumper($this->_performed_result); |
92 |
//exit; |
93 |
|
94 |
if ($this->check_performed_result()) { |
95 |
// encapsulation here - no passthrough!!! |
96 |
$result = array( |
97 |
'view' => $this->_performed_result[view], |
98 |
'options' => $this->_performed_result[options], |
99 |
); |
100 |
return $result; |
101 |
} |
102 |
|
103 |
} |
104 |
|
105 |
|
106 |
function &getStaticRegistryDatabase() { |
107 |
$registry = array ( |
108 |
'123435-54554-435435-435345' => array( |
109 |
'name' => 'Page::Overview', |
110 |
'version' => null, |
111 |
), |
112 |
'456-54554-435435-435345' => array( |
113 |
'name' => 'Page::Jobs', |
114 |
'version' => null, |
115 |
), |
116 |
'678-54554-435435-435345' => array( |
117 |
'name' => 'Page::DataBrowser', |
118 |
'version' => null, |
119 |
), |
120 |
'555-54554-435435-435345' => array( |
121 |
'name' => 'Page::NavigationHistory', |
122 |
'version' => null, |
123 |
), |
124 |
); |
125 |
return $registry; |
126 |
} |
127 |
|
128 |
|
129 |
|
130 |
/* |
131 |
function add_model() { |
132 |
$this->_abstract_method('add_model'); |
133 |
} |
134 |
|
135 |
function add_view() { |
136 |
$this->_abstract_method('add_view'); |
137 |
} |
138 |
|
139 |
function add_controller() { |
140 |
$this->_abstract_method('add_controller'); |
141 |
} |
142 |
|
143 |
function setup_views() { |
144 |
$this->_abstract_method('setup_views'); |
145 |
} |
146 |
*/ |
147 |
|
148 |
} |
149 |
|
150 |
?> |