/** * 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 }