Example #1
0
$tableDefCMSPageApp->dropTable($db);
$tableDefCMSPageApp->createTable($db);
/*
*CMSPages
*
*
*/
$tableDefCMSPages = new CMSPage('');
$tableDefCMSPages->dropTable($db);
$tableDefCMSPages->createTable($db);
/*
 * HTMLBlock
 *
 * The SQL definition of the CMS application HTMLBlock.
 */
$tableDefHTMLBlock = new HTMLBlock(null, '');
$tableDefHTMLBlock->dropTable($db);
$tableDefHTMLBlock->createTable($db);
/*
 * XMLObject_MultilingualManager
 *
 * The SQL definition of the Multilingual Tables.
 */
//Create Tables
$tableSM = new RowManager_MultilingualSeriesManager();
$tableSM->dropTable();
$tableSM->createTable();
$tablePM = new RowManager_MultilingualPageManager();
$tablePM->dropTable();
$tablePM->createTable();
$tableLM = new RowManager_MultilingualLabelManager();
 public function HTMLBlock($id)
 {
     return HTMLBlock::getBlockByID($id);
 }
 /**
  * function loadApp
  * <pre>
  * Loads the individual Application Data from the appropriate CMS system 
  * object.
  * </pre>
  * <pre><code>
  * [Put PseudoCode Here]
  * </code></pre>
  * @param $appID [STRING] The unique ID of the application info we are 
  * loading.
  * @return [void]
  */
 function loadApp($appID)
 {
     // reset my XML values to empty
     $this->clearXMLValues();
     // get the requested App entry from the DB
     $sql = "SELECT * FROM " . SITE_DB_NAME . '.' . XMLObject_CMSApps::DB_TABLE_APPS . " WHERE app_id=" . $appID;
     $this->db->runSQL($sql);
     // if entry found then
     if ($row = $this->db->retrieveRow()) {
         // set member values
         $this->appID = $row['app_id'];
         $this->appType = $row['app_type'];
         $this->appKey = $row['app_key'];
         $this->appParameters = $row['app_parameters'];
         // find App Type and create new applcation
         switch ($this->appType) {
             case XMLObject_CMSApps::APP_TYPE_HTMLBLOCK:
                 $htmlBlock = new HTMLBlock($this->appKey, $this->viewer->getLanguageID());
                 $this->appHTML = $htmlBlock->getData();
                 //$this->appHTML = 'HTML Block // key=['.$this->appKey.'] languageID=['.$this->viewer->getLanguageID().']';
                 break;
         }
         // now set the data in the XML Object
         // include App Key as an element
         $this->addElement(XMLObject_CMSApps::XML_NODE_KEY, $this->appKey);
         // include App Type as an element
         $this->addElement(XMLObject_CMSApps::XML_NODE_TYPE, $this->appType);
         // include App HTML Content as an element
         $this->addElement(XMLObject_CMSApps::XML_NODE_CONTENT, $this->appHTML);
     } else {
         // clear object to empty state
         $this->appID = '';
         $this->appType = '';
         $this->appKey = '';
         $this->appParameters = '';
         $this->appHTML = '';
     }
 }