/** * 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; }
/** * Returns a subpart from the input content stream. * A subpart is a part of the input stream which is encapsulated in a * string matching the input string, $marker. If this string is found * inside of HTML comment tags the start/end points of the content block * returned will be that right outside that comment block. * Example: The contennt string is * "Hello <!--###sub1### begin--> World. How are <!--###sub1### end--> you?" * If $marker is "###sub1###" then the content returned is * " World. How are ". The input content string could just as well have * been "Hello ###sub1### World. How are ###sub1### you?" and the result * would be the same * Wrapper for \TYPO3\CMS\Core\Html\HtmlParser::getSubpart 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]### * @return string The subpart found, if found. */ public function getSubpart($content, $marker) { return HtmlParser::getSubpart($content, $marker); }
/** * 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; }
/** * Returns a subpart from the input content stream. * A subpart is a part of the input stream which is encapsulated in a * string matching the input string, $marker. If this string is found * inside of HTML comment tags the start/end points of the content block * returned will be that right outside that comment block. * Example: The contennt string is * "Hello <!--###sub1### begin--> World. How are <!--###sub1### end--> you?" * If $marker is "###sub1###" then the content returned is * " World. How are ". The input content string could just as well have * been "Hello ###sub1### World. How are ###sub1### you?" and the result * would be the same * Wrapper for \TYPO3\CMS\Core\Html\HtmlParser::getSubpart 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]### * @return string The subpart found, if found. */ public function getSubpart($content, $marker) { return \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($content, $marker); }
/** * Sets the design to the backend design. * Backend * * @return void * @todo Define visibility */ public function setNewBEDesign() { $template = GeneralUtility::getUrl(PATH_typo3 . $this->templateFile); // Wrapping all table rows for a particular record being edited: $this->totalWrap = HtmlParser::getSubpart($template, '###TOTALWRAP###'); // Wrapping a single field: $this->fieldTemplate = HtmlParser::getSubpart($template, '###FIELDTEMPLATE###'); $this->paletteFieldTemplate = HtmlParser::getSubpart($template, '###PALETTEFIELDTEMPLATE###'); $this->palFieldTemplate = HtmlParser::getSubpart($template, '###PALETTE_FIELDTEMPLATE###'); $this->palFieldTemplateHeader = HtmlParser::getSubpart($template, '###PALETTE_FIELDTEMPLATE_HEADER###'); $this->sectionWrap = HtmlParser::getSubpart($template, '###SECTION_WRAP###'); }
/** * Gets a subpart from a template. This is just a wrapper around the getSubpart * method of the \TYPO3\CMS\Core\Html\HtmlParser class. * * @param string $template The template * @param string $subpart The subpart name * @return string The subpart */ protected function getSubpart($template, $subpart) { return \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, $subpart); }
/** * * Gets a subpart from a template. This is just a wrapper around the getSubpart * method of the \TYPO3\CMS\Core\Html\HtmlParser class. * * @param String $template The template * @param String $subpart The subpart name * @return String The subpart * */ static function getSubpart($template, $subpart) { return HtmlParser::getSubpart($template, $subpart); }
/** * 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; }
/** * 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; }
/** * Retrieves a subpart from the given html template. * * @param string $subpartName subpart marker name, can be lowercase, doesn't need the ### delimiters * @param string $alternativeTemplate * @return string the html subpart */ public function getSubpart($subpartName, $alternativeTemplate = '') { $template = $this->workOnSubpart; // set alternative template to work on if (!empty($alternativeTemplate)) { $template = $alternativeTemplate; } $subpart = HtmlParser::getSubpart($template, '###' . strtoupper($subpartName) . '###'); return $subpart; }
/** * Constructor function, setting internal variables, loading the styles used. * */ public function __construct() { $this->inlineStackProcessor = GeneralUtility::makeInstance(InlineStackProcessor::class); $this->initializeAdditionalPreviewLanguages(); // Prepare user defined objects (if any) for hooks which extend this function: $this->hookObjectsMainFields = array(); if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'] as $classRef) { $this->hookObjectsMainFields[] = GeneralUtility::getUserObj($classRef); } } $this->templateFile = 'sysext/backend/Resources/Private/Templates/FormEngine.html'; $template = GeneralUtility::getUrl(PATH_typo3 . $this->templateFile); // Wrapping all table rows for a particular record being edited: $this->totalWrap = HtmlParser::getSubpart($template, '###TOTALWRAP###'); $this->nodeFactory = GeneralUtility::makeInstance(NodeFactory::class); }
/** * 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; }
/** * Build the mail content * * @param integer $curPage Id of the current page * @param string $pageList List of pages id * @param array $markerArray Array of markers * @param array $oldBrokenLink Marker array with the number of link found * @return string Content of the mail */ protected function buildMail($curPage, $pageList, array $markerArray, array $oldBrokenLink) { $pageSectionHtml = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($this->templateMail, '###PAGE_SECTION###'); // Hook if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['buildMailMarkers'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['buildMailMarkers'] as $userFunc) { $params = array('curPage' => $curPage, 'pageList' => $pageList, 'markerArray' => $markerArray, 'oldBrokenLink' => $oldBrokenLink, 'pObj' => &$this); $newMarkers = GeneralUtility::callUserFunction($userFunc, $params, $this); if (is_array($newMarkers)) { $markerArray = GeneralUtility::array_merge($markerArray, $newMarkers); } unset($params); } } if (is_array($markerArray)) { foreach ($markerArray as $markerKey => $markerValue) { if (empty($oldBrokenLink[$markerKey])) { $oldBrokenLink[$markerKey] = 0; } if ($markerValue != $oldBrokenLink[$markerKey]) { $this->isDifferentToLastRun = TRUE; } $markerArray[$markerKey . '_old'] = $oldBrokenLink[$markerKey]; } } $markerArray['title'] = BackendUtility::getRecordTitle('pages', BackendUtility::getRecord('pages', $curPage)); $content = ''; if ($markerArray['brokenlinkCount'] > 0) { $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($pageSectionHtml, $markerArray, '###|###', TRUE, TRUE); } return $content; }
/** * 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; }
/** * 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 : ' '); // 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; }
/** * 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); }
/** * Compiles the extra form headers if the tceforms * * @return string The HTML */ public function extraFormHeaders() { $extraTemplate = ''; if (is_array($this->tceforms->extraFormHeaders)) { $extraTemplate = HtmlParser::getSubpart($this->doc->moduleTemplate, '###DOCHEADER_EXTRAHEADER###'); $extraTemplate = HtmlParser::substituteMarker($extraTemplate, '###EXTRAHEADER###', implode(LF, $this->tceforms->extraFormHeaders)); } return $extraTemplate; }