Source for file CMS_PHPINC_PAGE.phpclass
Documentation is available at CMS_PHPINC_PAGE.phpclass
* Class file CMS_PHPINC_PAGE.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require_once __OCSP_DEFAULTCONFPATH__.
"cms.conf.phpinc";
require_once dirname(__FILE__
).
_OCSP_DIRSEP_.
"CMS_PAGE_V2.phpclass";
* class to handel PAGES with php code included
* NOTE: if you use a $PREPEND_INC make sure
* it is included by your index.php script by either
* calling inc_prepInc or by calling getHead which
* includes the file if not done before
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version pk-05-06-17 GLOBAL_VALUES added
* @version pk-07-08-25 $pageIncludeOutput Added
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @constant string CLASS_SRC_FILE
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** class vars ------------------------------------------------------ */
/*** class methods --------------------------------------------------- */
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @var string $includeRoot
* @var string $GLOBAL_VALUES
* @var string $PREPEND_INC
* @var string $PROGRAMM_INC
* @var string $APPEND_INC
* @var boolean $prepIncDone
* @since pk-06-07-28 (was used but not defined)
* buffer for the include output
* @var string $pageIncludeOutput
/** -----------------------------------------------------
* getter & setter methods
* returns a array of variables used by the page object
* [FLDCLASS] name of DBMS_FIELD* class
* [CLASSVALS] array of values of [FLDCLASS]
* @global array $OCSP_CONF
$retArr["GLOBAL_VALUES"]=
array(
"FLDCLASS" =>
"DBMS_FIELD_TEXTAREA",
"label" =>
"Globale Variablen",
"toolTip" =>
"Liste von Variablen und Werten werden in \$this->PAGVAR gespeichert",
"addTag" =>
"<br /><span style=\"font-size: 0.8em\">NAME=Wert je Zeile</span>",
"myROShowMode" =>
3 // <pre>
$retArr["PREPEND_INC"]=
array(
"FLDCLASS" =>
"DBMS_FIELD_FILESELECTLIST",
"label" =>
"Prepend Include",
"toolTip" =>
"Include File vor der ersten Ausgabe",
$retArr["PROGRAMM_INC"]=
array(
"FLDCLASS" =>
"DBMS_FIELD_FILESELECTLIST",
"label" =>
"Programm Include",
"toolTip" =>
"Include File im Content Bereich",
"editorUrl" =>
$OCSP_CONF['SYSTEMURL'].
"editors/PHPWebEdit/editor.php"
$retArr["APPEND_INC"]= array(
"FLDCLASS" => "DBMS_FIELD_FILESELECTLIST",
"label" => "Append Include",
"toolTip" => "Include File nach </html>",
"rootDir" => $this->includeRoot,
"defaultDir" => $this->includeRoot."pages/",
/** -----------------------------------------------------
* unset some object vars to not store to the database
* and then calls the parent function
* @param string $gDBIDX GLOBAL ARRAY INDEX OF DB OBJECT
* @param bool $debug SHOW DEBUG INFO
function dbSave($debug=
FALSE) {
return parent::dbSave($debug);
// #########################################
* shows the page in preview mode
function preview($mode=
0,$debug=
FALSE) {
if ($debug) echo
"<p><b>CMS_PHPINC_PAGE::preview($mode,$debug)</b> (".
get_class($this).
")</p>";
if (!is_object($this->myTmpl)) {
if (!($this->loadTemplate($debug))) {
$ERR="TEMPLATE_NOT_FOUND ".$query;
include __OCSP_PHPINCPATH__."io/errors.phpinc";
$this->inc_prepInc($debug); // <pk-04-11-17 />
echo $this->myTmpl->getBodyTag();
echo $this->myTmpl->getHeadLineTag();
echo $this->{$this->colPrevix."HEADER"};
echo $this->getChapter(CHAPTER_SHOWMODE_ALLWAYS_TOP,$debug);
if (!empty($this->PROGRAMM_INC)) {
if (file_exists(__OCSP_PROJECTPATH__.$this->includeRoot.$this->PROGRAMM_INC)) {
if ($debug) echo "<p>Programm Include:</p>";
include __OCSP_PROJECTPATH__.$this->includeRoot.$this->PROGRAMM_INC;
} else if (file_exists(__OCSP_PROJECTPATH__.$this->PROGRAMM_INC)) {
if ($debug) echo "<p>Programm Include:</p>";
include __OCSP_PROJECTPATH__.$this->PROGRAMM_INC;
if ($debug) echo "<p>Programm Include: <b>not found</b></b>";
echo $this->getChapter(CHAPTER_SHOWMODE_ALLWAYS_BOTTOM,$debug);
if ($debug) echo "<p>Chapter Query: ".$this->getChapQuery(TRUE,FALSE,TRUE,FALSE,"",$debug)."</p>";
if ($cursor=$GLOBALS[$this->get_gDBIDX()]->query($this->getChapQuery())) {
while($row=$cursor->fetchArray()) {
if (!is_object($this->chaTmplArr[$row[$this->ctmplFldPrevix."ID"]])) {
$idx=$row[$this->ctmplFldPrevix."ID"];
$cmd="\$this->chaTmplArr[".$idx."] = new ".$this->ctmplClass."();";
$this->chaTmplArr[$idx]->setProjId($this->getProjId());
$this->chaTmplArr[$idx]->setPTMPId($this->getPTMPId());
$this->chaTmplArr[$idx]->setId($idx);
$this->chaTmplArr[$idx]->dbPopulate($debug);
echo $this->chaTmplArr[$row[$this->ctmplFldPrevix."ID"]]->getTag(unserialize($row[$this->chapPrevix.'FIELDS']));
echo $this->{$this->colPrevix."FEETER"};
echo $this->myTmpl->getFeeterTag();
* checks if we have a prepend inc file
* and includes it if exists
if ($debug) echo
"<p><b>CMS_PHPINC_PAGE::inc_prepInc(...)</b> (".
get_class($this).
")</p>";
foreach($keyVals as $kv) {
if ($debug) echo
"<pre>KV: ".
$kv.
"</pre>";
if ($debug) echo
"<pre>Setting \$GLOBALS['PAGVAR'][".
$k.
"] to ".
$v.
"</pre>";
$GLOBALS['PAGVAR'][$k]=
$v;
if ($debug) echo
"<p>Prepend Include:</p>";
if ($debug) echo
"<p>Prepend Include:</p>";
if ($debug) echo
"<p>Prepend Include: <b>not found</b></b>";
* executes a prepend script before the page output starts
* and includes $this->PREPEND_INC if file exists
* @param boolean $withMenu
function getHead($withMenu=
TRUE,$debug=
FALSE) {
if ($debug) echo
"<p><b>CMS_PHPINC_PAGE::getHead($withMenu,...)</b> (".
get_class($this).
")</p>";
return parent::getHead($withMenu,$debug);
* returns the content of the page
* @param int $chaShowMode
if ($this->getContentCalled())
throw
new Exception('content called twice');
$this->setContentCalled(True);
foreach($keyVals as $kv) {
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"<pre>KV: ".
$kv.
"</pre>");
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"<pre>Setting PAGVAR[".
$k.
"] to ".
$v.
"</pre>");
return parent::getContent($chaShowMode,$debug);
return parent::getContent($chaShowMode,$debug);
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"<p>Programm Include: <b>not found</b></b>");
Documentation generated on Thu, 08 Jan 2009 17:39:51 +0100 by phpDocumentor 1.4.0a2