00001 <?php
00023 class SPage extends SObject {
00024
00025
00026
00027
00028 protected $metaslot;
00029 protected $slot;
00030 protected $page;
00031
00032 protected $defaults;
00033 protected $targetType;
00034
00043 function __construct ($targetType = '') {
00044
00045 $this->metaslot = array();
00046 $this->slot = array();
00047 $this->page = "";
00048 $this->defaults = array();
00049
00050 $this->targetType = $targetType;
00051
00052
00053 include(dirname(__FILE__) . "/config/SPageConfig.php5");
00054 }
00055
00056
00057
00058
00059
00071 public function setSlot ($index, $input) {
00072
00073 $this->slot[$index] = $input;
00074 }
00075
00084 public function appendToSlot ($index, $input) {
00085
00086 if (!isset($this->slot[$index])){
00087 $this->slot[$index] = "";
00088
00089 }
00090
00091 $this->slot[$index] .= $input;
00092 }
00093
00100 public function getSlot ($index) {
00101 if (!isset($this->slot[$index])) return "";
00102 return $this->slot[$index];
00103 }
00104
00105
00106
00107
00108
00120 public function setMetaSlot ($index, $input) {
00121
00122 $this->metaslot[$index] = $input;
00123 }
00124
00134 public function appendToMetaSlot ($index, $input) {
00135
00136 if (!isset($this->metaslot[$index])){ $this->metaslot[$index] = ""; }
00137
00138 $this->metaslot[$index] .= $input;
00139 }
00140
00147 public function getMetaSlot ($index) {
00148 if (!isset($this->metaslot[$index])) return "";
00149 return $this->metaslot[$index];
00150 }
00151
00152
00153
00154
00155
00165 public function appendSlotToMetaSlot ($slot, $meta) {
00166 if (!isset($this->metaslot[$meta])){ $this->metaslot[$meta] = ""; }
00167 if (isset($this->slot[$slot])){
00168 $this->metaslot[$meta] .= $this->slot[$slot];
00169 }
00170 }
00171
00181 public function frontAppendSlotToMetaSlot ($slot, $meta) {
00182 if (!isset($this->metaslot[$meta])){ $this->metaslot[$meta] = ""; }
00183 if (isset($this->slot[$slot])){
00184 $this->metaslot[$meta] = $this->slot[$slot] . $this->metaslot[$meta];
00185 }
00186 }
00187
00194 public function setMetaSlotToSlot ($meta, $slot) {
00195 if (isset($this->slot[$slot]))
00196 $this->metaslot[$meta] = $this->slot[$slot];
00197 else
00198 $this->metaslot[$meta] = "";
00199 }
00200
00201
00202
00203
00204
00212 public function setPage ($input) {
00213 $this->page = $input;
00214 }
00215
00221 public function appendToPage ($input) {
00222 $this->page .= $input;
00223 }
00224
00230 public function frontAppendToPage ($input) {
00231 $this->page = $input . $this->page;
00232 }
00233
00243 public function appendMetaSlotToPage ($ms) {
00244 if (isset($this->metaslot[$ms])){
00245 $this->page .= $this->metaslot[$ms];}
00246 else { return false; }
00247 }
00248
00254 public function getFormat() {
00255 return $this->getTargetType();
00256 }
00257
00263 public function getTargetType () {
00264 if ($this->targetType != '') return $this->targetType;
00265 return $this->defaults['targetType'];
00266 }
00267
00275 public function getPage () {
00276 return $this->page;
00277 }
00278 }
00279 ?>