/**
  * function loadPage
  * <pre>
  * load the page zones and applications given a pageID.
  * </pre>
  * @param $pageID [INTEGER] Unique PageID of the page to load.
  */
 function loadPage($pageID)
 {
     // now get a list of zones for this page
     $sql = 'SELECT DISTINCT pageapp_zone FROM ' . SITE_DB_NAME . '.' . XMLObject_CMSPageApp::DB_TABLE_PAGEAPP . ' WHERE page_id=' . $pageID;
     // for each zone
     $this->db->runSQL($sql);
     while ($row = $this->db->retrieveRow()) {
         // store in this->zones
         $this->zones[] = $row['pageapp_zone'];
     }
     // Create a generic App Object.
     $currentApp = new XMLObject_CMSApps($this->viewer);
     // for each zone
     for ($zoneIndx = 0; $zoneIndx < count($this->zones); $zoneIndx++) {
         // Create a new zone XML Object
         $currentZone = new XMLObject(XMLObject_CMSPageApp::XML_NODE_ZONE);
         $currentZone->addAttribute('name', $this->zones[$zoneIndx]);
         // get all the applications in the current zone
         $sql = 'SELECT * FROM ' . SITE_DB_NAME . '.' . XMLObject_CMSPageApp::DB_TABLE_PAGEAPP . ' WHERE page_id=' . $pageID . ' AND pageapp_zone="' . $this->zones[$zoneIndx] . '" ORDER BY pageapp_order';
         // for each application
         $this->db->runSQL($sql);
         while ($row = $this->db->retrieveRow()) {
             // Load Application
             $currentApp->loadApp($row['app_id']);
             // Store Application in current Zone
             $currentZone->addElement($currentApp->getNodeName(), $currentApp->getValues());
         }
         // end while
         // Now store current Zone in this object
         $this->addElement($currentZone->getNodeName(), $currentZone->getValues());
     }
     // end For Each Zone
 }
示例#2
0
***
*/
/*
 * Session Table
 *
 * Setup the session tracking table.  
 * (Used by Tools/tool_Sessions.php)
 */
sessionsDropTable($db);
sessionsCreateTable($db);
/*
 *XMLObject_CMSPage
 *
 * The table definitions for the CMSPage Application infrastructure.
 */
$tableDefCMSPage = new XMLObject_CMSApps("");
$tableDefCMSPage->dropTable($db);
$tableDefCMSPage->createTable($db);
/*
*XMLObject_CMSPageApp
*
*
*/
$tableDefCMSPageApp = new XMLObject_CMSPageApp('');
$tableDefCMSPageApp->dropTable($db);
$tableDefCMSPageApp->createTable($db);
/*
*CMSPages
*
*
*/