/**
  * Overwrite this method if you'd like to perform special actions if as soon as content
  * was loaded from the cache.
  * Make sure to return a proper boolean value, otherwise the cached entry may get invalid.
  *
  * @return boolean
  */
 public function onLoadFromCache()
 {
     //update the news shown, if in details mode
     if ($this->getParam("action") == "newsDetail") {
         $objNews = new class_module_news_news($this->getParam("systemid"));
         $objNews->increaseHits();
     }
     return true;
 }
 /**
  * Looks up the list of tags and renders the list.
  *
  * @return string the prepared html-output
  */
 public function loadData()
 {
     $strReturn = "";
     $arrTags = class_module_tags_tag::getTagsWithAssignments();
     //load the template
     $strTemplateWrapperID = $this->objTemplate->readTemplate("/element_tags/" . $this->arrElementData["char1"], "tags");
     $strTemplateTagID = $this->objTemplate->readTemplate("/element_tags/" . $this->arrElementData["char1"], "tagname");
     $strTemplateTaglinkID = $this->objTemplate->readTemplate("/element_tags/" . $this->arrElementData["char1"], "taglink");
     $strTags = "";
     foreach ($arrTags as $objTag) {
         if ($objTag->rightView()) {
             $arrAssignments = $objTag->getListOfAssignments();
             $strLinks = "";
             //render the links - if possible
             foreach ($arrAssignments as $arrOneAssignment) {
                 $objRecord = class_objectfactory::getInstance()->getObject($arrOneAssignment["tags_systemid"]);
                 if ($objRecord == null) {
                     continue;
                 }
                 if ($objRecord instanceof class_module_pages_page) {
                     $strLink = getLinkPortal($objRecord->getStrName(), "", "_self", $objRecord->getStrBrowsername(), "", "&highlight=" . urlencode($objTag->getStrName()), "", "", $arrOneAssignment["tags_attribute"]);
                     $strLinks .= $this->fillTemplate(array("taglink" => $strLink), $strTemplateTaglinkID);
                 }
                 if (class_module_system_module::getModuleByName("news") != null && $objRecord->getIntModuleNr() == _news_module_id_) {
                     //TODO: fix after news integration, move to search link target interface handler
                     $objNews = new class_module_news_news($objRecord->getSystemid());
                     $strLink = getLinkPortal("newsdetails", "", "_self", $objNews->getStrTitle(), "newsDetail", "&highlight=" . urlencode($objTag->getStrName()), $objRecord->getSystemid(), "", "", $objNews->getStrTitle());
                     $strLinks .= $this->fillTemplate(array("taglink" => $strLink), $strTemplateTaglinkID);
                 }
             }
             $arrTemplate = array();
             $arrTemplate["tagname"] = $objTag->getStrName();
             $arrTemplate["linkcount"] = count($arrAssignments);
             $arrTemplate["taglinks"] = $strLinks;
             $arrTemplate["tagid"] = $objTag->getSystemid();
             $strTags .= $this->fillTemplate($arrTemplate, $strTemplateTagID);
         }
     }
     $strReturn = $this->fillTemplate(array("tags" => $strTags), $strTemplateWrapperID);
     return $strReturn;
 }
 public function testObjectIndexerPerformance()
 {
     if (class_module_system_module::getModuleByName("news") === null) {
         return;
     }
     $arrNewsIds = array();
     echo "Indexing without deferred indexer...\n";
     class_module_system_changelog::$bitChangelogEnabled = false;
     $intTimeStart = microtime(true);
     $intQueriesStart = class_db::getInstance()->getNumber();
     for ($intI = 0; $intI < 15; $intI++) {
         $objNews = new class_module_news_news();
         $objNews->setStrTitle("demo 1");
         $objNews->setStrIntro("intro demo news");
         $objNews->setStrText("text demo news");
         $objNews->updateObjectToDb();
         $arrNewsIds[] = $objNews->getSystemid();
     }
     echo "Queries pre indexing: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     $objHandler = new class_module_search_request_endprocessinglistener();
     $objHandler->handleEvent(class_system_eventidentifier::EVENT_SYSTEM_REQUEST_AFTERCONTENTSEND, array());
     $intTimeEnd = microtime(true);
     $time = $intTimeEnd - $intTimeStart;
     echo "Object updates: ", sprintf('%f', $time), " sec.\n";
     echo "Queries total: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     echo "\nIndexing with deferred indexer...\n";
     $objConfig = class_module_system_setting::getConfigByName("_search_deferred_indexer_");
     $objConfig->setStrValue("true");
     $objConfig->updateObjectToDb();
     $intTimeStart = microtime(true);
     $intQueriesStart = class_db::getInstance()->getNumber();
     for ($intI = 0; $intI < 15; $intI++) {
         $objNews = new class_module_news_news();
         $objNews->setStrTitle("demo 1");
         $objNews->setStrIntro("intro demo news");
         $objNews->setStrText("text demo news");
         $objNews->updateObjectToDb();
         $arrNewsIds[] = $objNews->getSystemid();
     }
     echo "Queries pre indexing: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     echo "Triggering queue update event...\n";
     $objHandler = new class_module_search_request_endprocessinglistener();
     $objHandler->handleEvent(class_system_eventidentifier::EVENT_SYSTEM_REQUEST_AFTERCONTENTSEND, array());
     $intTimeEnd = microtime(true);
     $time = $intTimeEnd - $intTimeStart;
     echo "Object updates: ", sprintf('%f', $time), " sec.\n";
     echo "Queries total: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     $objConfig = class_module_system_setting::getConfigByName("_search_deferred_indexer_");
     $objConfig->setStrValue("false");
     $objConfig->updateObjectToDb();
     foreach ($arrNewsIds as $strNewsId) {
         class_objectfactory::getInstance()->getObject($strNewsId)->deleteObjectFromDatabase();
     }
 }
Ejemplo n.º 4
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)
 {
     //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;
 }
Ejemplo n.º 5
0
 public function testObjectIndexerPerformance()
 {
     if (class_module_system_module::getModuleByName("news") === null) {
         return;
     }
     $objNews = new class_module_news_news();
     $objNews->setStrTitle("demo 1");
     $objNews->setStrIntro("intro demo news");
     $objNews->setStrText("text demo news");
     $objNews->updateObjectToDb();
     $strNewsId = $objNews->getSystemid();
     echo "Status changes with disabled changelog indexer integration...\n";
     class_module_system_changelog::$bitChangelogEnabled = false;
     $intTimeStart = microtime(true);
     $intQueriesStart = class_db::getInstance()->getNumber();
     for ($intI = 0; $intI < 150; $intI++) {
         $objNews->setIntRecordStatus($intI % 2);
         $objNews->updateObjectToDb();
     }
     $intTimeEnd = microtime(true);
     $time = $intTimeEnd - $intTimeStart;
     echo "Object updates: ", sprintf('%f', $time), " sec.\n";
     echo "Queries: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     echo "Status changes with enabled changelog indexer integration...\n";
     class_module_system_changelog::$bitChangelogEnabled = true;
     $intTimeStart = microtime(true);
     $intQueriesStart = class_db::getInstance()->getNumber();
     for ($intI = 0; $intI < 150; $intI++) {
         $objNews->setIntRecordStatus($intI % 2);
         $objNews->updateObjectToDb();
     }
     $intTimeEnd = microtime(true);
     $time = $intTimeEnd - $intTimeStart;
     echo "Object updates: ", sprintf('%f', $time), " sec.\n";
     echo "Queries: ", class_db::getInstance()->getNumber() - $intQueriesStart . " \n";
     class_objectfactory::getInstance()->getObject($strNewsId)->deleteObjectFromDatabase();
 }
Ejemplo n.º 6
0
 public function testRssFeed()
 {
     echo "creating news & category..\n";
     $objNews = new class_module_news_news();
     $objNews->setStrTitle("autotest");
     $objNews->setStrIntro("autotest");
     $objNews->setStrText("autotest");
     $this->assertTrue($objNews->updateObjectToDb(), __FILE__ . " save news");
     $objNews2 = new class_module_news_news();
     $objNews2->setStrTitle("autotest2");
     $objNews2->setStrIntro("autotest2");
     $objNews2->setStrText("autotest2");
     $this->assertTrue($objNews2->updateObjectToDb(), __FILE__ . " save news");
     echo "creating category...\n";
     $objCat = new class_module_news_category();
     $objCat->setStrTitle("autotest");
     $this->assertTrue($objCat->updateObjectToDb(), __FILE__ . " save cat");
     $this->flushDBCache();
     echo "adding news to category..\n";
     $objNews->setArrCats(array($objCat->getSystemid()));
     $this->assertTrue($objNews->updateObjectToDb(), __FILE__ . " update news");
     $this->flushDBCache();
     echo "creating feed...\n";
     $objFeed = new class_module_news_feed();
     $objFeed->setStrTitle("testfeed");
     $objFeed->setStrCat($objCat->getSystemid());
     $objFeed->setStrUrlTitle("autotest");
     $objFeed->setStrPage("autotest");
     $objFeed->updateObjectToDb();
     $this->flushDBCache();
     $this->assertEquals(1, count(class_module_news_feed::getNewsList($objFeed->getStrCat())), __FILE__ . " check news for feed");
     $this->assertEquals(1, count(class_module_news_feed::getNewsList($objFeed->getStrCat(), 1)), __FILE__ . " check news for feed");
     echo "generating feed by creating a fake request...\n";
     $objNewsPortalXML = new class_module_news_portal_xml();
     $objNewsPortalXML->setParam("feedTitle", "autotest");
     $strFeed = $objNewsPortalXML->action("newsFeed");
     $this->assertTrue(uniStrpos($strFeed, "<title>autotest</title>") !== false, __FILE__ . " check rss feed");
     echo "parsing feed with xml parser...\n";
     $objXmlParser = new class_xml_parser();
     $objXmlParser->loadString($strFeed);
     $arrFeed = $objXmlParser->xmlToArray();
     $intNrOfNews = count($arrFeed["rss"][0]["channel"][0]["item"]);
     $this->assertEquals(1, $intNrOfNews, __FILE__ . " check items for feed");
     $strTitle = $arrFeed["rss"][0]["channel"][0]["item"][0]["title"][0]["value"];
     $this->assertEquals("autotest", $strTitle, __FILE__ . " check items-title for feed");
     echo "adding news to category..\n";
     $objNews2->setArrCats(array($objCat->getSystemid()));
     $this->assertTrue($objNews2->updateObjectToDb(), __FILE__ . " update news");
     $this->flushDBCache();
     $objNewsPortalXML = new class_module_news_portal_xml();
     $objNewsPortalXML->setParam("feedTitle", "autotest");
     $strFeed = $objNewsPortalXML->action("newsFeed");
     $this->assertTrue(uniStrpos($strFeed, "<title>autotest</title>") !== false, __FILE__ . " check rss feed");
     echo "parsing feed with xml parser...\n";
     $objXmlParser = new class_xml_parser();
     $objXmlParser->loadString($strFeed);
     $arrFeed = $objXmlParser->xmlToArray();
     //var_dump($arrFeed["rss"][0]["channel"][0]["item"]);
     $intNrOfNews = count($arrFeed["rss"][0]["channel"][0]["item"]);
     $this->assertEquals(2, $intNrOfNews, __FILE__ . " check items for feed");
     echo "deleting news & category...\n";
     $this->assertTrue($objNews->deleteObjectFromDatabase(), __FILE__ . " delete news");
     $this->assertTrue($objNews2->deleteObjectFromDatabase(), __FILE__ . " delete news");
     $this->assertTrue($objCat->deleteObjectFromDatabase(), __FILE__ . " delete cat");
     $this->assertTrue($objFeed->deleteObjectFromDatabase(), __FILE__ . " delete feed");
 }
 /**
  * Renders the news category titles
  * @param class_module_news_news $objNews
  *
  * @return string
  */
 private function renderCategoryTitles(class_module_news_news $objNews)
 {
     if (count(class_module_news_category::getNewsMember($objNews->getSystemid())) == 0) {
         return "";
     }
     $strCategories = "";
     foreach (class_module_news_category::getNewsMember($objNews->getSystemid()) as $objCat) {
         $objMapper = new class_template_mapper($objCat);
         $strCategories .= $objMapper->writeToTemplate("/module_news/" . $this->arrElementData["news_template"], "categories_category");
     }
     $strWrapper = $this->objTemplate->readTemplate("/module_news/" . $this->arrElementData["news_template"], "categories_wrapper");
     return $this->objTemplate->fillTemplate(array("categories" => $strCategories), $strWrapper);
 }
Ejemplo n.º 8
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;
 }
Ejemplo n.º 9
0
 /**
  * @see interface_calendarsource_admin::getArrCalendarEntries()
  */
 public function getArrCalendarEntries(class_date $objStartDate, class_date $objEndDate)
 {
     $arrEntries = array();
     if ($this->objSession->getSession(self::STR_CALENDAR_FILTER_NEWS) != "disabled") {
         $arrNews = class_module_news_news::getObjectList("", null, null, $objStartDate, $objEndDate);
         foreach ($arrNews as $objOneNews) {
             $objEntry = new class_calendarentry();
             $objEntry->setStrClass("calendarEvent calendarNews");
             $strAlt = $this->getLang("calendar_type_news");
             $strTitle = $objOneNews->getStrTitle();
             if (uniStrlen($strTitle) > 15) {
                 $strAlt = $strTitle . "<br />" . $strAlt;
                 $strTitle = uniStrTrim($strTitle, 14);
             }
             $strName = class_link::getLinkAdmin($this->getArrModule("modul"), "edit", "&systemid=" . $objOneNews->getSystemid(), $strTitle, $strAlt);
             $objEntry->setStrName($strName);
             $arrEntries[] = $objEntry;
         }
     }
     return $arrEntries;
 }