Source for file CMS_SUMMARYPAGE.phpclass
Documentation is available at CMS_SUMMARYPAGE.phpclass
* Class file summarypage.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
require_once $GLOBALS['PROJECT']['CONFIGPATH'].
"cms.conf";
require_once $GLOBALS['CMS']['PHPINCPATH'].
"page/pageV2.phpclass";
* shows the chapters of all pages in
* CMS_SUMMARYPAGE::pages where
* $GLOBALS['CMS']['CHAPTER_PAGEMODE'][$this->CHA_SHOWMODE]['SUMMARY] == TRUE
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @staticvar string $myClassName name of the class
* @var array $pages list of pages to check
* @var int $pagesmenId if > 0 use all pages in this menu
* init the object and populates it if (intval($aId))
* @param int $projId the project ID
* @param int $menId the menu ID
* @param int $aId the page ID
* @param int $langId the language ID
function CMS_SUMMARYPAGE($projId=
0,$menId=
0,$aId=
0,$langId=
0,$debug=
FALSE) {
$this->init("USRDB",$debug);
* unserialze the object field after populate with parent::dbPopulateDB
* @param string $gDBIDX GLOBAL ARRAY INDEX OF DB OBJECT
* @param bool $debug SHOW DEBUG INFO
* @return bool found row ?
* @version pk-03-12-14 fixed bug no return value
if ($debug) echo
"<p><b>CMS_SUMMARYPAGE::dbPopulateDB($gDBIDX,$debug)</b> (".
get_class($this).
")</p>";
if (parent::dbPopulateDB($gDBIDX,$debug)) {
* saves the object to the database
* if the object is populated dbReplace is called
* otherwise dbInsert is called
* Allways use dbSave to be sure object elements are serialized
function dbSave($gDBIDX=
"USRDB",$debug) {
if ($debug) echo
"<p><b>CMS_SUMMARYPAGE::dbSave($gDBIDX,$debug)</b> (".
get_class($this).
")</p>";
return parent::dbSave($gDBIDX,$debug);
* returns an array of chapter template names with chapter template ID as index
* returns false if the page does not support chapter input
if ($debug) echo
"<p><b>CMS_SUMMARYPAGE::getChaTemplates($debug)</b> (".
get_class($this).
")</p>";
* returns a database form
* @param int $mode dbms form show mode
* @param string $frmName dbms form name
* @todo input field PAGES is allways enabled
function &dbGetForm($mode,$frmName =
"",$debug=
FALSE) {
$form=
&parent::dbGetForm($mode,$frmName);
$fldPages=
&$form->addNoDbClassField("DBMS_FIELD_PAGESELECT","PAGES","Seiten");
$fldPages->multiselect=
TRUE;
$fldPages->allowChange=
TRUE;
$fldPages->enableNew=
TRUE;
$fldPages->enableEdit=
TRUE;
* returns a comma seperated list of page states to show
foreach($GLOBALS['CMS']['PAGESTATE'] as $key =>
$settings) {
if ($settings['SHOW']) $ret[]=
$key;
* returns the query string to select the chapters
* adds $addWhere between WHERE and ORDER BY
* $query.=" AND LANG_ID=".$this->getLangId();
* $query.=" ORDER BY ".$this->."_SORTORDER";
* @param bool $showAll don't care about chapter state
* @param bool $showTimedOut show chapters with SHOWTILL date in past
* @param bool $showFuture show chapters with SHOWFROM date in futur
* @param string $addWhere
function getChapQuery($showAllStates=
FALSE,$showTimedOut=
FALSE,$showFuter=
FALSE,$showGroup=
0,$addWhere=
"",$debug=
FALSE) {
if ($debug) echo
"<p><b>CMS_PAGE_V2::getChapQuery($showAll,$showTimedOut,$showFuter,$showGroup,$addWhere,$debug)</b> (".
get_class($this).
")</p>";
$query =
"SELECT c.* FROM ".
$this->cTable.
" c, ".
$this->myTable.
" p ";
$query.=
" WHERE p.".
$this->previx.
"ID IN (".
implode(",",$this->pages).
")";
$query.=
" AND p.".
$this->previx.
"SHOWTILL >= ".
$GLOBALS[$this->$this->get_gDBIDX()]->qs_getNowStmt();
$query.=
" AND p.".
$this->previx.
"SHOWFROM <= ".
$GLOBALS[$this->$this->get_gDBIDX()]->qs_getNowStmt();
if ($showGroup !==
FALSE ) { // note !== type equal compare (0 != FALSE)
$query.=
" AND p.".
$this->previx.
"SHOWGROUP IN (".
$GLOBALS['USER']->getGroups().
")";
$query.=
" AND p.".
$this->previx.
"SHOWGROUP = ".
$showGroup;
$query.=
" AND c.PAG_ID=p.PAG_ID ";
$query.=
" AND c.LANG_ID=".
$this->getLangId();
$query.=
" AND c.".
$this->chapPrevix.
"STATE IN (".
implode(",",$this->getChapOnlineStates()).
")";
$query.=
" AND c.".
$this->chapPrevix.
"SHOWTILL >= ".
$GLOBALS[$this->$this->get_gDBIDX()]->qs_getNowStmt();
$query.=
" AND c.".
$this->chapPrevix.
"SHOWFROM <= ".
$GLOBALS[$this->$this->get_gDBIDX()]->qs_getNowStmt();
if ($showGroup !==
FALSE ) { // note !== type equal compare (0 != FALSE)
$query.=
" AND c.".
$this->chapPrevix.
"SHOWGROUP IN (".
$GLOBALS['USER']->getGroups().
")";
$query.=
" AND c.".
$this->chapPrevix.
"SHOWGROUP = ".
$showGroup;
$query.=
" ORDER BY ".
$this->chapPrevix.
"SORTORDER";
Documentation generated on Thu, 08 Jan 2009 17:40:02 +0100 by phpDocumentor 1.4.0a2