/**
  * Main function
  * The main function of this class. Loads language variables and
  * calls subsidiary functions.
  *
  * @author  Martin Helmich <*****@*****.**>
  * @version 2008-01-08
  * @return  string  The output of this script.
  */
 function main()
 {
     $this->debug('Starting message notification');
     $user_res = $this->databaseHandle->exec_SELECTquery('*', 'fe_users', 'tx_mmforum_pmnotifymode = 1 AND deleted=0 AND disable=0 AND starttime < ' . $GLOBALS['EXEC_TIME'] . ' AND (endtime = 0 OR endtime <= ' . $GLOBALS['EXEC_TIME'] . ')');
     $template = $this->loadTemplateFile('notifyPM');
     if ($this->conf['cron_htmlemail']) {
         $template = HtmlParser::getSubpart($template, '###NOTIFY_HTML###');
     } else {
         $template = HtmlParser::getSubpart($template, '###NOTIFY_PLAINTEXT###');
     }
     $itemTemplate = HtmlParser::getSubpart($template, '###NOTIFY_LISTITEM###');
     $content = '';
     while ($user_arr = $this->databaseHandle->sql_fetch_assoc($user_res)) {
         $pm_res = $this->databaseHandle->exec_SELECTquery('*', 'tx_mmforum_pminbox', 'to_uid=' . $user_arr['uid'] . ' AND notified=0 AND mess_type=0');
         $pm_content = '';
         if ($this->databaseHandle->sql_num_rows($pm_res) == 0) {
             $this->debug('No new messages for user ' . $user_arr['username'] . '. Continue with next user.');
             continue;
         } else {
             $this->debug($this->databaseHandle->sql_num_rows($pm_res) . ' new messages for user ' . $user_arr['username'] . '. Creating email.');
         }
         while ($pm_arr = $this->databaseHandle->sql_fetch_assoc($pm_res)) {
             $link = sprintf($this->conf['cron_pm_readlink'], $pm_arr['uid']);
             $cache_link = $this->getCacheValue_remove('pm.urlCache.' . $pm_arr['uid']);
             if ($cache_link !== false) {
                 $link = $cache_link;
             }
             $pm_marker = array('###NOTIFY_SUBJECT###' => $pm_arr['subject'], '###NOTIFY_DATE###' => $this->formatDate($pm_arr['sendtime']), '###NOTIFY_SENDER###' => $this->getUsername($pm_arr['from_uid']), '###NOTIFY_LINK###' => $link, '###LLL_BY###' => $this->getLL('by'), '###LLL_ON###' => $this->getLL('on'));
             $pm_content .= HtmlParser::substituteMarkerArray($itemTemplate, $pm_marker);
         }
         $user_content = HtmlParser::substituteSubpart($template, '###NOTIFY_LISTITEM###', $pm_content);
         $user_marker = array('###NOTIFY_SUBJECT###' => sprintf($this->getLL('subject'), $this->databaseHandle->sql_num_rows($pm_res)), '###NOTIFY_TEXT###' => sprintf($this->getLL('text'), $this->conf['cron_sitetitle'], $this->databaseHandle->sql_num_rows($pm_res)), '###NOTIFY_ADDRESS###' => sprintf($this->getLL('address'), $user_arr[$this->conf['userNameField'] ? $this->conf['userNameField'] : 'username']), '###NOTIFY_LINK###' => $this->conf['cron_pm_link'], '###LABEL_NOTIFY_SUBJECT###' => $this->getLL('subject'), '###LABEL_NOTIFY_SENDER###' => $this->getLL('sender'), '###LABEL_NOTIFY_DATE###' => $this->getLL('date'));
         $user_content = HtmlParser::substituteMarkerArray($user_content, $user_marker);
         $subject = sprintf($this->getLL('mailSubject'), $this->conf['cron_sitetitle'], $this->databaseHandle->sql_num_rows($pm_res));
         $username = $user_arr['name'] ? $user_arr['name'] : $user_arr['username'];
         $recipient = '"' . $username . '" <' . $user_arr['email'] . '>';
         $contenttype = $this->conf['cron_htmlemail'] ? 'text/html' : 'text/plain';
         $header = "Content-Type: {$contenttype}; charset=utf-8\n";
         $header .= "From: " . $this->conf['cron_notifyPublishSender'] . "\n";
         $content .= "Try to send mail({$recipient}, {$subject}, ...)\n";
         if (!@mail($recipient, $subject, $user_content, $header)) {
             $this->debug('Could not send email to ' . $recipient, $this->DEBUG_ERROR);
         } else {
             $this->debug('Email to user ' . $user_arr['username'] . ' was successfully sent.');
         }
     }
     $updateArray = array('notified' => 1, 'tstamp' => $GLOBALS['EXEC_TIME']);
     $this->databaseHandle->exec_UPDATEquery('tx_mmforum_pminbox', 'notified=0', $updateArray);
     $this->content = $content;
 }
Ejemplo n.º 2
0
 /**
  * Builds the checkboxes out of the hooks array
  *
  * @param array $brokenLinkOverView Array of broken links information
  * @param string $prefix
  * @return string code content
  */
 protected function getCheckOptions(array $brokenLinkOverView, $prefix = '')
 {
     $markerArray = array();
     if (!empty($prefix)) {
         $additionalAttr = ' class="' . $prefix . '"';
     } else {
         $additionalAttr = ' class="refresh"';
     }
     $checkOptionsTemplate = HtmlParser::getSubpart($this->doc->moduleTemplate, '###CHECKOPTIONS_SECTION###');
     $hookSectionTemplate = HtmlParser::getSubpart($checkOptionsTemplate, '###HOOK_SECTION###');
     $markerArray['statistics_header'] = $this->doc->sectionHeader($this->getLanguageService()->getLL('report.statistics.header'));
     $markerArray['total_count_label'] = BackendUtility::wrapInHelp('linkvalidator', 'checkboxes', $this->getLanguageService()->getLL('overviews.nbtotal'));
     $markerArray['total_count'] = $brokenLinkOverView['brokenlinkCount'] ?: '0';
     $linktypes = GeneralUtility::trimExplode(',', $this->modTS['linktypes'], TRUE);
     $hookSectionContent = '';
     if (is_array($linktypes)) {
         if (!empty($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) {
             foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $type => $value) {
                 if (in_array($type, $linktypes)) {
                     $hookSectionMarker = array('count' => $brokenLinkOverView[$type] ?: '0');
                     $translation = $this->getLanguageService()->getLL('hooks.' . $type) ?: $type;
                     $hookSectionMarker['option'] = '<input type="checkbox"' . $additionalAttr . ' id="' . $prefix . 'SET_' . $type . '" name="' . $prefix . 'SET[' . $type . ']" value="1"' . ($this->pObj->MOD_SETTINGS[$type] ? ' checked="checked"' : '') . '/>' . '<label for="' . $prefix . 'SET_' . $type . '">' . htmlspecialchars($translation) . '</label>';
                     $hookSectionContent .= HtmlParser::substituteMarkerArray($hookSectionTemplate, $hookSectionMarker, '###|###', TRUE, TRUE);
                 }
             }
         }
     }
     $checkOptionsTemplate = HtmlParser::substituteSubpart($checkOptionsTemplate, '###HOOK_SECTION###', $hookSectionContent);
     return HtmlParser::substituteMarkerArray($checkOptionsTemplate, $markerArray, '###|###', TRUE, TRUE);
 }
Ejemplo n.º 3
0
 /**
  * Returns HTML-code, which is a visual representation of a multidimensional array
  * Returns FALSE if $array_in is not an array
  *
  * @param mixed $incomingValue Array to view
  * @return string HTML output
  * @todo Define visibility
  */
 public function viewArray($incomingValue)
 {
     // Get the template file
     $templateFile = @file_get_contents(PATH_site . $this->templateFilePath . 'ViewArray.html');
     if (is_array($incomingValue) && !empty($incomingValue)) {
         // Get the template part from the file
         $content = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($templateFile, '###TEMPLATE###');
         // Get the subpart for a single item
         $itemSubpart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($content, '###ITEM###');
         foreach ($incomingValue as $key => $value) {
             if (is_array($value)) {
                 $description = $this->viewArray($value);
             } elseif (is_object($value)) {
                 $description = get_class($value);
                 if (method_exists($value, '__toString')) {
                     $description .= ': ' . (string) $value;
                 }
             } else {
                 if (gettype($value) == 'object') {
                     $description = 'Unknown object';
                 } else {
                     $description = htmlspecialchars((string) $value);
                 }
             }
             // Define the markers content
             $itemMarkers = array('key' => htmlspecialchars((string) $key), 'description' => !empty($description) ? $description : '&nbsp;');
             // Fill the markers in the subpart
             $items[] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($itemSubpart, $itemMarkers, '###|###', TRUE, FALSE);
         }
         // Substitute the subpart for single item
         $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($content, '###ITEM###', implode(LF, $items));
     }
     return $content;
 }
Ejemplo n.º 4
0
 /**
  * Substitute subpart in input template stream.
  * This function substitutes a subpart in $content with the content of
  * $subpartContent.
  * Wrapper for \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart which behaves identical
  *
  * @param string $content The content stream, typically HTML template content.
  * @param string $marker The marker string, typically on the form "###[the marker string]###
  * @param mixed $subpartContent The content to insert instead of the subpart found. If a string, then just plain substitution happens (includes removing the HTML comments of the subpart if found). If $subpartContent happens to be an array, it's [0] and [1] elements are wrapped around the EXISTING content of the subpart (fetched by getSubpart()) thereby not removing the original content.
  * @param bool $recursive If $recursive is set, the function calls itself with the content set to the remaining part of the content after the second marker. This means that proceding subparts are ALSO substituted!
  * @return string The processed HTML content string.
  */
 public function substituteSubpart($content, $marker, $subpartContent, $recursive = 1)
 {
     return HtmlParser::substituteSubpart($content, $marker, $subpartContent, $recursive);
 }
Ejemplo n.º 5
0
 /**
  * Fill the button lists with the defined HTML
  *
  * @param array $buttons HTML for all buttons
  * @return array Containing HTML for both buttonlists
  */
 protected function getDocHeaderButtons($buttons)
 {
     $markers = array();
     // Fill buttons for left and right float
     $floats = array('left', 'right');
     foreach ($floats as $key) {
         // Get the template for each float
         $buttonTemplate = HtmlParser::getSubpart($this->moduleTemplate, '###BUTTON_GROUPS_' . strtoupper($key) . '###');
         // Fill the button markers in this float
         $buttonTemplate = HtmlParser::substituteMarkerArray($buttonTemplate, $buttons, '###|###', TRUE);
         // getting the wrap for each group
         $buttonWrap = HtmlParser::getSubpart($this->moduleTemplate, '###BUTTON_GROUP_WRAP###');
         // looping through the groups (max 6) and remove the empty groups
         for ($groupNumber = 1; $groupNumber < 6; $groupNumber++) {
             $buttonMarker = '###BUTTON_GROUP' . $groupNumber . '###';
             $buttonGroup = HtmlParser::getSubpart($buttonTemplate, $buttonMarker);
             if (trim($buttonGroup)) {
                 if ($buttonWrap) {
                     $buttonGroup = HtmlParser::substituteMarker($buttonWrap, '###BUTTONS###', $buttonGroup);
                 }
                 $buttonTemplate = HtmlParser::substituteSubpart($buttonTemplate, $buttonMarker, trim($buttonGroup));
             }
         }
         // Replace the marker with the template and remove all line breaks (for IE compat)
         $markers['BUTTONLIST_' . strtoupper($key)] = str_replace(LF, '', $buttonTemplate);
     }
     // Hook for manipulating docHeaderButtons
     if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'])) {
         $params = array('buttons' => $buttons, 'markers' => &$markers, 'pObj' => &$this);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['docHeaderButtonsHook'] as $funcRef) {
             GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     return $markers;
 }
Ejemplo n.º 6
0
 /**
  * Substitute subpart in input template stream.
  * This function substitutes a subpart in $content with the content of
  * $subpartContent.
  * Wrapper for \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart which behaves identical
  *
  * @param string $content The content stream, typically HTML template content.
  * @param string $marker The marker string, typically on the form "###[the marker string]###
  * @param mixed $subpartContent The content to insert instead of the subpart found. If a string, then just plain substitution happens (includes removing the HTML comments of the subpart if found). If $subpartContent happens to be an array, it's [0] and [1] elements are wrapped around the EXISTING content of the subpart (fetched by getSubpart()) thereby not removing the original content.
  * @param boolean $recursive If $recursive is set, the function calls itself with the content set to the remaining part of the content after the second marker. This means that proceding subparts are ALSO substituted!
  * @return string The processed HTML content string.
  */
 public function substituteSubpart($content, $marker, $subpartContent, $recursive = 1)
 {
     return \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($content, $marker, $subpartContent, $recursive);
 }
Ejemplo n.º 7
0
 /**
  * Replaces a subpart in a template with content. This is just a wrapper method
  * around the substituteSubpart method of the \TYPO3\CMS\Core\Html\HtmlParser class.
  *
  * @param  string $template The tempalte
  * @param  string $subpart  The subpart name
  * @param  string $replace  The subpart content
  * @return string           The template with replaced subpart.
  */
 protected function substituteSubpart($template, $subpart, $replace)
 {
     return \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($template, $subpart, $replace);
 }
Ejemplo n.º 8
0
 /**
  *
  * Replaces a subpart in a template with content. This is just a wrapper method
  * around the substituteSubpart method of the \TYPO3\CMS\Core\Html\HtmlParser class.
  *
  * @param  String $template The tempalte
  * @param  String $subpart  The subpart name
  * @param  String $replace  The subpart content
  * @return String           The template with replaced subpart.
  *
  */
 static function substituteSubpart($template, $subpart, $replace)
 {
     return HtmlParser::substituteSubpart($template, $subpart, $replace);
 }
 /**
  * Generates the notification email content.
  * This function generates the content of the notification email that is to
  * be sent. The result of this function is stored into the attribute $this->postqueueMail.
  *
  * @author  Martin Helmich <*****@*****.**>
  * @version 2008-06-22
  * @return  void
  */
 function generateOutput()
 {
     $template = $this->loadTemplateFile('notifyPublish');
     if ($this->conf['cron_htmlemail']) {
         $template = HtmlParser::getSubpart($template, '###PNOTIFY_HTML###');
     } else {
         $template = HtmlParser::getSubpart($template, '###PNOTIFY_PLAINTEXT###');
     }
     $itemTemplate = HtmlParser::getSubpart($template, '###PNOTIFY_LISTITEM###');
     $marker = array('###PNOTIFY_SUBJECT###' => sprintf($this->getLL('subject'), count($this->postqueueItems)), '###PNOTIFY_TEXT###' => sprintf($this->getLL('text'), $this->conf['cron_sitetitle'], count($this->postqueueItems)), '###PNOTIFY_LINK###' => $this->conf['cron_postqueue_link'], '###LABEL_PNOTIFY_TOPICTITLE###' => $this->getLL('topictitle'), '###LABEL_PNOTIFY_TOPICDATE###' => $this->getLL('topicdate'), '###LABEL_PNOTIFY_TOPICAUTHOR###' => $this->getLL('topicauthor'), '###LABEL_PNOTIFY_TOPICFORUM###' => $this->getLL('topicforum'));
     $template = HtmlParser::substituteMarkerArray($template, $marker);
     $itemContent = '';
     foreach ($this->postqueueItems as $postqueueItem) {
         $itemMarker = array('###PNOTIFY_TOPICTITLE###' => $this->getTopicTitle($postqueueItem), '###PNOTIFY_TOPICAUTHOR###' => $this->getTopicAuthor($postqueueItem['post_user']), '###PNOTIFY_TOPICDATE###' => date('d. m. Y, H:i', $postqueueItem['post_time']), '###PNOTIFY_TOPICFORUM###' => $this->getTopicForum($postqueueItem));
         $itemContent .= HtmlParser::substituteMarkerArray($itemTemplate, $itemMarker);
     }
     $template = HtmlParser::substituteSubpart($template, '###PNOTIFY_LISTITEM###', $itemContent);
     $this->postqueueMail = $template;
 }
Ejemplo n.º 10
0
 /**
  * Processes conditions: finds and evaluates them in HTML code.
  *
  * @param string $content HTML
  * @return string
  */
 protected function processConditions($content)
 {
     // find conditions
     $conditions = $this->findConditions($content);
     // evaluate conditions
     foreach ($conditions as $condition) {
         if ($this->isVariableMarker($condition['comparand1']) || $this->isVariableMarker($condition['comparand2'])) {
             // unresolved marker => skip, will be resolved later
             continue;
         }
         $conditionResult = $this->evaluateCondition($condition['comparand1'], $condition['comparand2'], $condition['operator']);
         if ($conditionResult) {
             // if condition evaluates to TRUE, simply replace it with
             // the original content to have the surrounding markers removed
             $content = HtmlParser::substituteSubpart($content, $condition['marker'], $condition['content']);
         } else {
             // if condition evaluates to FALSE, remove the content from the template
             $content = HtmlParser::substituteSubpart($content, $condition['marker'], '');
         }
     }
     return $content;
 }
Ejemplo n.º 11
0
 /**
  * Make login news - renders the HTML content for a list of news shown under
  * the login form. News data is added through sys_news records
  *
  * @return string HTML content
  * @credits Idea by Jan-Hendrik Heuing
  * @todo Define visibility
  */
 public function makeLoginNews()
 {
     $newsContent = '';
     $systemNews = $this->getSystemNews();
     // Traverse news array IF there are records in it:
     if (is_array($systemNews) && count($systemNews) && !GeneralUtility::_GP('loginRefresh')) {
         /** @var $htmlParser \TYPO3\CMS\Core\Html\RteHtmlParser */
         $htmlParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\RteHtmlParser');
         $htmlParser->procOptions['dontHSC_rte'] = TRUE;
         // Get the main news template, and replace the subpart after looped through
         $newsContent = HtmlParser::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###LOGIN_NEWS###');
         $newsItemTemplate = HtmlParser::getSubpart($newsContent, '###NEWS_ITEM###');
         $newsItem = '';
         $count = 1;
         foreach ($systemNews as $newsItemData) {
             $additionalClass = '';
             if ($count == 1) {
                 $additionalClass = ' first-item';
             } elseif ($count == count($systemNews)) {
                 $additionalClass = ' last-item';
             }
             $newsItemContent = $htmlParser->TS_transform_rte($htmlParser->TS_links_rte($newsItemData['content']));
             $newsItemMarker = array('###HEADER###' => htmlspecialchars($newsItemData['header']), '###DATE###' => htmlspecialchars($newsItemData['date']), '###CONTENT###' => $newsItemContent, '###CLASS###' => $additionalClass);
             $count++;
             $newsItem .= HtmlParser::substituteMarkerArray($newsItemTemplate, $newsItemMarker);
         }
         $title = $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] : $GLOBALS['LANG']->getLL('newsheadline');
         $newsContent = HtmlParser::substituteMarker($newsContent, '###NEWS_HEADLINE###', htmlspecialchars($title));
         $newsContent = HtmlParser::substituteSubpart($newsContent, '###NEWS_ITEM###', $newsItem);
     }
     return $newsContent;
 }
Ejemplo n.º 12
0
 /**
  * Build and send warning email when new broken links were found
  *
  * @param string $pageSections Content of page section
  * @param array $modTsConfig TSconfig array
  * @return boolean TRUE if mail was sent, FALSE if or not
  * @throws \Exception if required modTsConfig settings are missing
  */
 protected function reportEmail($pageSections, array $modTsConfig)
 {
     $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($this->templateMail, '###PAGE_SECTION###', $pageSections);
     /** @var array $markerArray */
     $markerArray = array();
     /** @var array $validEmailList */
     $validEmailList = array();
     /** @var boolean $sendEmail */
     $sendEmail = TRUE;
     $markerArray['totalBrokenLink'] = $this->totalBrokenLink;
     $markerArray['totalBrokenLink_old'] = $this->oldTotalBrokenLink;
     // Hook
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['reportEmailMarkers'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['reportEmailMarkers'] as $userFunc) {
             $params = array('pObj' => &$this, 'markerArray' => $markerArray);
             $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this);
             if (is_array($newMarkers)) {
                 $markerArray = GeneralUtility::array_merge($markerArray, $newMarkers);
             }
             unset($params);
         }
     }
     $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($content, $markerArray, '###|###', TRUE, TRUE);
     /** @var $mail \TYPO3\CMS\Core\Mail\MailMessage */
     $mail = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage');
     if (empty($modTsConfig['mail.']['fromemail'])) {
         $modTsConfig['mail.']['fromemail'] = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFromAddress();
     }
     if (empty($modTsConfig['mail.']['fromname'])) {
         $modTsConfig['mail.']['fromname'] = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFromName();
     }
     if (GeneralUtility::validEmail($modTsConfig['mail.']['fromemail'])) {
         $mail->setFrom(array($modTsConfig['mail.']['fromemail'] => $modTsConfig['mail.']['fromname']));
     } else {
         throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.invalidFromEmail'), '1295476760');
     }
     if (GeneralUtility::validEmail($modTsConfig['mail.']['replytoemail'])) {
         $mail->setReplyTo(array($modTsConfig['mail.']['replytoemail'] => $modTsConfig['mail.']['replytoname']));
     }
     if (!empty($modTsConfig['mail.']['subject'])) {
         $mail->setSubject($modTsConfig['mail.']['subject']);
     } else {
         throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.noSubject'), '1295476808');
     }
     if (!empty($this->email)) {
         $emailList = GeneralUtility::trimExplode(',', $this->email);
         foreach ($emailList as $emailAdd) {
             if (!GeneralUtility::validEmail($emailAdd)) {
                 throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:linkvalidator/Resources/Private/Language/locallang.xlf:tasks.error.invalidToEmail'), '1295476821');
             } else {
                 $validEmailList[] = $emailAdd;
             }
         }
     }
     if (is_array($validEmailList) && !empty($validEmailList)) {
         $mail->setTo($validEmailList);
     } else {
         $sendEmail = FALSE;
     }
     if ($sendEmail) {
         $mail->setBody($content, 'text/html');
         $mail->send();
     }
     return $sendEmail;
 }
Ejemplo n.º 13
0
 /**
  * Processes helpers IF : finds and evaluates them in HTML code.
  * Example : ###IF:_VAR|%|2### (underscore with a template var)
  * Example : ###IF:10|%|2###
  *
  * @param array  $templateMarkers
  * @param string $content
  * @param array  $viewHelperArgumentLists
  * @return string
  */
 protected function processHelpersIf($templateMarkers, $content, $viewHelperArgumentLists)
 {
     foreach ($viewHelperArgumentLists as $viewHelperArgument) {
         $explodeViewHelperArguments = explode('|', preg_replace('/\\_(\\w*)/', '###$1###', $viewHelperArgument));
         $comparand1 = strpos($explodeViewHelperArguments[0], '#') !== false ? $templateMarkers[$explodeViewHelperArguments[0]] : $explodeViewHelperArguments[0];
         $comparand2 = strpos($explodeViewHelperArguments[2], '#') !== false ? $templateMarkers[$explodeViewHelperArguments[2]] : $explodeViewHelperArguments[2];
         $operator = $explodeViewHelperArguments[1];
         if ($this->evaluateCondition($comparand1, $comparand2, $operator)) {
             $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($content, '###IF:' . $viewHelperArgument . '###', \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($content, '###IF:' . $viewHelperArgument . '###'));
         } else {
             $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($content, '###IF:' . $viewHelperArgument . '###', '');
         }
     }
     return $content;
 }
 /**
  * Generates the notification email content.
  * This function generates the content of the notification email that is to
  * be sent. The result of this function is stored into the attribute $this->postalertMail.
  *
  * @author  Martin Helmich <*****@*****.**>
  * @version 2008-06-22
  * @return  void
  */
 function generateOutput()
 {
     $template = $this->loadTemplateFile('notifyReported');
     if ($this->conf['cron_htmlemail']) {
         $template = HtmlParser::getSubpart($template, '###PNOTIFY_HTML###');
     } else {
         $template = HtmlParser::getSubpart($template, '###PNOTIFY_PLAINTEXT###');
     }
     $itemTemplate = HtmlParser::getSubpart($template, '###PNOTIFY_LISTITEM###');
     $marker = array('###PNOTIFY_SUBJECT###' => sprintf($this->getLL('subject'), count($this->postalertItems)), '###PNOTIFY_TEXT###' => sprintf($this->getLL('text'), $this->conf['cron_sitetitle'], count($this->postalertItems)), '###PNOTIFY_LINK###' => $this->conf['cron_alertqueue_link'], '###LABEL_PNOTIFY_TOPICTITLE###' => $this->getLL('topictitle'), '###LABEL_PNOTIFY_REPORTDATE###' => $this->getLL('reportdate'), '###LABEL_PNOTIFY_TOPICAUTHOR###' => $this->getLL('topicauthor'), '###LABEL_PNOTIFY_TOPICFORUM###' => $this->getLL('topicforum'), '###LABEL_PNOTIFY_TOPICREPORTER###' => $this->getLL('postreporter'), '###LABEL_PNOTIFY_ALERTTEXT###' => $this->getLL('alerttext'), '###LABEL_PNOTIFY_POSTCONTENT###' => $this->getLL('reportedcontent'));
     $template = HtmlParser::substituteMarkerArray($template, $marker);
     $itemContent = '';
     foreach ($this->postalertItems as $postalertItem) {
         $itemMarker = array('###PNOTIFY_TOPICTITLE###' => $this->getTopicTitle($postalertItem['topic_id']), '###PNOTIFY_TOPICAUTHOR###' => $this->getPostAuthor($postalertItem['post_id']), '###PNOTIFY_TOPICREPORTER###' => $this->getUsername($postalertItem['cruser_id']), '###PNOTIFY_REPORTDATE###' => date('d. m. Y, H:i', $postalertItem['crdate']), '###PNOTIFY_TOPICFORUM###' => $this->getTopicForum($postalertItem['topic_id']), '###PNOTIFY_POSTCONTENT###' => $this->getPostContent($postalertItem['post_id']), '###PNOTIFY_ALERTTEXT###' => stripslashes($postalertItem['alert_text']), '###LABEL_PNOTIFY_ALERTTEXT###' => $this->getLL('alerttext'), '###LABEL_PNOTIFY_POSTCONTENT###' => $this->getLL('reportedcontent'));
         $itemContent .= HtmlParser::substituteMarkerArray($itemTemplate, $itemMarker);
     }
     $template = HtmlParser::substituteSubpart($template, '###PNOTIFY_LISTITEM###', $itemContent);
     $this->postalertMail = $template;
 }