function article_transform_ste($article, $lang) { global $rel_path_to_root; $languages = array(); $a_section = $article->get_section(); foreach ($article->title as $language => $_) { $languages[$language] = "{$rel_path_to_root}/{$language}/{$a_section->name}/{$article->urlname}"; } return array("id" => $article->get_id(), "urlname" => $article->urlname, "fullurl" => htmlesc("{$rel_path_to_root}/{$lang}/{$a_section->name}/{$article->urlname}"), "title" => htmlesc($article->title[$lang]->text), "text" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->text[$lang]->text), $article->text[$lang]->texttype), "excerpt" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->excerpt[$lang]->text), $article->excerpt[$lang]->texttype), "custom" => $article->custom, "status" => $article->status, "section" => section_transform_ste($a_section, $lang), "timestamp" => $article->timestamp, "tags" => array_filter(array_map(function ($tag) use($lang) { return tag_transform_ste($tag, $lang); }, $article->get_tags())), "languages" => $languages, "comments_allowed" => $article->allow_comments, "__obj" => $article); }
public static function htmlize_comment_text($text) { global $ratatoeskr_settings; return kses(textprocessor_apply($text, $ratatoeskr_settings["comment_textprocessor"]), array("a" => array("href" => 1, "hreflang" => 1, "title" => 1, "rel" => 1, "rev" => 1), "b" => array(), "i" => array(), "u" => array(), "strong" => array(), "em" => array(), "p" => array("align" => 1), "br" => array(), "abbr" => array(), "acronym" => array(), "code" => array(), "pre" => array(), "blockquote" => array("cite" => 1), "h1" => array(), "h2" => array(), "h3" => array(), "h4" => array(), "h5" => array(), "h6" => array(), "img" => array("src" => 1, "alt" => 1, "width" => 1, "height" => 1), "s" => array(), "q" => array("cite" => 1), "samp" => array(), "ul" => array(), "ol" => array(), "li" => array(), "del" => array(), "ins" => array(), "dl" => array(), "dd" => array(), "dt" => array(), "dfn" => array(), "div" => array(), "dir" => array(), "kbd" => array("prompt" => 1), "strike" => array(), "sub" => array(), "sup" => array(), "table" => array("style" => 1), "tbody" => array(), "thead" => array(), "tfoot" => array(), "tr" => array(), "td" => array("colspan" => 1, "rowspan" => 1), "th" => array("colspan" => 1, "rowspan" => 1), "tt" => array(), "var" => array())); }
function textprocessor_apply_translation($translationobj) { return textprocessor_apply($translationobj->text, $translationobj->texttype); }