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