00001 <?php
00002
00003
00004
00005
00006
00007
00008 class RenderDecoratorBase implements IRenderDecorator {
00009
00010
00011
00012
00013
00014 private $next = null;
00015
00016
00017
00018
00019
00020
00021
00022 public function append($decorator) {
00023 $next = $this->get_next();
00024 if ($next) {
00025 $next->append($decorator);
00026 }
00027 else {
00028 $this->next = $decorator;
00029 }
00030 }
00031
00032
00033
00034
00035
00036
00037 public function get_next() {
00038 return $this->next;
00039 }
00040
00041
00042
00043
00044
00045
00046
00047 public function initialize($page_data) {
00048 $this->initialize_next($page_data);
00049 }
00050
00051
00052
00053
00054
00055
00056
00057 protected function initialize_next($page_data) {
00058 $next = $this->get_next();
00059 if ($next) {
00060 $next->initialize($page_data);
00061 }
00062 }
00063
00064
00065
00066
00067
00068
00069
00070 public function render_content($page_data) {
00071 $this->render_content_next($page_data);
00072 }
00073
00074
00075
00076
00077
00078
00079
00080 protected function render_content_next($page_data) {
00081 $next = $this->get_next();
00082 if ($next) {
00083 $next->render_content($page_data);
00084 }
00085 }
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 public function render_page($page_data, $content_render_decorator, $policy = IView::NONE) {
00096 return $this->render_page_next($page_data, $content_render_decorator, $policy);
00097 }
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 protected function render_page_next($page_data, $content_render_decorator, $policy = IView::NONE) {
00108 $next = $this->get_next();
00109 if ($next) {
00110 return $next->render_page($page_data, $content_render_decorator, $policy);
00111 }
00112 }
00113 }