/**
  * Does the hard work: installs the module and registers needed constants
  *
  * @return string
  */
 public function install()
 {
     $strReturn = "";
     //search the master page
     $objMaster = class_module_pages_page::getPageByName("master");
     if ($objMaster != null) {
         $this->strMasterID = $objMaster->getSystemid();
     }
     if ($this->strMasterID != "") {
         $strReturn .= "Adding languageswitch to master page\n";
         $strReturn .= "ID of master page: " . $this->strMasterID . "\n";
         if (class_module_pages_element::getElement("languageswitch") != null) {
             $objPagelement = new class_module_pages_pageelement();
             $objPagelement->setStrPlaceholder("masterlanguageswitch_languageswitch");
             $objPagelement->setStrName("masterswitch");
             $objPagelement->setStrElement("languageswitch");
             $objPagelement->updateObjectToDb($this->strMasterID);
             $strElementId = $objPagelement->getSystemid();
             $strReturn .= "ID of element: " . $strElementId . "\n";
             $strReturn .= "Element created.\n";
             $strReturn .= "Setting languageswitch template...\n";
             $strQuery = "UPDATE " . _dbprefix_ . "element_universal\n                            SET char1 = ?\n                            WHERE content_id = ? ";
             $this->objDB->_pQuery($strQuery, array("languageswitch.tpl", $strElementId));
         }
     }
     return $strReturn;
 }
 public function update()
 {
     $strReturn = "";
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "1.0") {
         $strReturn = "Updating 1.0 to 1.1...\n";
         $this->updateElementVersion($this->objMetadata->getStrTitle(), "1.1");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "1.1") {
         $strReturn = "Updating 1.1 to 1.2...\n";
         $this->updateElementVersion($this->objMetadata->getStrTitle(), "1.2");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "1.2") {
         $strReturn = "Updating 1.2 to 1.3...\n";
         $this->updateElementVersion($this->objMetadata->getStrTitle(), "1.3");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "1.3") {
         $strReturn = "Updating 1.3 to 1.4...\n";
         $this->updateElementVersion($this->objMetadata->getStrTitle(), "1.4");
         $this->objDB->flushQueryCache();
     }
     return $strReturn . "\n\n";
 }
 public function update()
 {
     $strReturn = "";
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.0") {
         $strReturn .= "Updating element mediaplayer to 4.1...\n";
         $this->updateElementVersion("mediaplayer", "4.1");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.1") {
         $strReturn .= "Updating element mediaplayer to 4.2...\n";
         $this->updateElementVersion("mediaplayer", "4.2");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.2") {
         $strReturn .= "Updating element mediaplayer to 4.3...\n";
         $this->updateElementVersion("mediaplayer", "4.3");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.4") {
         $strReturn .= "Updating element mediaplayer to 4.5...\n";
         $this->updateElementVersion("mediaplayer", "4.5");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.5") {
         $strReturn .= "Updating element mediaplayer to 4.6...\n";
         $this->updateElementVersion("mediaplayer", "4.6");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("mediaplayer")->getStrVersion() == "4.6") {
         $strReturn .= "Updating element mediaplayer to 4.7...\n";
         $this->updateElementVersion("mediaplayer", "4.7");
         $this->objDB->flushQueryCache();
     }
     return $strReturn;
 }
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  */
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating new page rssfeed...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("rssfeed");
     $objPage->setStrBrowsername("Rssfeed");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strPageId . "\n";
     $strReturn .= "Adding pagelement to new page\n";
     if (class_module_pages_element::getElement("rssfeed") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("rssfeed");
         $objPagelement->updateObjectToDb($strPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams = array("rssfeed.tpl", 10, "http://www.kajona.de/kajona_news.rss", $strElementId);
         } else {
             $arrParams = array("rssfeed.tpl", 10, "http://www.kajona.de/kajona_news_en.rss", $strElementId);
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_universal\n                            SET char1 = ?,\n                                " . $this->objDB->encloseColumnName("int1") . " = ?,\n                                char2 = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Rssfeed element created.\n";
         } else {
             $strReturn .= "Error creating Rssfeed element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Rssfeed", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     return $strReturn;
 }
 /**
  * Removes the elements / modules handled by the current installer.
  * Use the reference param to add a human readable logging.
  *
  * @param string &$strReturn
  *
  * @return bool
  */
 public function remove(&$strReturn)
 {
     //delete the page-element
     $objElement = class_module_pages_element::getElement("news");
     if ($objElement != null) {
         $strReturn .= "Deleting page-element 'news'...\n";
         $objElement->deleteObjectFromDatabase();
     } else {
         $strReturn .= "Error finding page-element 'news', aborting.\n";
         return false;
     }
     /** @var class_module_news_feed $objOneObject */
     foreach (class_module_news_feed::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     /** @var class_module_news_category $objOneObject */
     foreach (class_module_news_category::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     /** @var class_module_news_news $objOneObject */
     foreach (class_module_news_news::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     //delete the module-node
     $strReturn .= "Deleting the module-registration...\n";
     $objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle(), true);
     if (!$objModule->deleteObjectFromDatabase()) {
         $strReturn .= "Error deleting module, aborting.\n";
         return false;
     }
     //delete the tables
     foreach (array("news_category", "news", "news_member", "news_feed", "element_news") as $strOneTable) {
         $strReturn .= "Dropping table " . $strOneTable . "...\n";
         if (!$this->objDB->_pQuery("DROP TABLE " . $this->objDB->encloseTableName(_dbprefix_ . $strOneTable) . "", array())) {
             $strReturn .= "Error deleting table, aborting.\n";
             return false;
         }
     }
     return true;
 }
 /**
  * Removes the elements / modules handled by the current installer.
  * Use the reference param to add a human readable logging.
  *
  * @param string &$strReturn
  *
  * @return bool
  */
 public function remove(&$strReturn)
 {
     //delete the page-element
     $objElement = class_module_pages_element::getElement($this->objMetadata->getStrTitle());
     if ($objElement != null) {
         $strReturn .= "Deleting page-element '" . $this->objMetadata->getStrTitle() . "'...\n";
         $objElement->deleteObjectFromDatabase();
     } else {
         $strReturn .= "Error finding page-element '" . $this->objMetadata->getStrTitle() . "', aborting.\n";
         return false;
     }
     return true;
 }
 public function update()
 {
     $strReturn = "";
     if (class_module_pages_element::getElement("userlist")->getStrVersion() == "0.2") {
         $strReturn = "Updating element userlist to 0.3...\n";
         $this->updateElementVersion("userlist", "0.3");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("userlist")->getStrVersion() == "0.3") {
         $strReturn = "Updating element userlist to 0.4...\n";
         $this->updateElementVersion("userlist", "0.4");
         $this->objDB->flushQueryCache();
     }
     return $strReturn;
 }
 public function install()
 {
     $strReturn = "";
     //Register the element
     $strReturn .= "Registering markdown-element...\n";
     //check, if not already existing
     if (class_module_pages_element::getElement("markdown") == null) {
         $objElement = new class_module_pages_element();
         $objElement->setStrName("markdown");
         $objElement->setStrClassAdmin("class_element_markdown_admin.php");
         $objElement->setStrClassPortal("class_element_markdown_portal.php");
         $objElement->setIntCachetime(3600);
         $objElement->setIntRepeat(1);
         $objElement->setStrVersion($this->objMetadata->getStrVersion());
         $objElement->updateObjectToDb();
         $strReturn .= "Element registered...\n";
     } else {
         $strReturn .= "Element already installed!...\n";
     }
     return $strReturn;
 }
 public function update()
 {
     $strReturn = "";
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.0") {
         $strReturn .= "Updating 4.0 to 4.1...\n";
         $this->updateElementVersion("languageswitch", "4.1");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.1") {
         $strReturn .= "Updating 4.1 to 4.2...\n";
         $this->updateElementVersion("languageswitch", "4.2");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.2") {
         $strReturn .= "Updating 4.2 to 4.3...\n";
         $this->updateElementVersion("languageswitch", "4.3");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.3") {
         $strReturn .= "Updating 4.3 to 4.4...\n";
         $this->updateElementVersion("languageswitch", "4.4");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.4") {
         $strReturn .= "Updating to 4.5...\n";
         $this->updateElementVersion("languageswitch", "4.5");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.5") {
         $strReturn .= "Updating to 4.6...\n";
         $this->updateElementVersion("languageswitch", "4.6");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement("languageswitch")->getStrVersion() == "4.6") {
         $strReturn .= "Updating to 4.7...\n";
         $this->updateElementVersion("languageswitch", "4.7");
         $this->objDB->flushQueryCache();
     }
     return $strReturn . "\n\n";
 }
 public function update()
 {
     $strReturn = "";
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.0") {
         $strReturn .= "Updating element portalupload to 4.1...\n";
         $this->updateElementVersion("portalupload", "4.1");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.1") {
         $strReturn .= "Updating element portalupload to 4.2...\n";
         $this->updateElementVersion("portalupload", "4.2");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.2") {
         $strReturn .= "Updating element portalupload to 4.2...\n";
         $this->updateElementVersion("portalupload", "4.3");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.3") {
         $strReturn .= "Updating element portalupload to 4.3...\n";
         $this->updateElementVersion("portalupload", "4.4");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.4") {
         $strReturn .= "Updating element portalupload to 4.5...\n";
         $this->updateElementVersion("portalupload", "4.5");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.5") {
         $strReturn .= "Updating element portalupload to 4.6...\n";
         $this->updateElementVersion("portalupload", "4.6");
         $this->objDB->flushQueryCache();
     }
     if (class_module_pages_element::getElement($this->objMetadata->getStrTitle())->getStrVersion() == "4.6") {
         $strReturn .= "Updating element portalupload to 4.7...\n";
         $this->updateElementVersion("portalupload", "4.7");
         $this->objDB->flushQueryCache();
     }
     return $strReturn;
 }
Esempio n. 11
0
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  */
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating new page contact...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("contact");
     $objPage->setStrBrowsername("Contact");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strPageId . "\n";
     $strReturn .= "Adding pagelement to new page\n";
     $objPagelement = new class_module_pages_pageelement();
     if (class_module_pages_element::getElement("form") != null) {
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("form");
         $objPagelement->updateObjectToDb($strPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "class_formular_contact.php";
             $arrParams[] = class_module_system_setting::getConfigValue("_system_admin_email_");
             $arrParams[] = "contact.tpl";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "class_formular_contact.php";
             $arrParams[] = class_module_system_setting::getConfigValue("_system_admin_email_");
             $arrParams[] = "contact.tpl";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_formular\n                        SET formular_class = ?,\n                            formular_email = ?,\n                            formular_template = ?\n                        WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Contact element created.\n";
         } else {
             $strReturn .= "Error creating Contact element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Contact", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph");
         $objPagelement->setStrName("content");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "";
             $arrParams[] = "Hinweis: Das Formular sendet per default die Anfragen an die E-Mail Adresse des Administrators.<br />\n                                Um diese Adresse zu ändern öffnen Sie bitte die Seite in der Administration und bearbeiten das Seitenelement &quot;Formular&quot;.<br /><br />";
             $arrParams[] = "";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "";
             $arrParams[] = "Note: By default, the form sends the messages to the administators email-address.<br />\n                               To change this address, open the current page using the administration and edit the page-element &quot;form&quot;.<br /><br />";
             $arrParams[] = "";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content = ?,\n                                    paragraph_image = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     return $strReturn;
 }
 /**
  * Gets the version of the package currently installed.
  * If not installed, null should be returned instead.
  *
  * @return string|null
  */
 public function getVersionInstalled()
 {
     if (class_module_system_module::getModuleByName("pages") === null) {
         return null;
     }
     $objElement = class_module_pages_element::getElement(uniStrReplace("element_", "", $this->objMetadata->getStrTitle()));
     if ($objElement !== null) {
         return $objElement->getStrVersion();
     } else {
         return null;
     }
 }
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  * @return string
  */
 public function install()
 {
     //search the master page
     $objMaster = class_module_pages_page::getPageByName("master");
     if ($objMaster != null) {
         $this->strMasterID = $objMaster->getSystemid();
     }
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn = "";
     $strReturn .= "Creating new mainnavigation-tree\n";
     $objNaviTree = new class_module_navigation_tree();
     $objNaviTree->setStrName("mainnavigation");
     $objNaviTree->setStrFolderId($strNaviFolderId);
     $objNaviTree->updateObjectToDb();
     $strTreeId = $objNaviTree->getSystemid();
     $strReturn .= "ID of new navigation-tree: " . $strTreeId . "\n";
     $strReturn .= "Creating new portalnavigation-tree\n";
     $objNaviTree = new class_module_navigation_tree();
     $objNaviTree->setStrName("portalnavigation");
     $objNaviTree->updateObjectToDb();
     $strTreePortalId = $objNaviTree->getSystemid();
     $strReturn .= "ID of new navigation-tree: " . $strTreePortalId . "\n";
     $strReturn .= "Creating navigation points\n";
     $objNaviPoint = new class_module_navigation_point();
     $objNaviPoint->setStrName("Home");
     $objNaviPoint->setStrPageI("index");
     $objNaviPoint->updateObjectToDb($strTreePortalId);
     if ($this->strMasterID != "") {
         $strReturn .= "Adding mainnavigation to master page\n";
         $strReturn .= "ID of master page: " . $this->strMasterID . "\n";
         if (class_module_pages_element::getElement("navigation") != null) {
             $objPagelement = new class_module_pages_pageelement();
             $objPagelement->setStrPlaceholder("mastermainnavi_navigation");
             $objPagelement->setStrName("mastermainnavi");
             $objPagelement->setStrElement("navigation");
             $objPagelement->updateObjectToDb($this->strMasterID);
             $strElementId = $objPagelement->getSystemid();
             $strQuery = "UPDATE " . _dbprefix_ . "element_navigation\n                                SET navigation_id= ?,\n                                    navigation_template = ?\n                                WHERE content_id = ?";
             if ($this->objDB->_pQuery($strQuery, array($strTreeId, "mainnavi.tpl", $strElementId))) {
                 $strReturn .= "Navigation element created.\n";
             } else {
                 $strReturn .= "Error creating navigation element.\n";
             }
         }
         $strReturn .= "Adding portalnavigation to master page\n";
         $strReturn .= "ID of master page: " . $this->strMasterID . "\n";
         if (class_module_pages_element::getElement("navigation") != null) {
             $objPagelement = new class_module_pages_pageelement();
             $objPagelement->setStrPlaceholder("masterportalnavi_navigation");
             $objPagelement->setStrName("masterportalnavi");
             $objPagelement->setStrElement("navigation");
             $objPagelement->updateObjectToDb($this->strMasterID);
             $strElementId = $objPagelement->getSystemid();
             $strQuery = "UPDATE " . _dbprefix_ . "element_navigation\n                                SET navigation_id= ?,\n                                    navigation_template = ?\n                                WHERE content_id = ?";
             if ($this->objDB->_pQuery($strQuery, array($strTreePortalId, "portalnavi.tpl", $strElementId))) {
                 $strReturn .= "Navigation element created.\n";
             } else {
                 $strReturn .= "Error creating navigation element.\n";
             }
         }
         $strReturn .= "Adding pathnavigation to master page\n";
         $strReturn .= "ID of master page: " . $this->strMasterID . "\n";
         if (class_module_pages_element::getElement("navigation") != null) {
             $objPagelement = new class_module_pages_pageelement();
             $objPagelement->setStrPlaceholder("masterpathnavi_navigation");
             $objPagelement->setStrName("masterpathnavi");
             $objPagelement->setStrElement("navigation");
             $objPagelement->updateObjectToDb($this->strMasterID);
             $strElementId = $objPagelement->getSystemid();
             $strQuery = "UPDATE " . _dbprefix_ . "element_navigation\n                                SET navigation_id= ?,\n                                    navigation_template = ?\n                                WHERE content_id = ?";
             if ($this->objDB->_pQuery($strQuery, array($strTreeId, "breadcrumbnavi.tpl", $strElementId))) {
                 $strReturn .= "Navigation element created.\n";
             } else {
                 $strReturn .= "Error creating navigation element.\n";
             }
         }
     }
     $strReturn .= "Creating simple sitemap...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("sitemap");
     $objPage->setStrBrowsername("Sitemap");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb();
     $strSitemapId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strSitemapId . "\n";
     $strReturn .= "Adding sitemap to new page\n";
     if (class_module_pages_element::getElement("navigation") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("navigation");
         $objPagelement->updateObjectToDb($strSitemapId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_navigation\n                            SET navigation_id=?,\n                                navigation_template = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array($strTreeId, "sitemap.tpl", $strElementId))) {
             $strReturn .= "Sitemapelement created.\n";
         } else {
             $strReturn .= "Error creating sitemapelement.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strSitemapId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?\n                          WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, array("Sitemap", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Creating navigation points\n";
     $objNaviPoint = new class_module_navigation_point();
     $objNaviPoint->setStrName("Sitemap");
     $objNaviPoint->setStrPageI("sitemap");
     $objNaviPoint->updateObjectToDb($strTreePortalId);
     $strReturn .= "ID of new navigation point " . $objNaviPoint->getSystemid() . ".\n";
     $objNaviPoint = new class_module_navigation_point();
     if ($this->strContentLanguage == "de") {
         $objNaviPoint->setStrName("Impressum");
     } else {
         $objNaviPoint->setStrName("Imprint");
     }
     $objNaviPoint->setStrPageI("imprint");
     $objNaviPoint->updateObjectToDb($strTreePortalId);
     $strReturn .= "ID of new navigation point " . $objNaviPoint->getSystemid() . ".\n";
     return $strReturn;
 }
Esempio n. 14
0
 public function install()
 {
     $strReturn = "Installing " . $this->objMetadata->getStrTitle() . "...\n";
     $objManager = new class_orm_schemamanager();
     $strReturn .= "Installing table pages...\n";
     $objManager->createTable("class_module_pages_page");
     $strReturn .= "Installing table page_folder...\n";
     $objManager->createTable("class_module_pages_folder");
     //folder_properties
     $strReturn .= "Installing table page_properties...\n";
     $arrFields = array();
     $arrFields["pageproperties_id"] = array("char20", false);
     $arrFields["pageproperties_browsername"] = array("char254", true);
     $arrFields["pageproperties_keywords"] = array("char254", true);
     $arrFields["pageproperties_description"] = array("char254", true);
     $arrFields["pageproperties_template"] = array("char254", true);
     $arrFields["pageproperties_seostring"] = array("char254", true);
     $arrFields["pageproperties_language"] = array("char20", true);
     $arrFields["pageproperties_alias"] = array("char254", true);
     $arrFields["pageproperties_path"] = array("char254", true);
     $arrFields["pageproperties_target"] = array("char254", true);
     if (!$this->objDB->createTable("page_properties", $arrFields, array("pageproperties_id", "pageproperties_language"), array("pageproperties_language"))) {
         $strReturn .= "An error occurred! ...\n";
     }
     $strReturn .= "Installing table element...\n";
     $objManager->createTable("class_module_pages_element");
     $strReturn .= "Installing table page_element...\n";
     $objManager->createTable("class_module_pages_pageelement");
     //Now we have to register module by module
     //the pages
     $this->registerModule("pages", _pages_modul_id_, "class_module_pages_portal.php", "class_module_pages_admin.php", $this->objMetadata->getStrVersion(), true);
     //The pages_content
     $this->registerModule("pages_content", _pages_content_modul_id_, "", "class_module_pages_content_admin.php", $this->objMetadata->getStrVersion(), false);
     $strReturn .= "Registering system-constants...\n";
     $this->registerConstant("_pages_templatechange_", "false", class_module_system_setting::$int_TYPE_BOOL, _pages_modul_id_);
     $this->registerConstant("_pages_indexpage_", "index", class_module_system_setting::$int_TYPE_PAGE, _pages_modul_id_);
     $this->registerConstant("_pages_errorpage_", "error", class_module_system_setting::$int_TYPE_PAGE, _pages_modul_id_);
     $this->registerConstant("_pages_defaulttemplate_", "standard.tpl", class_module_system_setting::$int_TYPE_STRING, _pages_modul_id_);
     //2.1.1: overall cachetime
     $this->registerConstant("_pages_cacheenabled_", "true", class_module_system_setting::$int_TYPE_BOOL, _pages_modul_id_);
     //2.1.1: possibility, to create new pages disabled
     $this->registerConstant("_pages_newdisabled_", "false", class_module_system_setting::$int_TYPE_BOOL, _pages_modul_id_);
     //portaleditor
     $this->registerConstant("_pages_portaleditor_", "true", class_module_system_setting::$int_TYPE_BOOL, _pages_modul_id_);
     $strReturn .= "Shifting pages to third position...\n";
     $objModule = class_module_system_module::getModuleByName("pages");
     $objModule->setAbsolutePosition(3);
     //Table for paragraphes
     $strReturn .= "Installing paragraph table...\n";
     $objManager->createTable("class_element_paragraph_admin");
     //Register the element
     $strReturn .= "Registering paragraph...\n";
     //check, if not already existing
     $objElement = null;
     try {
         $objElement = class_module_pages_element::getElement("paragraph");
     } catch (class_exception $objEx) {
     }
     if ($objElement == null) {
         $objElement = new class_module_pages_element();
         $objElement->setStrName("paragraph");
         $objElement->setStrClassAdmin("class_element_paragraph_admin.php");
         $objElement->setStrClassPortal("class_element_paragraph_portal.php");
         $objElement->setIntCachetime(3600 * 24 * 30);
         $objElement->setIntRepeat(1);
         $objElement->setStrVersion($this->objMetadata->getStrVersion());
         $objElement->updateObjectToDb();
         $strReturn .= "Element registered...\n";
     } else {
         $strReturn .= "Element already installed!...\n";
     }
     $strReturn .= "Registering row...\n";
     //check, if not already existing
     $objElement = null;
     try {
         $objElement = class_module_pages_element::getElement("row");
     } catch (class_exception $objEx) {
     }
     if ($objElement == null) {
         $objElement = new class_module_pages_element();
         $objElement->setStrName("row");
         $objElement->setStrClassAdmin("class_element_row_admin.php");
         $objElement->setStrClassPortal("class_element_row_portal.php");
         $objElement->setIntCachetime(3600 * 24 * 30);
         $objElement->setIntRepeat(0);
         $objElement->setStrVersion($this->objMetadata->getStrVersion());
         $objElement->updateObjectToDb();
         $strReturn .= "Element registered...\n";
     } else {
         $strReturn .= "Element already installed!...\n";
     }
     //Table for images
     $strReturn .= "Installing image table...\n";
     $objManager->createTable("class_element_image_admin");
     //Register the element
     $strReturn .= "Registering image...\n";
     //check, if not already existing
     $objElement = null;
     try {
         $objElement = class_module_pages_element::getElement("image");
     } catch (class_exception $objEx) {
     }
     if ($objElement == null) {
         $objElement = new class_module_pages_element();
         $objElement->setStrName("image");
         $objElement->setStrClassAdmin("class_element_image_admin.php");
         $objElement->setStrClassPortal("class_element_image_portal.php");
         $objElement->setIntCachetime(3600 * 24 * 30);
         $objElement->setIntRepeat(1);
         $objElement->setStrVersion($this->objMetadata->getStrVersion());
         $objElement->updateObjectToDb();
         $strReturn .= "Element registered...\n";
     } else {
         $strReturn .= "Element already installed!...\n";
     }
     $strReturn .= "Installing universal element table...\n";
     $arrFields = array();
     $arrFields["content_id"] = array("char20", false);
     $arrFields["char1"] = array("char254", true);
     $arrFields["char2"] = array("char254", true);
     $arrFields["char3"] = array("char254", true);
     $arrFields["int1"] = array("int", true);
     $arrFields["int2"] = array("int", true);
     $arrFields["int3"] = array("int", true);
     $arrFields["text"] = array("text", true);
     if (!$this->objDB->createTable("element_universal", $arrFields, array("content_id"))) {
         $strReturn .= "An error occurred! ...\n";
     }
     $strReturn .= "Setting aspect assignments...\n";
     if (class_module_system_aspect::getAspectByName("content") != null) {
         $objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle());
         $objModule->setStrAspect(class_module_system_aspect::getAspectByName("content")->getSystemid());
         $objModule->updateObjectToDb();
     }
     return $strReturn;
 }
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  */
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating new postacomment page...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("postacomment");
     $objPage->setStrBrowsername("Postacomment");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strPostacommentPageID = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strPostacommentPageID . "\n";
     $strReturn .= "Adding pagelement to new page\n";
     if (class_module_pages_element::getElement("postacomment") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("postacomment");
         $objPagelement->updateObjectToDb($strPostacommentPageID);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_universal\n                                SET char1 = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("postacomment_ajax.tpl", $strElementId))) {
             $strReturn .= "Postacomment element created.\n";
         } else {
             $strReturn .= "Error creating Postacomment element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strPostacommentPageID);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Postacomment Sample", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("text_paragraph");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strPostacommentPageID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "";
             $arrParams[] = "Über das unten stehende Formular kann dieser Seite ein Kommentar hinzugefügt werden.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "";
             $arrParams[] = "By using the form below, comments may be added to the current page. ";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                    SET paragraph_title = ?,\n                                        paragraph_content = ?\n                                  WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     return $strReturn;
 }
 /**
  * Creates an instance of the concrete admin-element instance, e.g. the concrete row-element
  * Please note, that due to performance issues the foreign content is not loaded in the step!
  *
  * @return class_element_portal
  */
 public function getConcretePortalInstance()
 {
     if ($this->getStrClassAdmin() == "") {
         //Build the class-name based on the linked element
         $objElementdefinitionToCreate = class_module_pages_element::getElement($this->getStrElement());
         if ($objElementdefinitionToCreate == null) {
             return null;
         }
         $this->setStrClassPortal($objElementdefinitionToCreate->getStrClassPortal());
     }
     $strElementClass = str_replace(".php", "", $this->getStrClassPortal());
     //and finally create the object
     /** @var $objElement class_element_portal */
     $objElement = new $strElementClass($this);
     $objElement->setSystemid($this->getSystemid());
     return $objElement;
 }
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  * @return string
  */
 public function install()
 {
     $strReturn = "";
     if (class_module_system_module::getModuleByName("mediamanager") == null) {
         return "Mediamanger not installed, skipping element\n";
     }
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating new downloads...\n";
     $objDownloads = new class_module_mediamanager_repo();
     $objDownloads->setStrTitle("Sample downloads");
     $objDownloads->setStrPath("/files/downloads");
     $objDownloads->updateObjectToDb();
     $strDownloadsID = $objDownloads->getSystemid();
     $objDownloads->syncRepo();
     $strReturn .= "Adding download-permissions for guests...\n";
     class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $objDownloads->getSystemid(), "right2");
     $strReturn .= "Adding rating-permissions for guests...\n";
     class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $objDownloads->getSystemid(), "right3");
     $strReturn .= "Creating new downloads page...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("downloads");
     $objPage->setStrBrowsername("Downloads");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strDownloadsPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strDownloadsPageId . "\n";
     $strReturn .= "Adding pagelement to new page\n";
     $objPagelement = new class_module_pages_pageelement();
     if (class_module_pages_element::getElement("downloads") != null) {
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("downloads");
         $objPagelement->updateObjectToDb($strDownloadsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_downloads\n                            SET download_id = ?,\n                                download_template = ?\n                            WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, array($strDownloadsID, "downloads.tpl", $strElementId))) {
             $strReturn .= "downloads element created.\n";
         } else {
             $strReturn .= "Error creating downloads element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strDownloadsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Downloads", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     return $strReturn;
 }
Esempio n. 18
0
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  */
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     //search the index page
     $objIndex = class_module_pages_page::getPageByName("index");
     $objMaster = class_module_pages_page::getPageByName("master");
     if ($objIndex != null) {
         $this->strIndexID = $objIndex->getSystemid();
     }
     if ($objMaster != null) {
         $this->strMasterID = $objMaster->getSystemid();
     }
     $strReturn .= "Creating new category...\n";
     $objNewsCategory = new class_module_news_category();
     $objNewsCategory->setStrTitle("TOP-News");
     $objNewsCategory->updateObjectToDb();
     $strCategoryID = $objNewsCategory->getSystemid();
     $strReturn .= "ID of new category: " . $strCategoryID . "\n";
     $strReturn .= "Creating news\n";
     $objNews = new class_module_news_news();
     if ($this->strContentLanguage == "de") {
         $objNews->setStrTitle("Erfolgreich installiert");
         $objNews->setStrText("Eine weitere Installation von Kajona V3 war erfolgreich. Für weitere Infomationen zu Kajona besuchen Sie www.kajona.de.");
         $objNews->setStrIntro("Kajona wurde erfolgreich installiert...");
     } else {
         $objNews->setStrTitle("Installation successful");
         $objNews->setStrText("Another installation of Kajona was successful. For further information, support or proposals, please visit our website: www.kajona.de");
         $objNews->setStrIntro("Kajona installed successfully...");
     }
     $objNews->setObjDateStart(new class_date());
     $objNews->setArrCats(array($strCategoryID));
     $objNews->updateObjectToDb();
     $strNewsId = $objNews->getSystemid();
     $strReturn .= "ID of new news: " . $strNewsId . "\n";
     $strReturn .= "Creating news\n";
     $objNews = new class_module_news_news();
     $objNews->setStrTitle("Sed non enim est");
     $objNews->setStrText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non enim est, id hendrerit metus. Sed tempor quam sed ante viverra porta. Quisque sagittis egestas tortor, in euismod sapien iaculis at. Nullam vitae nunc tortor. Mauris justo lectus, bibendum et rutrum id, fringilla eget ipsum. Nullam volutpat sodales mollis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis tempor ante eget justo blandit imperdiet. Praesent ut risus tempus metus sagittis fermentum eget eu elit. Mauris consequat ornare massa, a rhoncus enim sodales auctor. Duis lacinia dignissim eros vel mollis. Etiam metus tortor, pellentesque eu ultricies sit amet, elementum et dolor. Proin tincidunt nunc id magna volutpat lobortis. Vivamus metus quam, accumsan eget vestibulum vel, rutrum sit amet mauris. Phasellus lectus leo, vulputate eget molestie et, consectetur nec urna. ");
     $objNews->setStrIntro("Quisque sagittis egestas tortor");
     $objNews->setObjDateStart(new class_date());
     $objNews->setArrCats(array($strCategoryID));
     $objNews->updateObjectToDb();
     $strNewsId = $objNews->getSystemid();
     $strReturn .= "ID of new news: " . $strNewsId . "\n";
     $strReturn .= "Adding news element to the master-page...\n";
     if ($this->strMasterID != "") {
         if (class_module_pages_element::getElement("news") != null) {
             $objPagelement = new class_module_pages_pageelement();
             $objPagelement->setStrPlaceholder("mastertopnews_news");
             $objPagelement->setStrName("mastertopnews");
             $objPagelement->setStrElement("news");
             $objPagelement->updateObjectToDb($this->strMasterID);
             $strElementId = $objPagelement->getSystemid();
             $strQuery = "UPDATE " . _dbprefix_ . "element_news\n                                SET news_category=?,\n                                    news_view = ?,\n                                    news_mode = ?,\n                                    news_order = ?,\n                                    news_amount = ?,\n                                    news_detailspage = ?,\n                                    news_template = ?\n                                WHERE content_id = ?";
             if ($this->objDB->_pQuery($strQuery, array($strCategoryID, 0, 0, 0, 10, "newsdetails", "demo.tpl", $strElementId))) {
                 $strReturn .= "Newselement created.\n";
             } else {
                 $strReturn .= "Error creating newselement.\n";
             }
         }
     }
     $strReturn .= "Creating news-detail\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("newsdetails");
     $objPage->setStrBrowsername("News");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb();
     $strNewsdetailsId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strNewsdetailsId . "\n";
     $strReturn .= "Adding newsdetails to new page\n";
     if (class_module_pages_element::getElement("news") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("news");
         $objPagelement->updateObjectToDb($strNewsdetailsId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_news\n                            SET news_category=?,\n                                news_view = ?,\n                                news_mode = ?,\n                                news_order = ?,\n                                news_amount = ?,\n                                news_detailspage = ?,\n                                news_template = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array($strCategoryID, 1, 0, 0, 20, "index", "demo.tpl", $strElementId))) {
             $strReturn .= "Newselement created.\n";
         } else {
             $strReturn .= "Error creating newselement.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strNewsdetailsId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("News", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Creating news-list-pge\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("news");
     $objPage->setStrBrowsername("News");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strNewslistId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strNewsdetailsId . "\n";
     $strReturn .= "Adding newsdetails to new page\n";
     if (class_module_pages_element::getElement("news") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("news");
         $objPagelement->updateObjectToDb($strNewslistId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_news\n                            SET news_category=?,\n                                news_view = ?,\n                                news_mode = ?,\n                                news_order = ?,\n                                news_amount = ?,\n                                news_detailspage = ?,\n                                news_template = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array($strCategoryID, 0, 0, 0, 20, "newsdetails", "demo.tpl", $strElementId))) {
             $strReturn .= "Newselement created.\n";
         } else {
             $strReturn .= "Error creating newselement.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strNewslistId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Newslist", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Creating news-feed\n";
     $objNewsFeed = new class_module_news_feed();
     $objNewsFeed->setStrTitle("kajona news");
     $objNewsFeed->setStrUrlTitle("kajona_news");
     $objNewsFeed->setStrLink("http://www.kajona.de");
     if ($this->strContentLanguage == "de") {
         $objNewsFeed->setStrDesc("Dies ist ein Kajona demo news feed");
     } else {
         $objNewsFeed->setStrDesc("This is a Kajona demo news feed");
     }
     $objNewsFeed->setStrPage($objPage->getStrName());
     $objNewsFeed->setStrCat("0");
     $objNewsFeed->setIntAmount(25);
     $objNewsFeed->updateObjectToDb();
     $strNewsFeedId = $objNewsFeed->getSystemid();
     $strReturn .= "ID of new news-feed: " . $strNewsFeedId . "\n";
     $strReturn .= "Adding rating permissions...\n";
     class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), class_module_system_module::getModuleByName("news")->getSystemid(), class_rights::$STR_RIGHT_RIGHT3);
     return $strReturn;
 }
 /**
  * Handles the loading of a page, more in a functional than in an oop style
  *
  * @throws class_exception
  * @return string the generated page
  * @permissions view
  */
 protected function actionGeneratePage()
 {
     //Determine the pagename
     $objPageData = $this->getPageData();
     //react on portaleditor commands
     //pe to display, or pe to disable?
     if ($this->getParam("pe") == "false") {
         $this->objSession->setSession("pe_disable", "true");
     }
     if ($this->getParam("pe") == "true") {
         $this->objSession->setSession("pe_disable", "false");
     }
     //if using the pe, the cache shouldn't be used, otherwise strange things might happen.
     //the system could frighten your cat or eat up all your cheese with marshmallows...
     //get the current state of the portal editor
     $bitPeRequested = false;
     if (class_module_system_setting::getConfigValue("_pages_portaleditor_") == "true" && $this->objSession->getSession("pe_disable") != "true" && $this->objSession->isAdmin() && $objPageData->rightEdit()) {
         $bitPeRequested = true;
     }
     //If we reached up till here, we can begin loading the elements to fill
     if ($bitPeRequested) {
         $arrElementsOnPage = class_module_pages_pageelement::getElementsOnPage($objPageData->getSystemid(), false, $this->getStrPortalLanguage());
     } else {
         $arrElementsOnPage = class_module_pages_pageelement::getElementsOnPage($objPageData->getSystemid(), true, $this->getStrPortalLanguage());
     }
     //If there's a master-page, load elements on that, too
     $objMasterData = class_module_pages_page::getPageByName("master");
     $bitEditPermissionOnMasterPage = false;
     if ($objMasterData != null) {
         if ($bitPeRequested) {
             $arrElementsOnMaster = class_module_pages_pageelement::getElementsOnPage($objMasterData->getSystemid(), false, $this->getStrPortalLanguage());
         } else {
             $arrElementsOnMaster = class_module_pages_pageelement::getElementsOnPage($objMasterData->getSystemid(), true, $this->getStrPortalLanguage());
         }
         //and merge them
         $arrElementsOnPage = array_merge($arrElementsOnPage, $arrElementsOnMaster);
         if ($objMasterData->rightEdit()) {
             $bitEditPermissionOnMasterPage = true;
         }
     }
     //Load the template from the filesystem to get the placeholders
     $strTemplateID = $this->objTemplate->readTemplate("/module_pages/" . $objPageData->getStrTemplate(), "", false, true);
     //bit include the masters-elements!!
     $arrRawPlaceholders = array_merge($this->objTemplate->getElements($strTemplateID, 0), $this->objTemplate->getElements($strTemplateID, 1));
     $arrPlaceholders = array();
     //and retransform
     foreach ($arrRawPlaceholders as $arrOneRawPlaceholder) {
         $arrPlaceholders[] = $arrOneRawPlaceholder["placeholder"];
     }
     //Initialize the caches internal cache :)
     class_cache::fillInternalCache("class_element_portal", $this->getPagename(), null, $this->getStrPortalLanguage());
     //try to load the additional title from cache
     $strAdditionalTitleFromCache = "";
     $intMaxCacheDuration = 0;
     $objCachedTitle = class_cache::getCachedEntry(__CLASS__, $this->getPagename(), $this->generateHash2Sum(), $this->getStrPortalLanguage());
     if ($objCachedTitle != null) {
         $strAdditionalTitleFromCache = $objCachedTitle->getStrContent();
         self::$strAdditionalTitle = $strAdditionalTitleFromCache;
     }
     //copy for the portaleditor
     $arrPlaceholdersFilled = array();
     //Iterate over all elements and pass control to them
     //Get back the filled element
     //Build the array to fill the template
     $arrTemplate = array();
     /** @var class_module_pages_pageelement $objOneElementOnPage */
     foreach ($arrElementsOnPage as $objOneElementOnPage) {
         //element really available on the template?
         if (!in_array($objOneElementOnPage->getStrPlaceholder(), $arrPlaceholders)) {
             //next one, plz
             continue;
         } else {
             //create a protocol of placeholders filled
             //remove from pe-additional-array, pe code is injected by element directly
             $arrPlaceholdersFilled[] = array("placeholder" => $objOneElementOnPage->getStrPlaceholder(), "name" => $objOneElementOnPage->getStrName(), "element" => $objOneElementOnPage->getStrElement(), "repeatable" => $objOneElementOnPage->getIntRepeat());
         }
         //Build the class-name for the object
         /** @var  class_element_portal $objElement  */
         $objElement = $objOneElementOnPage->getConcretePortalInstance();
         //let the element do the work and earn the output
         if (!isset($arrTemplate[$objOneElementOnPage->getStrPlaceholder()])) {
             $arrTemplate[$objOneElementOnPage->getStrPlaceholder()] = "";
         }
         //cache-handling. load element from cache.
         //if the element is re-generated, save it back to cache.
         if (class_module_system_setting::getConfigValue("_pages_cacheenabled_") == "true" && $this->getParam("preview") != "1" && $objPageData->getStrName() != class_module_system_setting::getConfigValue("_pages_errorpage_")) {
             $strElementOutput = "";
             //if the portaleditor is disabled, do the regular cache lookups in storage. otherwise regenerate again and again :)
             if ($bitPeRequested) {
                 $strElementOutput = $objElement->getElementOutput();
             } else {
                 //pe not to be taken into account --> full support of caching
                 $strElementOutput = $objElement->getElementOutputFromCache();
                 if ($objOneElementOnPage->getIntCachetime() > $intMaxCacheDuration) {
                     $intMaxCacheDuration = $objOneElementOnPage->getIntCachetime();
                 }
                 if ($strElementOutput === false) {
                     $strElementOutput = $objElement->getElementOutput();
                     $objElement->saveElementToCache($strElementOutput);
                 }
             }
         } else {
             $strElementOutput = $objElement->getElementOutput();
         }
         //if element is disabled & the pe is requested, wrap the content
         if ($bitPeRequested && $objOneElementOnPage->getIntRecordStatus() == 0) {
             $arrPeElement = array();
             $arrPeElement["title"] = $this->getLang("pe_inactiveElement", "pages") . " (" . $objOneElementOnPage->getStrElement() . ")";
             $strElementOutput = $this->objToolkit->getPeInactiveElement($arrPeElement);
             $strElementOutput = class_element_portal::addPortalEditorSetActiveCode($strElementOutput, $objElement->getSystemid(), array());
         }
         $arrTemplate[$objOneElementOnPage->getStrPlaceholder()] .= $strElementOutput;
     }
     //pe-code to add new elements on unfilled placeholders --> only if pe is visible?
     if ($bitPeRequested) {
         //loop placeholders on template in order to remove already filled ones not being repeatable
         $arrRawPlaceholdersForPe = $arrRawPlaceholders;
         foreach ($arrPlaceholdersFilled as $arrOnePlaceholder) {
             foreach ($arrRawPlaceholdersForPe as &$arrOneRawPlaceholder) {
                 if ($arrOneRawPlaceholder["placeholder"] == $arrOnePlaceholder["placeholder"]) {
                     foreach ($arrOneRawPlaceholder["elementlist"] as $intElementKey => $arrOneRawElement) {
                         if ($arrOnePlaceholder["element"] == $arrOneRawElement["element"]) {
                             if (uniSubstr($arrOneRawElement["name"], 0, 5) == "master") {
                                 $arrOneRawPlaceholder["elementlist"][$intElementKey] = null;
                             } else {
                                 if ($arrOnePlaceholder["repeatable"] == "0") {
                                     $arrOneRawPlaceholder["elementlist"][$intElementKey] = null;
                                 }
                             }
                         }
                     }
                 }
             }
         }
         //array is now set up. loop again to create new-buttons
         $arrPePlaceholdersDone = array();
         $arrPeNewButtons = array();
         foreach ($arrRawPlaceholdersForPe as $arrOneRawPlaceholderForPe) {
             $strPeNewPlaceholder = $arrOneRawPlaceholderForPe["placeholder"];
             foreach ($arrOneRawPlaceholderForPe["elementlist"] as $arrOnePeNewElement) {
                 if ($arrOnePeNewElement == null) {
                     continue;
                 }
                 //check if the linked element exists
                 $objPeNewElement = class_module_pages_element::getElement($arrOnePeNewElement["element"]);
                 if ($objPeNewElement == null) {
                     continue;
                 }
                 //placeholder processed before?
                 $strArrayKey = $strPeNewPlaceholder . $objPeNewElement->getStrName();
                 if (in_array($strArrayKey, $arrPePlaceholdersDone)) {
                     continue;
                 } else {
                     $arrPePlaceholdersDone[] = $strArrayKey;
                 }
                 //create and register the button to add a new element
                 if (!isset($arrPeNewButtons[$strPeNewPlaceholder])) {
                     $arrPeNewButtons[$strPeNewPlaceholder] = "";
                 }
                 if (uniStripos($strArrayKey, "master") !== false) {
                     $strLink = "";
                     if ($objMasterData !== null) {
                         $strLink = class_element_portal::getPortaleditorNewCode($objMasterData->getSystemid(), $strPeNewPlaceholder, $objPeNewElement);
                     }
                 } else {
                     $strLink = class_element_portal::getPortaleditorNewCode($objPageData->getSystemid(), $strPeNewPlaceholder, $objPeNewElement);
                 }
                 $arrPeNewButtons[$strPeNewPlaceholder] .= $strLink;
             }
         }
         //loop pe-new code in order to add the wrappers and assign the code to the matching placeholder
         foreach ($arrPeNewButtons as $strPlaceholderName => $strNewButtons) {
             if (!isset($arrTemplate[$strPlaceholderName])) {
                 $arrTemplate[$strPlaceholderName] = "";
             }
             if ($strNewButtons != "") {
                 $strNewButtons = class_element_portal::getPortaleditorNewWrapperCode($strPlaceholderName, $strNewButtons);
             }
             $arrTemplate[$strPlaceholderName] .= $strNewButtons;
         }
         // add placeholder wrapping
         foreach ($arrTemplate as $strPlaceholder => $strContent) {
             $arrTemplate[$strPlaceholder] = class_carrier::getInstance()->getObjToolkit("portal")->getPePlaceholderWrapper($strPlaceholder, $strContent);
         }
     }
     //check if the additional title has to be saved to the cache
     if (self::$strAdditionalTitle != "" && self::$strAdditionalTitle != $strAdditionalTitleFromCache) {
         $objCacheEntry = class_cache::getCachedEntry(__CLASS__, $this->getPagename(), $this->generateHash2Sum(), $this->getStrPortalLanguage(), true);
         $objCacheEntry->setStrContent(self::$strAdditionalTitle);
         $objCacheEntry->setIntLeasetime(time() + $intMaxCacheDuration);
         $objCacheEntry->updateObjectToDb();
     }
     $arrTemplate["description"] = $objPageData->getStrDesc();
     $arrTemplate["keywords"] = $objPageData->getStrKeywords();
     $arrTemplate["title"] = $objPageData->getStrBrowsername();
     $arrTemplate["additionalTitle"] = self::$strAdditionalTitle;
     $arrTemplate["canonicalUrl"] = class_link::getLinkPortalHref($objPageData->getStrName(), "", $this->getParam("action"), "", $this->getParam("systemid"));
     //Include the $arrGlobal Elements
     $arrGlobal = array();
     $strPath = class_resourceloader::getInstance()->getPathForFile("/portal/global_includes.php");
     if ($strPath !== false) {
         include _realpath_ . $strPath;
     }
     $arrTemplate = array_merge($arrTemplate, $arrGlobal);
     //fill the template. the template was read before
     $strPageContent = $this->fillTemplate($arrTemplate, $strTemplateID);
     $strPageContent = $this->renderPortalEditorCode($objPageData, $bitEditPermissionOnMasterPage, $strPageContent);
     //insert the copyright headers. Due to our licence, you are NOT allowed to remove those lines.
     $strHeader = "<!--\n";
     $strHeader .= "Website powered by Kajona Open Source Content Management Framework\n";
     $strHeader .= "For more information about Kajona see http://www.kajona.de\n";
     $strHeader .= "-->\n";
     $intBodyPos = uniStripos($strPageContent, "</head>");
     $intPosXml = uniStripos($strPageContent, "<?xml");
     if ($intBodyPos !== false) {
         $intBodyPos += 0;
         $strPageContent = uniSubstr($strPageContent, 0, $intBodyPos) . $strHeader . uniSubstr($strPageContent, $intBodyPos);
     } else {
         if ($intPosXml !== false) {
             $intBodyPos = uniStripos($strPageContent, "?>");
             $intBodyPos += 2;
             $strPageContent = uniSubstr($strPageContent, 0, $intBodyPos) . $strHeader . uniSubstr($strPageContent, $intBodyPos);
         } else {
             $strPageContent = $strHeader . $strPageContent;
         }
     }
     return $strPageContent;
 }
Esempio n. 20
0
 /**
  * Generates the link to create an element at a placeholder not yet existing
  *
  * @param string $strSystemid
  * @param string $strPlaceholder
  * @param class_module_pages_element $objElement
  *
  * @return string
  * @static
  */
 public static function getPortaleditorNewCode($strSystemid, $strPlaceholder, class_module_pages_element $objElement)
 {
     $strReturn = "";
     if (class_carrier::getInstance()->getObjRights()->rightEdit($strSystemid) && class_carrier::getInstance()->getObjSession()->isAdmin()) {
         //switch the text-language temporary
         $strPortalLanguage = class_carrier::getInstance()->getObjLang()->getStrTextLanguage();
         class_carrier::getInstance()->getObjLang()->setStrTextLanguage(class_carrier::getInstance()->getObjSession()->getAdminLanguage());
         //fetch the language to set the correct admin-lang
         $objLanguages = new class_module_languages_language();
         $strAdminLangParam = "&language=" . $objLanguages->getPortalLanguage();
         $strElementHref = class_link::getLinkAdminHref("pages_content", "new", "&systemid=" . $strSystemid . $strAdminLangParam . "&placeholder=" . $strPlaceholder . "&element=" . $objElement->getStrName() . "&pe=1");
         $strReturn = class_carrier::getInstance()->getObjToolkit("portal")->getPeNewButton($strPlaceholder, $objElement->getStrDisplayName(), $strElementHref);
         //reset the portal texts language
         class_carrier::getInstance()->getObjLang()->setStrTextLanguage($strPortalLanguage);
     }
     return $strReturn;
 }
Esempio n. 21
0
 /**
  * Does the hard work: installs the module and registers needed constants
  * @return string
  */
 public function install()
 {
     $strReturn = "";
     $strReturn .= "Shifting pages to first position...\n";
     $objPagesModule = class_module_system_module::getModuleByName("pages");
     $objPagesModule->setAbsolutePosition(3);
     $strReturn .= "Setting default template...\n";
     $objConstant = class_module_system_setting::getConfigByName("_pages_defaulttemplate_");
     $objConstant->setStrValue("standard.tpl");
     $objConstant->updateObjectToDb();
     $strReturn .= "Creating system folder...\n";
     $objFolder = new class_module_pages_folder();
     $objFolder->setStrName("_system");
     $objFolder->updateObjectToDb(class_module_system_module::getModuleByName("pages")->getSystemid());
     $strSystemFolderID = $objFolder->getSystemid();
     $strReturn .= "ID of new folder: " . $strSystemFolderID . "\n";
     $strReturn .= "Creating mainnavigation folder...\n";
     $objFolder = new class_module_pages_folder();
     $objFolder->setStrName("mainnavigation");
     $objFolder->updateObjectToDb(class_module_system_module::getModuleByName("pages")->getSystemid());
     $strMainnavigationFolderID = $objFolder->getSystemid();
     $strReturn .= "ID of new folder: " . $strSystemFolderID . "\n";
     $strReturn .= "Creating index-site...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("index");
     if ($this->strContentLanguage == "de") {
         $objPage->setStrBrowsername("Willkommen");
     } else {
         $objPage->setStrBrowsername("Welcome");
     }
     $objPage->setStrTemplate("home.tpl");
     $objPage->updateObjectToDb();
     $this->strIndexID = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $this->strIndexID . "\n";
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($this->strIndexID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Willkommen";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Welcome";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-elements to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph|image");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($this->strIndexID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Herzlichen Glückwunsch!";
             $arrParams[] = "Diese Installation von Kajona war erfolgreich. Wir wünschen viel Spaß mit Kajona V4.<br />\n                                Nehmen Sie sich die Zeit und betrachten Sie die einzelnen Seiten, die mit Beispielinhalten befüllt wurde. Sie gelangen jederzeit auf diese\n                                Seite durch den Link &quot;Home&quot; zurück.<br/>\n                                Um die Inhalte der Webseite zu verändern sollten Sie sich als erstes am Administrationsbereich <a href='_webpath_/admin'>anmelden</a>.\n                                Für weitere Informationen und Support besuchen Sie unsere Webseite: <a href=\"http://www.kajona.de\">www.kajona.de</a><br/>\n                                Das gesamte Kajona-Team wünscht viel Spa&szlig; beim Verwalten der Webseite mit Kajona!";
             $arrParams[] = "/files/images/upload/teaser.jpg";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Congratulations!";
             $arrParams[] = "This installation of Kajona was successful. Have fun using Kajona V4!<br />\n                                Take some time and watch the pages already created and have a look at the sample-contents assigned to those page.\n                                You may return to this page any time by clicking the &quot;home&quot; link.<br/>\n                                To modify the contents of this webpage you have to <a href='_webpath_/admin'>log in</a> at the administration-backend.\n                                For further information, support or proposals, please visit our website: <a href=\"http://www.kajona.de\">www.kajona.de</a><br/>\n                                The Kajona-Team hopes you'll enjoy managing your website with Kajona!";
             $arrParams[] = "/files/images/upload/teaser.jpg";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content =  ?,\n                                    paragraph_image = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("column1_paragraph|image");
         $objPagelement->setStrName("column1");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($this->strIndexID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Teaser 1";
             $arrParams[] = "Dieser Text-Absatz befindet sich am Platzhalter column1_paragraph|image, der im Standard-Template links ausgerichtet ist. Sobald Sie sich am\n                                System <a href='_webpath_/admin'>angemeldet</a> haben und das Portal erneut aufrufen, wird der Portal-Editor angezeigt. Nutzen Sie Drag n Drop\n                                um diesen Text-Absatz an einen anderen Platzhalter in diesem Template zu verschieben. Einzige Voraussetzung hierfür ist, dass der Platzhalter\n                                Elemente des Typs paragraph zulässt.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Teaser 1";
             $arrParams[] = "This paragraph is located at the placeholder column1_paragraph|image. The default-template aligns this placeholder to the left.\n                                As soon as you <a href='_webpath_/admin'>log in</a> at the administration-backend and reload the portal, the portal-editor is being shown.\n                                Use drag n drop to rearrange this placeholder and move it to another placeholder.\n                                The only limitation when dropping the element is, that the target-placeholder allows elements of the type paragraph.";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content =  ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("column2_paragraph|image");
         $objPagelement->setStrName("column2");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($this->strIndexID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Teaser 2";
             $arrParams[] = "Der Platzhalter dieses Elementes lautet column2_paragraph|image. Daher ist er für alle anderen Absätze auf dieser Seite ein gültiger Ziel-Platzhalter,\n                                sobald ein Absatz per drag n drop verschoben wird. Verschieben Sie die Absätze auf dieser Seite, um ein erstes Gefühl hierfür zu bekommen.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Teaser 2";
             $arrParams[] = "The placeholder of this paragraph is defined as column2_paragraph|image. Therefore it is a valid target-placeholder for other paragraphs on the current\n                                page. Try to move paragraph on this site in order so see how the possible drop-areas are being highlighted.";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content =  ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("column3_paragraph|image");
         $objPagelement->setStrName("column3");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($this->strIndexID);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Teaser 3";
             $arrParams[] = "Der Platzhalter dieses Elementes lautet column3_paragraph|image. Daher ist er für alle anderen Absätze auf dieser Seite ein gültiger Ziel-Platzhalter,\n                                sobald ein Absatz per drag n drop verschoben wird. Verschieben Sie die Absätze auf dieser Seite, um ein erstes Gefühl hierfür zu bekommen.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Teaser 3";
             $arrParams[] = "The placeholder of this paragraph is defined as column3_paragraph|image. Therefore it is a valid target-placeholder for other paragraphs on the current\n                                page. Try to move paragraph on this site in order so see how the possible drop-areas are being highlighted.";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content =  ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     $strReturn .= "Creating master-page\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("master");
     $objPage->setStrBrowsername("master");
     $objPage->setStrTemplate("master.tpl");
     $objPage->updateObjectToDb($strSystemFolderID);
     $this->strMasterID = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $this->strMasterID . "\n";
     $strReturn .= "Creating error-site...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("error");
     if ($this->strContentLanguage == "de") {
         $objPage->setStrBrowsername("Fehler");
     } else {
         $objPage->setStrBrowsername("Error");
     }
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strSystemFolderID);
     $strErrorPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strErrorPageId . "\n";
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strErrorPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Fehler";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Error";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph|image");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strErrorPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Ein Fehler ist aufgetreten";
             $arrParams[] = "Während Ihre Anfrage ist leider ein Fehler aufgetreten.<br />Bitte versuchen Sie die letzte Aktion erneut.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "An error occurred";
             $arrParams[] = "Maybe the requested page doesn\\'t exist anymore.<br />Please try it again later.";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                        SET paragraph_title = ?,\n                            paragraph_content = ?\n                        WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     $strReturn .= "Creating imprint-site...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("imprint");
     if ($this->strContentLanguage == "de") {
         $objPage->setStrBrowsername("Impressum");
     } else {
         $objPage->setStrBrowsername("Imprint");
     }
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strSystemFolderID);
     $strImprintPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strImprintPageId . "\n";
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strImprintPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Impressum";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Imprint";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph|image");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strImprintPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Impressum";
             $arrParams[] = "Bitte tragen Sie hier Ihre Kontaktdaten ein.<br />\n                               Nachname, Name<br />\n                               Straße und Hausnummer<br />\n                               PLZ, Ort<br />\n                               Telefon<br />\n                               E-Mail<br />\n                               <br />\n                               Site powered by <a href=\"http://www.kajona.de\" target=\"_blank\" title=\"Kajona CMS - empowering your content\">Kajona</a><br /><a href=\"http://www.kajona.de\" target=\"_blank\" title=\"Kajona CMS - empowering your content\"><img src=\"_webpath_/templates/default/pics/default/kajona_poweredby.png\" alt=\"Kajona\" /></a><br />";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Imprint";
             $arrParams[] = "Please provide your contact details.<br />\n                               Name, Forename<br />\n                               Street<br />\n                               Zip, City<br />\n                               Phone<br />\n                               Mail<br />\n                               <br />\n                               Site powered by <a href=\"http://www.kajona.de\" target=\"_blank\" title=\"Kajona CMS - empowering your content\">Kajona</a><br /><a href=\"http://www.kajona.de\" target=\"_blank\" title=\"Kajona CMS - empowering your content\"><img src=\"_webpath_/templates/default/pics/default/kajona_poweredby.png\" alt=\"Kajona\" /></a><br />";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                        SET paragraph_title = ?,\n                           paragraph_content = ?\n                      WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams, array(true, false))) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     $strReturn .= "Creating sample page...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("page_1");
     if ($this->strContentLanguage == "de") {
         $objPage->setStrBrowsername("Beispielseite 1");
     } else {
         $objPage->setStrBrowsername("Sample page 1");
     }
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strMainnavigationFolderID);
     $strSamplePageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strSamplePageId . "\n";
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strSamplePageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Beispielseite 1";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Sample page 1";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph|image");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strSamplePageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Standard-Absatz";
             $arrParams[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
             $arrParams[] = "/files/images/samples/IMG_3000.JPG";
             $arrParams[] = "http://www.kajona.de/";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Standard paragraph";
             $arrParams[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
             $arrParams[] = "/files/images/samples/IMG_3000.JPG";
             $arrParams[] = "http://www.kajona.de/";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?,\n                                paragraph_content = ?,\n                                paragraph_image = ?,\n                                paragraph_link = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     $strReturn .= "Creating sample subpage...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("subpage_1");
     if ($this->strContentLanguage == "de") {
         $objPage->setStrBrowsername("Beispiel-Unterseite 1");
     } else {
         $objPage->setStrBrowsername("Sample subpage 1");
     }
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strSamplePageId);
     $strSampleSubPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strSampleSubPageId . "\n";
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strSampleSubPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Beispiel-Unterseite 1";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Sample subpage 1";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("content_paragraph|image");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strSampleSubPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "Standard-Absatz auf Unterseite";
             $arrParams[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "Standard paragraph on subpage";
             $arrParams[] = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                            SET paragraph_title = ?,\n                                paragraph_content = ?\n                            WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     return $strReturn;
 }
 /**
  * Tries to generate a quick-help button.
  * Tests for exisiting help texts
  *
  * @return string
  */
 protected function getQuickHelp()
 {
     $strReturn = "";
     $strText = "";
     $strTextname = "";
     //Text for the current action available?
     //different loading when editing page-elements
     if ($this->getParam("module") == "pages_content" && ($this->getParam("action") == "edit" || $this->getParam("action") == "new")) {
         $objElement = null;
         if ($this->getParam("action") == "edit") {
             $objElement = new class_module_pages_pageelement($this->getSystemid());
         } else {
             if ($this->getParam("action") == "new") {
                 $strPlaceholderElement = $this->getParam("element");
                 $objElement = class_module_pages_element::getElement($strPlaceholderElement);
             }
         }
         //Build the class-name
         $strElementClass = str_replace(".php", "", $objElement->getStrClassAdmin());
         //and finally create the object
         if ($strElementClass != "") {
             /** @var class_element_admin $objElement */
             $objElement = new $strElementClass();
             $strTextname = $this->getObjLang()->stringToPlaceholder("quickhelp_" . $objElement->getArrModule("name"));
             $strText = class_carrier::getInstance()->getObjLang()->getLang($strTextname, $objElement->getArrModule("modul"));
         }
     } else {
         $strTextname = $this->getObjLang()->stringToPlaceholder("quickhelp_" . $this->getAction());
         $strText = $this->getLang($strTextname);
     }
     if ($strText != "!" . $strTextname . "!") {
         //Text found, embed the quickhelp into the current skin
         $strReturn .= $this->objToolkit->getQuickhelp($strText);
     }
     return $strReturn;
 }
 /**
  * Removes the elements / modules handled by the current installer.
  * Use the reference param to add a human readable logging.
  *
  * @param string &$strReturn
  *
  * @return bool
  */
 public function remove(&$strReturn)
 {
     //delete the page-element
     if (class_module_system_module::getModuleByName("pages") !== null && class_module_pages_element::getElement("search") != null) {
         $objElement = class_module_pages_element::getElement("search");
         if ($objElement != null) {
             $strReturn .= "Deleting page-element 'search'...\n";
             $objElement->deleteObjectFromDatabase();
         } else {
             $strReturn .= "Error finding page-element 'search', aborting.\n";
             return false;
         }
     }
     /** @var class_module_search_search $objOneObject */
     foreach (class_module_search_search::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     //delete the module-node
     $strReturn .= "Deleting the module-registration...\n";
     $objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle(), true);
     if (!$objModule->deleteObjectFromDatabase()) {
         $strReturn .= "Error deleting module, aborting.\n";
         return false;
     }
     //delete the tables
     foreach (array("search_search", "search_log", "element_search", "search_ix_document", "search_ix_content") as $strOneTable) {
         $strReturn .= "Dropping table " . $strOneTable . "...\n";
         if (!$this->objDB->_pQuery("DROP TABLE " . $this->objDB->encloseTableName(_dbprefix_ . $strOneTable) . "", array())) {
             $strReturn .= "Error deleting table, aborting.\n";
             return false;
         }
     }
     return true;
 }
    /**
     * Saves the passed Element to the database (edit or new modes)
     *
     * @throws class_exception
     * @return string "" in case of success
     */
    protected function actionSaveElement()
    {
        $strReturn = "";
        //There are two modes - edit and new
        //The element itself just knows the edit mode, so in case of new, we have to create a dummy element - before
        //passing control to the element
        if ($this->getParam("mode") == "new") {
            //Using the passed placeholder-param to load the element and get the table
            $strPlaceholder = $this->getParam("placeholder");
            //Split up the placeholder
            $arrPlaceholder = explode("_", $strPlaceholder);
            $strPlaceholderName = $arrPlaceholder[0];
            $strPlaceholderElement = $this->getParam("element");
            //Now, load all infos about the requested element
            $objElement = class_module_pages_element::getElement($strPlaceholderElement);
            //Load the class to create an object
            $strElementClass = str_replace(".php", "", $objElement->getStrClassAdmin());
            //and finally create the object
            /** @var class_element_admin $objElement */
            $objElement = new $strElementClass();
            //really continue? try to validate the passed data.
            if ($objElement->getAdminForm() !== null && !$objElement->getAdminForm()->validateForm()) {
                class_carrier::getInstance()->setParam("peClose", "");
                $strReturn .= $this->actionNew(true);
                return $strReturn;
            } else {
                if (!$objElement->validateForm()) {
                    class_carrier::getInstance()->setParam("peClose", "");
                    $strReturn .= $this->actionNew(true);
                    return $strReturn;
                }
            }
            //So, lets do the magic - create the records
            $objPageElement = new class_module_pages_pageelement();
            $objPageElement->setStrName($strPlaceholderName);
            $objPageElement->setStrPlaceholder($strPlaceholder);
            $objPageElement->setStrElement($strPlaceholderElement);
            $objPageElement->setStrLanguage($this->getParam("page_element_ph_language"));
            if (!$objPageElement->updateObjectToDb($this->getSystemid())) {
                throw new class_exception("Error saving new element-object to db", class_exception::$level_ERROR);
            }
            $strElementSystemId = $objPageElement->getSystemid();
            $objLockmanager = new class_lockmanager($strElementSystemId);
            $objLockmanager->lockRecord();
            //To have the element working as expected, set the systemid
            $this->setSystemid($strElementSystemId);
        }
        // ************************************* Edit the current Element *******************************
        //check, if the element isn't locked
        $objCommons = new class_module_system_common($this->getSystemid());
        $strPageSystemid = $objCommons->getPrevId();
        $objLockmanager = new class_lockmanager($this->getSystemid());
        if ($objLockmanager->isLockedByCurrentUser()) {
            //Load the data of the current element
            $objElementData = new class_module_pages_pageelement($this->getSystemid());
            /** @var $objElement class_element_admin */
            $objElement = $objElementData->getConcreteAdminInstance();
            //really continue? try to validate the passed data.
            if ($objElement->getAdminForm() !== null && !$objElement->getAdminForm()->validateForm()) {
                class_carrier::getInstance()->setParam("peClose", "");
                $strReturn .= $this->actionEdit(true);
                return $strReturn;
            } else {
                if (!$objElement->validateForm()) {
                    class_carrier::getInstance()->setParam("peClose", "");
                    $strReturn .= $this->actionEdit(true);
                    return $strReturn;
                }
            }
            //pass the data to the element, maybe the element wants to update some data
            $objElement->setArrParamData($this->getAllParams());
            if ($objElement->getAdminForm() !== null) {
                $objElement->getAdminForm()->updateSourceObject();
            }
            $objElement->doBeforeSaveToDb();
            //check, if we could save the data, so the element needn't to
            //woah, we are soooo great
            $objElement->updateForeignElement();
            //Edit Date of page & unlock
            $objPage = class_objectfactory::getInstance()->getObject($strPageSystemid);
            $objPage->updateObjectToDb();
            $objLockmanager->unlockRecord();
            //And update the internal comment and language
            $objElementData->setStrTitle($this->getParam("page_element_ph_title"));
            $objElementData->setStrLanguage($this->getParam("page_element_ph_language"));
            //placeholder to update?
            if ($this->getParam("placeholder") != "") {
                $objElementData->setStrPlaceholder($this->getParam("placeholder"));
            }
            $objStartDate = new class_date("0");
            $objEndDate = new class_date("0");
            $objStartDate->generateDateFromParams("start", $this->getAllParams());
            $objEndDate->generateDateFromParams("end", $this->getAllParams());
            if ($objStartDate->getIntYear() == "0000") {
                $objElementData->setObjStartDate(null);
            } else {
                $objElementData->setObjStartDate($objStartDate);
            }
            if ($objEndDate->getIntYear() == "0000") {
                $objElementData->setObjEndDate(null);
            } else {
                $objElementData->setObjEndDate($objEndDate);
            }
            if (!$objElementData->updateObjectToDb()) {
                throw new class_exception("Error updating object to db", class_exception::$level_ERROR);
            }
            //allow the element to run actions after saving
            $objElement->doAfterSaveToDb();
            //Loading the data of the corresponding site
            $objPage = new class_module_pages_page($strPageSystemid);
            $this->flushCompletePagesCache();
            if ($this->getParam("peClose") == "1") {
                //generate the elements' output
                $objPortalElement = $objElementData->getConcretePortalInstance();
                $strElementContent = $objPortalElement->getElementOutput();
                $strContent = json_encode($strElementContent, JSON_FORCE_OBJECT);
                //JSON_HEX_QUOT|JSON_HEX_APOS
                $strReturn = <<<JS
                    parent.KAJONA.admin.portaleditor.changeElementData('{$objElementData->getStrPlaceholder()}', '{$objElementData->getSystemid()}', {$strContent});
                    parent.KAJONA.admin.portaleditor.closeDialog(true);

JS;
                class_carrier::getInstance()->setParam("peClose", null);
                return "<script type='text/javascript'>{$strReturn}</script>";
            }
            $this->adminReload(class_link::getLinkAdminHref("pages_content", "list", "systemid=" . $objPage->getSystemid()));
        } else {
            $strReturn = $this->objToolkit->warningBox($this->getLang("ds_gesperrt"));
        }
        return $strReturn;
    }
Esempio n. 25
0
 /**
  * Does the hard work: installs the module and registers needed constants
  *
  * @return string
  */
 public function install()
 {
     if (class_module_system_module::getModuleByName("mediamanager") == null) {
         return "Mediamanger not installed, skipping element\n";
     }
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating new gallery...\n";
     $objGallery = new class_module_mediamanager_repo();
     $objGallery->setStrTitle("Sample Gallery");
     $objGallery->setStrPath(_filespath_ . "/images/samples");
     $objGallery->setStrUploadFilter(".jpg,.png,.gif,.jpeg");
     $objGallery->setStrViewFilter(".jpg,.png,.gif,.jpeg");
     $objGallery->updateObjectToDb();
     $objGallery->syncRepo();
     $strGalleryID = $objGallery->getSystemid();
     $strReturn .= "Modify rights to allow guests to rate images...\n";
     class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $objGallery->getSystemid(), "right3");
     $strReturn .= "Creating new gallery page...\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("gallery");
     $objPage->setStrBrowsername("Gallery");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strGalleryPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strGalleryPageId . "\n";
     $strReturn .= "Adding pagelement to new page\n";
     if (class_module_pages_element::getElement("gallery") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("gallery");
         $objPagelement->updateObjectToDb($strGalleryPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_gallery\n                            SET gallery_id = ?,\n                                gallery_mode = ?,\n                                gallery_template = ?,\n                                gallery_maxh_d = ?,\n                                gallery_maxw_d = ?,\n                                gallery_imagesperpage = ?,\n                                gallery_text = ?,\n                                gallery_text_x = ?,\n                                gallery_text_y = ?\n                            WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, array($strGalleryID, 0, "gallery_imagelightbox.tpl", 600, 600, 0, "(c) kajona.de", 5, 15, $strElementId))) {
             $strReturn .= "Gallery element created.\n";
         } else {
             $strReturn .= "Error creating Gallery element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strGalleryPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Gallery", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     $strReturn .= "Adding paragraph-element to new page\n";
     if (class_module_pages_element::getElement("paragraph") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("text_paragraph");
         $objPagelement->setStrName("text");
         $objPagelement->setStrElement("paragraph");
         $objPagelement->updateObjectToDb($strGalleryPageId);
         $strElementId = $objPagelement->getSystemid();
         $arrParams = array();
         if ($this->strContentLanguage == "de") {
             $arrParams[] = "";
             $arrParams[] = "Alle Beispielbilder &copy; by kajona.de";
             $arrParams[] = $strElementId;
         } else {
             $arrParams[] = "";
             $arrParams[] = "All sample images &copy; by kajona.de";
             $arrParams[] = $strElementId;
         }
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                                SET paragraph_title = ?,\n                                    paragraph_content = ?\n                                WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, $arrParams)) {
             $strReturn .= "Paragraph element created.\n";
         } else {
             $strReturn .= "Error creating paragraph element.\n";
         }
     }
     return $strReturn;
 }
 private function processSinglePage($arrPage, $bitReplaceExisting, $strTopFolderId)
 {
     $strReturn = "";
     $arrMetadata = $arrPage["metadata"][0];
     $arrElements = $arrPage["elements"][0]["element"];
     //create page itself
     $strPagename = $arrMetadata["pagename"][0]["value"];
     $strPrevId = "";
     //check if the exported prev-values may be used
     $strImportPrevName = $arrMetadata["prevname"][0]["value"];
     if ($strImportPrevName != "") {
         $objPage = class_module_pages_page::getPageByName($strImportPrevName);
         if ($objPage !== null) {
             $strPrevId = $objPage->getSystemid();
         }
     } elseif (validateSystemid($arrMetadata["previd"][0]["value"])) {
         $objRoot = class_objectfactory::getInstance()->getObject($arrMetadata["previd"][0]["value"]);
         if ($objRoot !== null) {
             $strPrevId = $arrMetadata["previd"][0]["value"];
         }
     }
     if ($strPrevId == "") {
         $strPrevId = $strTopFolderId;
     }
     //check if an existing page should be replaced
     if ($bitReplaceExisting) {
         $objPage = class_module_pages_page::getPageByName($strPagename);
         if ($objPage !== null) {
             $strPrevId = $objPage->getPrevId();
             $objPage->deleteObject();
         }
         class_carrier::getInstance()->getObjDB()->flushQueryCache();
     }
     $objPage = new class_module_pages_page();
     $objPage->setStrName($strPagename);
     $objPage->updateObjectToDb($strPrevId);
     $strPageId = $objPage->getSystemid();
     $strReturn .= "created page " . $objPage->getStrName() . "\n";
     //save propertysets
     $objLanguages = new class_module_languages_language();
     $strCurrentLanguage = $objLanguages->getStrAdminLanguageToWorkOn();
     $arrPropertysets = $arrMetadata["pageproperties"][0]["propertyset"];
     foreach ($arrPropertysets as $arrOnePropSet) {
         class_carrier::getInstance()->getObjDB()->flushQueryCache();
         $objLanguages->setStrAdminLanguageToWorkOn($arrOnePropSet["attributes"]["language"]);
         //reload page to save correct prop-sets
         $objPage = new class_module_pages_page($strPageId);
         $objPage->setStrLanguage($arrOnePropSet["language"][0]["value"]);
         $objPage->setStrBrowsername($arrOnePropSet["browsername"][0]["value"]);
         $objPage->setStrDesc($arrOnePropSet["description"][0]["value"]);
         $objPage->setStrKeywords($arrOnePropSet["keywords"][0]["value"]);
         $objPage->setStrTemplate($arrOnePropSet["template"][0]["value"]);
         $objPage->setStrSeostring($arrOnePropSet["seostring"][0]["value"]);
         $objPage->setStrLanguage($arrOnePropSet["language"][0]["value"]);
         $objPage->setStrAlias($arrOnePropSet["alias"][0]["value"]);
         $objPage->setStrTarget($arrOnePropSet["target"][0]["value"]);
         $objPage->setStrPath($arrOnePropSet["path"][0]["value"]);
         $objPage->updateObjectToDb();
         $strReturn .= "saved propertyset for language " . $objPage->getStrLanguage() . "\n";
     }
     $objLanguages->setStrAdminLanguageToWorkOn($strCurrentLanguage);
     //and import each element
     foreach ($arrElements as $arrSingleElement) {
         //validate if element exists
         $strElementName = $arrSingleElement["metadata"][0]["element"][0]["value"];
         if (class_module_pages_element::getElement($strElementName) !== null) {
             $objElement = new class_module_pages_pageelement();
             $objElement->setStrPlaceholder($arrSingleElement["metadata"][0]["placeholder"][0]["value"]);
             $objElement->setStrName($arrSingleElement["metadata"][0]["name"][0]["value"]);
             $objElement->setStrElement($arrSingleElement["metadata"][0]["element"][0]["value"]);
             $objElement->setStrTitle($arrSingleElement["metadata"][0]["title"][0]["value"]);
             $objElement->setStrLanguage($arrSingleElement["metadata"][0]["language"][0]["value"]);
             $objElement->updateObjectToDb($strPageId);
             //and the foreign table
             $strTable = $arrSingleElement["foreignTable"][0]["attributes"]["table"];
             $arrValues = array();
             foreach ($arrSingleElement["foreignTable"][0]["column"] as $arrColumn) {
                 $arrValues[$arrColumn["attributes"]["name"]] = isset($arrColumn["value"]) ? $arrColumn["value"] : "";
             }
             unset($arrValues["content_id"]);
             //and build the query itself
             $strQuery = "UPDATE " . class_carrier::getInstance()->getObjDB()->encloseTableName(_dbprefix_ . $strTable) . " SET ";
             $arrInsertValues = array();
             $arrEscapes = array();
             $arrColumns = class_carrier::getInstance()->getObjDB()->getColumnsOfTable(_dbprefix_ . $strTable);
             $arrColumns = array_map(function ($arrColumn) {
                 return $arrColumn["columnName"];
             }, $arrColumns);
             foreach ($arrValues as $strColumn => $strValue) {
                 if (!in_array($strColumn, $arrColumns)) {
                     continue;
                 }
                 $strQuery .= class_carrier::getInstance()->getObjDB()->encloseColumnName($strColumn) . " = ? ,";
                 $arrInsertValues[] = $strValue;
                 $arrEscapes[] = false;
             }
             $strQuery = uniSubstr($strQuery, 0, -1);
             $strQuery .= " WHERE content_id = ?";
             $arrInsertValues[] = $objElement->getSystemid();
             class_carrier::getInstance()->getObjDB()->_pQuery($strQuery, $arrInsertValues, $arrEscapes);
             $strReturn .= "created element " . $objElement->getStrName() . "\n";
         } else {
             $strReturn .= "error: element " . $strElementName . " not existing";
         }
     }
     return $this->objToolkit->getPreformatted(array($strReturn));
 }
Esempio n. 27
0
 private function updateDownloads()
 {
     echo "Updating downloads to new mediamanager structure...\n";
     echo "<b>Please note: Permission-Settings can't be migrated. Please adopt the permissions, e.g. to download manually.</b>\n";
     if (!in_array(_dbprefix_ . "downloads_archive", $this->objDB->getTables())) {
         echo "Downloads table missing, no update required.\n";
         return true;
     }
     echo "Migrating old archives to new mediamanager repos...\n";
     $strQuery = "SELECT * FROM " . _dbprefix_ . "downloads_archive";
     $arrArchives = $this->objDB->getPArray($strQuery, array());
     foreach ($arrArchives as $arrOneArchive) {
         //load foreign repo data
         $strQuery = "SELECT * FROM " . _dbprefix_ . "filemanager WHERE filemanager_foreign_id = ?";
         $arrRepoData = $this->objDB->getPRow($strQuery, array($arrOneArchive["archive_id"]));
         echo "migrating old archive " . $arrOneArchive["archive_title"] . "\n";
         echo "  old path: " . $arrRepoData["filemanager_path"] . "\n";
         //convert the path
         $strPath = $this->convertOldPath($arrRepoData["filemanager_path"]);
         echo "  new path: " . $strPath . "\n";
         $objRepo = new class_module_mediamanager_repo();
         $objRepo->setStrPath($strPath);
         $objRepo->setStrTitle($arrOneArchive["archive_title"]);
         $objRepo->setStrViewFilter($arrRepoData["filemanager_view_filter"]);
         $objRepo->setStrUploadFilter($arrRepoData["filemanager_upload_filter"]);
         $objRepo->updateObjectToDb();
         $objRepo->syncRepo();
         echo "deleting old filemanager repo...\n";
         $strQuery = "DELETE FROM " . _dbprefix_ . "filemanager WHERE filemanager_id = ?";
         $this->objDB->_pQuery($strQuery, array($arrRepoData["filemanager_id"]));
         $this->deleteSystemRecord($arrRepoData["filemanager_id"]);
         echo "migrating downloads data...\n";
         $this->updateDownloadsLevel($objRepo->getSystemid(), $arrOneArchive["archive_id"]);
         echo "updating existing downloads-elements...\n";
         $strQuery = "UPDATE " . _dbprefix_ . "element_downloads SET download_id = ? WHERE download_id = ?";
         $this->objDB->_pQuery($strQuery, array($objRepo->getSystemid(), $arrOneArchive["archive_id"]));
         echo "deleting downloads-toplist element...\n";
         $objElement = class_module_pages_element::getElement("downloadstoplist");
         if ($objElement != null) {
             $objElement->deleteObjectFromDatabase();
         }
         echo "deleting old adminwidgets...\n";
         $arrWidgets = class_module_dashboard_widget::getAllWidgets();
         foreach ($arrWidgets as $objOneWidget) {
             if ($objOneWidget->getStrClass() == "class_adminwidget_downloads") {
                 $objOneWidget->deleteObjectFromDatabase();
             }
         }
         echo "deleting archive and contained downloads data...\n";
         $this->deleteDownloadsLevel($arrOneArchive["archive_id"]);
         $this->objDB->_pQuery("DELETE FROM " . _dbprefix_ . "downloads_archive WHERE archive_id = ?", array($arrOneArchive["archive_id"]));
         $this->deleteSystemRecord($arrOneArchive["archive_id"]);
     }
     echo "Migrating old log-table...\n";
     $this->objDB->_pQuery("INSERT INTO " . _dbprefix_ . "mediamanager_dllog SELECT * FROM " . _dbprefix_ . "downloads_log", array());
     echo "Deleting downloads module...\n";
     $this->removeModule("downloads");
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_archive", array());
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_file", array());
     $this->objDB->_pQuery("DROP TABLE " . _dbprefix_ . "downloads_log", array());
     $this->removeSetting("_downloads_suche_seite_");
     return true;
 }
Esempio n. 28
0
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     //search the index page
     $objIndex = class_module_pages_page::getPageByName("index");
     if ($objIndex != null) {
         $this->strIndexID = $objIndex->getSystemid();
     }
     $strReturn .= "Creating faqs\n";
     $objFaq1 = new class_module_faqs_faq();
     $objFaq2 = new class_module_faqs_faq();
     if ($this->strContentLanguage == "de") {
         $objFaq1->setStrQuestion("Was ist Kajona?");
         $objFaq1->setStrAnswer("Kajona ist ein Open Source Content Management System basierend auf PHP und einer Datenbank. Dank der modularen Bauweise ist Kajona einfach erweiter- und anpassbar.");
         $objFaq2->setStrQuestion("Wer entwickelt Kajona, wo gibt es weitere Infos?");
         $objFaq2->setStrAnswer("Kajona wird von einer Open Source Community entwickelt. Da Kajona ständig weiterentwickelt wird, sind wir jederzeit auf der Suche nach Helfern, seien es Programmierer, Grafiker, Betatester und auch Anwender. Weitere Informationen hierzu finden Sie auf <a href=\"http://www.kajona.de\">www.kajona.de</a>.");
     } else {
         $objFaq1->setStrQuestion("What is Kajona?");
         $objFaq1->setStrAnswer("Kajona is an open source content management system based on PHP and a database. Due to it's modular design, it can be extended and adopted very easily.");
         $objFaq2->setStrQuestion("Who develops Kajona, where can I find more infos?");
         $objFaq2->setStrAnswer("Kajona is being developed by an open source community. Since Kajona is still being developed, we are searching for contributors. Further information can be found at <a href=\"http://www.kajona.de\">www.kajona.de</a>.");
     }
     $strReturn .= "Saving faqs...\n";
     $objFaq1->updateObjectToDb();
     $objFaq2->updateObjectToDb();
     $strReturn .= "Creating faqs-page\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("faqs");
     $objPage->setStrBrowsername("FAQs");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strFaqsPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strFaqsPageId . "\n";
     $strReturn .= "Adding faqs-element to new page\n";
     if (class_module_pages_element::getElement("faqs") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("faqs");
         $objPagelement->updateObjectToDb($strFaqsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_faqs\n                            SET faqs_category= ?,\n                                faqs_template = ?\n                          WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, array(0, "demo_foldable.tpl", $strElementId))) {
             $strReturn .= "faqselement created.\n";
         } else {
             $strReturn .= "Error creating faqselement.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strFaqsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                             SET paragraph_title = ?\n                           WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("FAQs", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     return $strReturn;
 }
Esempio n. 29
0
 /**
  * Removes the elements / modules handled by the current installer.
  * Use the reference param to add a human readable logging.
  *
  * @param string &$strReturn
  *
  * @return bool
  */
 public function remove(&$strReturn)
 {
     $strReturn .= "Removing settings...\n";
     if (class_module_system_setting::getConfigByName("_tags_defaultprivate_") != null) {
         class_module_system_setting::getConfigByName("_tags_defaultprivate_")->deleteObjectFromDatabase();
     }
     //delete the page-element
     if (class_module_system_module::getModuleByName("pages") !== null && class_module_pages_element::getElement("tags") != null) {
         $objElement = class_module_pages_element::getElement("tags");
         if ($objElement != null) {
             $strReturn .= "Deleting page-element 'tags'...\n";
             $objElement->deleteObjectFromDatabase();
         } else {
             $strReturn .= "Error finding page-element 'guestbook', tags.\n";
             return false;
         }
     }
     /** @var class_module_tags_favorite $objOneObject */
     foreach (class_module_tags_favorite::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     /** @var class_module_tags_tag $objOneObject */
     foreach (class_module_tags_tag::getObjectList() as $objOneObject) {
         $strReturn .= "Deleting object '" . $objOneObject->getStrDisplayName() . "' ...\n";
         if (!$objOneObject->deleteObjectFromDatabase()) {
             $strReturn .= "Error deleting object, aborting.\n";
             return false;
         }
     }
     //delete the module-node
     $strReturn .= "Deleting the module-registration...\n";
     $objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle(), true);
     if (!$objModule->deleteObjectFromDatabase()) {
         $strReturn .= "Error deleting module, aborting.\n";
         return false;
     }
     //delete the tables
     foreach (array("tags_tag", "tags_member", "tags_favorite") as $strOneTable) {
         $strReturn .= "Dropping table " . $strOneTable . "...\n";
         if (!$this->objDB->_pQuery("DROP TABLE " . $this->objDB->encloseTableName(_dbprefix_ . $strOneTable) . "", array())) {
             $strReturn .= "Error deleting table, aborting.\n";
             return false;
         }
     }
     return true;
 }
 public function install()
 {
     $strReturn = "";
     //fetch navifolder-id
     $strNaviFolderId = "";
     $arrFolder = class_module_pages_folder::getFolderList();
     foreach ($arrFolder as $objOneFolder) {
         if ($objOneFolder->getStrName() == "mainnavigation") {
             $strNaviFolderId = $objOneFolder->getSystemid();
         }
     }
     $strReturn .= "Creating event\n";
     $objEvent = new class_module_eventmanager_event();
     $objEvent->setObjStartDate(new class_date());
     $objEvent->setObjEndDate(new class_date(time() + 3600));
     $objEvent->setIntRegistrationRequired(1);
     $objEvent->setIntEventStatus(2);
     if ($this->strContentLanguage == "de") {
         $objEvent->setStrTitle("Start der neuen Webseite mit Kajona");
         $objEvent->setStrDescription("Die neue Webseite ist online!<br />Als Basis dafür kommt das freie Open Source Content Management System <a href=\"http://www.kajona.de\">Kajona</a>, zum Einsatz.");
     } else {
         $objEvent->setStrTitle("Launch of the new website");
         $objEvent->setStrDescription("The new website is available!<br />The page is based on <a href=\"http://www.kajona.de\">Kajona</a>, a free open source content management system.");
     }
     $strReturn .= "Saving event...\n";
     $objEvent->updateObjectToDb();
     $strReturn .= "Creating events-page\n";
     $objPage = new class_module_pages_page();
     $objPage->setStrName("events");
     $objPage->setStrBrowsername("Events");
     $objPage->setStrTemplate("standard.tpl");
     $objPage->updateObjectToDb($strNaviFolderId);
     $strEventsPageId = $objPage->getSystemid();
     $strReturn .= "ID of new page: " . $strEventsPageId . "\n";
     $strReturn .= "Adding eventmanager-element to new page\n";
     if (class_module_pages_element::getElement("eventmanager") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("special_news|guestbook|downloads|gallery|galleryRandom|form|tellafriend|maps|search|navigation|faqs|postacomment|votings|userlist|rssfeed|tagto|portallogin|portalregistration|portalupload|directorybrowser|lastmodified|tagcloud|downloadstoplist|flash|mediaplayer|tags|eventmanager");
         $objPagelement->setStrName("special");
         $objPagelement->setStrElement("eventmanager");
         $objPagelement->updateObjectToDb($strEventsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_universal\n                            SET char1 = ?,\n                                " . $this->objDB->encloseColumnName("int1") . " = ?,\n                                " . $this->objDB->encloseColumnName("int2") . " = ?\n                          WHERE content_id = ? ";
         if ($this->objDB->_pQuery($strQuery, array("eventmanager.tpl", 0, 0, $strElementId))) {
             $strReturn .= "eventmanger-element created.\n";
         } else {
             $strReturn .= "Error creating eventmanager-element.\n";
         }
     }
     $strReturn .= "Adding headline-element to new page\n";
     if (class_module_pages_element::getElement("row") != null) {
         $objPagelement = new class_module_pages_pageelement();
         $objPagelement->setStrPlaceholder("headline_row");
         $objPagelement->setStrName("headline");
         $objPagelement->setStrElement("row");
         $objPagelement->updateObjectToDb($strEventsPageId);
         $strElementId = $objPagelement->getSystemid();
         $strQuery = "UPDATE " . _dbprefix_ . "element_paragraph\n                             SET paragraph_title = ?\n                           WHERE content_id = ?";
         if ($this->objDB->_pQuery($strQuery, array("Events", $strElementId))) {
             $strReturn .= "Headline element created.\n";
         } else {
             $strReturn .= "Error creating headline element.\n";
         }
     }
     return $strReturn;
 }