IncludeModuleLangFile(__FILE__); class CForumHTMLPresrnation { function GetChainString($items = false, $templates = false) { $arItemLast = array(); $arItems = array(); if (!is_array($items)) return false; if (!is_set($templates, "T_SEPARATOR")) $templates["T_SEPARATOR"] = " / "; if (!is_set($templates, "T_ALL_ITEMS")) $templates["T_ALL_ITEMS"] = "#TITLE#"; if (!is_set($templates, "T_LAST_ITEM")) $templates["T_LAST_ITEM"] = "#TITLE#"; $arItemLast = array_pop($items); foreach ($items as $res) $arItems[] = str_replace(array("#LINK#", "#TITLE#"), array(htmlspecialcharsbx($res["LINK"]), htmlspecialcharsbx($res["TITLE"])), $templates["T_ALL_ITEMS"]); $arItems[] = str_replace(array("#LINK#", "#TITLE#"), array(htmlspecialcharsbx($arItemLast["LINK"]), htmlspecialcharsbx($arItemLast["TITLE"])), $templates["T_LAST_ITEM"]); return implode($templates["T_SEPARATOR"], $arItems); } function ShowFilter($arForm = false, $arFields = false, $prefix = false, $arTable = array()) { $outPut = array(); $arGroupCookie = array(); $forum_cookie = COption::GetOptionString("main", "cookie_name", "BITRIX_SM")."_FORUM_FILTER"; if (!empty($_COOKIE[$forum_cookie])) { $result = explode("/", $_COOKIE[$forum_cookie]); if (!empty($result)) { foreach ($result as $res) { $res_ = explode("-", $res); $arGroupCookie[$res_[0]] = $res_[1]; } } } if ((empty($arFields)) || !is_array($arFields["params"])) return false; if ($arForm["formName"] == '') $arForm["formName"] = "form1"; if (empty($arForm["formMethod"])) $arForm["formMethod"] = "get"; $res_first = array(); $all_checkbox = true; $prefix = "f"; if (!empty($arFields["prefix"])) $prefix = $arFields["prefix"]; if (empty($arFields["visible"])) $arFields["visible"] = 2; $res_visible = array(); for ($ii = 0; $ii < $arFields["visible"]; $ii++) $res_visible[] = array_shift($arFields["params"]); $res_other = $arFields["params"]; $JSFile = ""; $prefix = preg_replace("/[^a-z0-9]/is", "_", $prefix); ob_start(); $path = str_replace(array("\\", "//"), "/", __DIR__."/interface_js.php"); include_once($path); $JSFile = ob_get_contents(); ob_end_clean(); if (!empty($res_other)) { $outPut["body"] .= '
'.$res["title"].' |
'.GetMessage("FORUM_SHOW_ALL_FILTER").' |
---|