Пример #1
0
        $str = \CDev::translit($category, "ru", array("replace_space" => "-", "replace_other" => "-"));
        $arResult["CATEGORIES"][$category] = $str;
    }
} else {
    foreach ($arResult["PROGS"] as $key => $arProg) {
        $category = $arProg["UF_CATEGORY"];
        $str = \CDev::translit($category, "ru", array("replace_space" => "-", "replace_other" => "-"));
        $arResult["CATEGORIES"][$category] = $str;
    }
}
if ($_REQUEST["AJAX"] == "Y") {
    $APPLICATION->RestartBuffer();
    /**
     * Get records statuses by user
     */
    $arRecordsStatuses = \Hawkart\Megatv\RecordTable::getListStatusesByUser();
    foreach ($arResult["PROGS"] as $key => $arProg) {
        $arProg["CAT_CODE"] = $arResult["CATEGORIES"][$arProg["UF_CATEGORY"]];
    }
    $arRecords = array();
    foreach ($arResult["PROGS"] as $arRecord) {
        $datetime = $arRecord['UF_DATE_START'];
        $date = substr($datetime, 0, 10);
        $time = substr($datetime, 11, 5);
        $arStatus = \Hawkart\Megatv\CScheduleTemplate::status($arRecord, $arRecordsStatuses);
        $status = $arStatus["status"];
        $status_icon = $arStatus["status-icon"];
        $img = \Hawkart\Megatv\CFile::getCropedPath($arRecord["UF_IMG_PATH"], array(288, 288));
        ob_start();
        if ($status == "viewed") {
            $path = $_SERVER["DOCUMENT_ROOT"] . $arProg["PICTURE"]["SRC"];