/**
  * @return string
  * @permissions view,right
  */
 protected function actionParticipantConfirmation()
 {
     $strMessage = "";
     $objEvent = new class_module_eventmanager_event($this->getSystemid());
     if (validateSystemid($this->getParam("participantId"))) {
         $arrParticipants = class_module_eventmanager_participant::getObjectList($objEvent->getSystemid());
         foreach ($arrParticipants as $objOneParticipant) {
             if ($objOneParticipant->getSystemid() == $this->getParam("participantId")) {
                 $objOneParticipant->setIntRecordStatus(1);
                 $objOneParticipant->updateObjectToDb();
                 $strMessage = $this->getLang("participantSuccessConfirmation");
                 break;
             }
         }
         if ($strMessage == "") {
             $strMessage = $this->getLang("participantErrorConfirmation");
         }
         class_module_pages_portal::registerAdditionalTitle($objEvent->getStrTitle());
     } else {
         $strMessage = $this->getLang("commons_error_permissions");
     }
     $strWrapperID = $this->objTemplate->readTemplate("/module_eventmanager/" . $this->arrElementData["char1"], "event_register_message");
     $strReturn = $this->objTemplate->fillTemplate(array("title" => $objEvent->getStrTitle(), "message" => $strMessage), $strWrapperID);
     return $strReturn;
 }
 /**
  * Creates the detailed-view of news
  *
  * @return string
  */
 protected function actionNewsDetail()
 {
     $strReturn = "";
     /** @var $objNews class_module_news_news */
     $objNews = class_objectfactory::getInstance()->getObject($this->getSystemid());
     if ($objNews != null && $objNews instanceof class_module_news_news && $objNews->rightView() && $objNews->getIntRecordStatus() == "1") {
         //see if we should generate a redirect instead
         if ($objNews->getIntRedirectEnabled() == "1" && $objNews->getStrRedirectPage() != "") {
             $this->portalReload(class_link::getLinkPortalHref($objNews->getStrRedirectPage()));
             return "<script type='text/javascript'>window.location.replace('" . class_link::getLinkPortalHref($objNews->getStrRedirectPage()) . "');</script>";
         }
         //Load record
         $objMapper = new class_template_mapper($objNews);
         $objMapper->addPlaceholder("news_back_link", "<a href=\"javascript:history.back();\">" . $this->getLang("news_zurueck") . "</a>");
         $objMapper->addPlaceholder("news_start_date", dateToString($objNews->getObjStartDate(), false));
         $objMapper->addPlaceholder("news_id", $objNews->getSystemid());
         $objMapper->addPlaceholder("news_title", $objNews->getStrTitle());
         $objMapper->addPlaceholder("news_intro", $objNews->getStrIntro());
         $objMapper->addPlaceholder("news_text", $objNews->getStrText());
         //postacomment
         $arrPAC = $this->loadPostacomments($objNews->getSystemid(), $objNews->getStrImage() != "" ? "news_detail_image" : "news_detail");
         if ($arrPAC != null) {
             $objMapper->addPlaceholder("news_nrofcomments", $arrPAC["nrOfComments"]);
             $objMapper->addPlaceholder("news_commentlist", $arrPAC["commentList"]);
         }
         //ratings
         if ($objNews->getFloatRating() !== null) {
             /** @var $objRating class_module_rating_portal */
             $objRating = class_module_system_module::getModuleByName("rating")->getPortalInstanceOfConcreteModule();
             $objMapper->addPlaceholder("news_rating", $objRating->buildRatingBar($objNews->getFloatRating(), $objNews->getIntRatingHits(), $objNews->getSystemid(), $objNews->isRateableByUser(), $objNews->rightRight3()));
         }
         //categories
         $objMapper->addPlaceholder("news_categories", $this->renderCategoryTitles($objNews));
         //load template section with or without image?
         if ($objNews->getStrImage() != "") {
             $objMapper->addPlaceholder("news_image", urlencode($objNews->getStrImage()));
             $strReturn .= $objMapper->writeToTemplate("/module_news/" . $this->arrElementData["news_template"], "news_detail_image");
         } else {
             $strReturn .= $objMapper->writeToTemplate("/module_news/" . $this->arrElementData["news_template"], "news_detail");
         }
         //Add pe code
         $arrPeConfig = array("pe_module" => "news", "pe_action_edit" => "editNews", "pe_action_edit_params" => "&systemid=" . $this->getSystemid());
         $strReturn = class_element_portal::addPortalEditorCode($strReturn, $objNews->getSystemid(), $arrPeConfig);
         //and count the hit
         $objNews->increaseHits();
         //set the name of the current news to the page-title via class_pages
         class_module_pages_portal::registerAdditionalTitle($objNews->getStrTitle());
     } else {
         $strReturn = $this->getLang("commons_error_permissions");
     }
     return $strReturn;
 }
 /**
  * Prints a file as a detailed-view
  * and generates forward / backward links + a strip of prev / next files
  *
  * @param bool $bitRegisterAdditionalTitle
  * @return string
  */
 protected function actionFileDetails($bitRegisterAdditionalTitle = true)
 {
     if (!$this->checkIfRequestedIdIsInElementsTree()) {
         return $this->actionList();
     }
     $bitIsImage = false;
     //Load record
     $objFile = new class_module_mediamanager_file($this->getSystemid());
     //common fields
     $arrDetailsTemplate = array();
     $arrDetailsTemplate["file_name"] = $objFile->getStrName();
     $arrDetailsTemplate["file_description"] = $objFile->getStrDescription();
     $arrDetailsTemplate["file_subtitle"] = $objFile->getStrSubtitle();
     $arrDetailsTemplate["file_filename"] = $objFile->getStrFilename();
     $arrDetailsTemplate["file_size"] = bytesToString($objFile->getIntFileSize());
     $arrDetailsTemplate["file_hits"] = $objFile->getIntHits();
     $arrDetailsTemplate["file_systemid"] = $objFile->getSystemid();
     $arrDetailsTemplate["file_elementid"] = $this->arrElementData["content_id"];
     $arrDetailsTemplate["file_lmtime"] = timeToString(filemtime(_realpath_ . $objFile->getStrFilename()));
     if (validateSystemid($objFile->getOwnerId())) {
         $objUser = new class_module_user_user($objFile->getOwnerId());
         $arrDetailsTemplate["file_owner"] = $objUser->getStrUsername();
     }
     if ($objFile->rightRight2()) {
         $arrDetailsTemplate["file_link_href"] = _webpath_ . "/download.php?systemid=" . $objFile->getSystemid();
         $arrDetailsTemplate["file_link"] = "<a href=\"" . _webpath_ . "/download.php?systemid=" . $objFile->getSystemid() . "\">" . $this->getLang("download_link") . "</a>";
     }
     //if its an image, provide additional information
     $strSuffix = uniStrtolower(uniSubstr($objFile->getStrFilename(), uniStrrpos($objFile->getStrFilename(), ".")));
     if (in_array($strSuffix, $this->arrImageTypes) && isset($this->arrElementData["gallery_maxh_d"]) && isset($this->arrElementData["gallery_maxw_d"])) {
         $bitIsImage = true;
         $arrDetailsTemplate["image_src"] = $this->getImageUrl($objFile->getStrFilename(), $this->arrElementData["gallery_maxh_d"], $this->arrElementData["gallery_maxw_d"], $this->arrElementData["gallery_text"], $this->arrElementData["gallery_overlay"], $objFile->getSystemid(), $this->arrElementData["content_id"]);
     }
     $arrStripIds = $this->getNextPrevIds();
     $arrDetailsTemplate["backlink"] = $arrStripIds["backward_1"] != "" ? class_link::getLinkPortal($this->getPagename(), "", "", $this->getLang("commons_back"), "fileDetails", "", $arrStripIds["backward_1"]) : "";
     $arrDetailsTemplate["forwardlink"] = $arrStripIds["forward_1"] != "" ? class_link::getLinkPortal($this->getPagename(), "", "", $this->getLang("commons_next"), "fileDetails", "", $arrStripIds["forward_1"]) : "";
     //next /prev 3 files
     for ($intI = 1; $intI <= 3; $intI++) {
         if ($arrStripIds["forward_" . $intI] != "") {
             $objCurFile = new class_module_mediamanager_file($arrStripIds["forward_" . $intI]);
             $arrDetailsTemplate["forwardlink_" . $intI] = $this->renderFileStripEntry($objCurFile);
         }
         if ($arrStripIds["backward_" . $intI] != "") {
             $objCurFile = new class_module_mediamanager_file($arrStripIds["backward_" . $intI]);
             $arrDetailsTemplate["backlink_" . $intI] = $this->renderFileStripEntry($objCurFile);
         }
     }
     //current file
     $arrDetailsTemplate["filestrip_current"] = $this->renderFileStripEntry($objFile);
     $arrDetailsTemplate["overview"] = getLinkPortal($this->getPagename(), "", "", $this->getLang("overview"), "mediaFolder", "", $objFile->getPrevId());
     $arrDetailsTemplate["pathnavigation"] = $this->generatePathnavi(true);
     //ratings available?
     if ($objFile->getFloatRating() !== null) {
         /** @var $objRating class_module_rating_portal */
         $objRating = class_module_system_module::getModuleByName("rating")->getPortalInstanceOfConcreteModule();
         $arrDetailsTemplate["file_rating"] = $objRating->buildRatingBar($objFile->getFloatRating(), $objFile->getIntRatingHits(), $objFile->getSystemid(), $objFile->isRateableByUser(), $objFile->rightRight3());
     }
     $strTemplateID = $this->objTemplate->readTemplate("/module_mediamanager/" . $this->arrElementData["repo_template"], "filedetail");
     $strReturn = $this->fillTemplate($arrDetailsTemplate, $strTemplateID);
     //Add pe code
     $arrPeConfig = array("pe_module" => "mediamanager", "pe_action_edit" => "editFile", "pe_action_edit_params" => "&systemid=" . $objFile->getSystemid());
     $strReturn = class_element_portal::addPortalEditorCode($strReturn, $objFile->getSystemid(), $arrPeConfig);
     //set the name of the current image to the page title via class_pages
     if ($bitRegisterAdditionalTitle) {
         class_module_pages_portal::registerAdditionalTitle($objFile->getStrName());
     }
     //Update view counter
     if ($bitIsImage) {
         $objFile->increaseHits();
     }
     return $this->addPortaleditorCode($strReturn);
 }
 /**
  * Sets the passed text as an additional title information.
  * If set, the separator placeholder from global_includes.php will be included, too.
  * Modules may register additional page-titles in order to have them places as the current page-title.
  * Since this is a single field, the last module wins in case of multiple entries.
  *
  * @param string $strTitle
  *
  * @return void
  */
 public static function registerAdditionalTitle($strTitle)
 {
     self::$strAdditionalTitle = $strTitle . "%%kajonaTitleSeparator%%";
 }