/** * Apply textile to the main article fields * (duplicated from txp_article.php!) * @param array containing the $incoming vars array * @param global use_textile preference * @return array the same one containing the formatted fields */ function textile_main_fields($incoming, $use_textile = 1) { global $txpcfg; include_once txpath . '/lib/classTextile.php'; $textile = new Textile(); if (!empty($event) and $event == 'article') { $incoming['Title_plain'] = $incoming['Title']; } if ($incoming['textile_body'] == USE_TEXTILE) { $incoming['Title'] = $textile->TextileThis($incoming['Title'], '', 1); } $incoming['url_title'] = preg_replace('|[\\x00-\\x1f#%+/?\\x7f]|', '', $incoming['url_title']); $incoming['Body_html'] = TXP_Wrapper::format_field($incoming['Body'], $incoming['textile_body'], $textile); $incoming['Excerpt_html'] = TXP_Wrapper::format_field($incoming['Excerpt'], $incoming['textile_excerpt'], $textile); return $incoming; }
/** * Apply Textile to the main article fields. * * This is duplicated from txp_article.php. * * @param array $incoming The incoming fields * @param bool $use_textile Use Textile or not * @return array The $incoming array formatted * @access private */ public function textile_main_fields($incoming, $use_textile = 1) { global $txpcfg; $textile = new \Textpattern\Textile\Parser(); if (!empty($event) and $event == 'article') { $incoming['Title_plain'] = $incoming['Title']; } if ($incoming['textile_body'] == USE_TEXTILE) { $incoming['Title'] = $textile->textileThis($incoming['Title'], '', 1); } $incoming['url_title'] = preg_replace('|[\\x00-\\x1f#%+/?\\x7f]|', '', $incoming['url_title']); $incoming['Body_html'] = TXP_Wrapper::format_field($incoming['Body'], $incoming['textile_body'], $textile); $incoming['Excerpt_html'] = TXP_Wrapper::format_field($incoming['Excerpt'], $incoming['textile_excerpt'], $textile); return $incoming; }