示例#1
0
            echo $img;
            ?>
)"></div><?php 
        }
        echo $status_icon;
        echo \Hawkart\Megatv\CScheduleTemplate::driveNotifyMessage();
        if ($status == "recording") {
            ?>
        <div class="recording-notify">
            <div class="recording-notify-text-wrap">
                <div class="recording-notify-icon">
                </div>
                <p>Ваша любимая передача<br> поставлена на запись</p>
            </div>
        </div>
        <?php 
        }
        $content = ob_get_contents();
        ob_end_clean();
        $_arRecord = array("id" => $arRecord["ID"], "time" => $time, "date" => $date, "link" => $arRecord["DETAIL_PAGE_URL"], "name" => \Hawkart\Megatv\CScheduleTemplate::cutName(\Hawkart\Megatv\ProgTable::getName($arRecord), 35), "image" => $img, "category" => array("link" => $arResult["CATEGORIES"][$arRecord["UF_CATEGORY"]], "name" => $arRecord["UF_CATEGORY"]), "button" => $content, "status" => "status-" . $status);
        $arRecords[] = $_arRecord;
        unset($_arRecord);
    }
    //$arRecords["date"] = $date;
    echo json_encode($arRecords);
    die;
}
if (count($arResult["PROGS"]) > 0) {
    $arResult["PROGS"] = \Hawkart\Megatv\CScheduleView::setIndex(array("PROGS" => $arResult["PROGS"]));
}
$this->IncludeComponentTemplate();
示例#2
0
        $arProgs = $arChannels[$channel];
        if (!in_array($arChannel["UF_CHANNEL_BASE_ID"], $arResult["CHANNELS_SHOW"]) && $USER->IsAuthorized()) {
            continue;
        }
        foreach ($arProgs as $key => $arProg) {
            $time = substr($arProg['UF_DATE_START'], 11, 5);
            $arStatus = \Hawkart\Megatv\CScheduleTemplate::status($arProg, $arRecordsStatuses);
            $status = $arStatus["status"];
            $start = $arProg["DATE_START"];
            $end = $arProg["DATE_END"];
            $datetime = $arParams["DATETIME"]["SERVER_DATETIME_WITH_OFFSET"];
            $time_pointer = false;
            if (\CTimeEx::dateDiff($start, $datetime) && \CTimeEx::dateDiff($datetime, $end)) {
                $time_pointer = true;
            }
            $_arRecord = array("id" => $arProg["ID"], "channel_id" => $arProg["UF_CHANNEL_ID"], "time" => $time, "date" => $date, "date_start" => $arProg["DATE_START"], "date_end" => $arProg["DATE_END"], "link" => $arProg["DETAIL_PAGE_URL"], "name" => \Hawkart\Megatv\CScheduleTemplate::cutName(\Hawkart\Megatv\ProgTable::getName($arProg), 35), "images" => array('one' => \Hawkart\Megatv\CFile::getCropedPath($arProg["UF_IMG_PATH"], array(288, 288)), 'double' => \Hawkart\Megatv\CFile::getCropedPath($arProg["UF_IMG_PATH"], array(576, 288)), 'half' => \Hawkart\Megatv\CFile::getCropedPath($arProg["UF_IMG_PATH"], array(288, 144))), 'badge' => $time_pointer, "status" => "status-" . $status, "rating" => $arProg["UF_RATING"], "user_authorized" => $USER->IsAuthorized());
            foreach ($_arRecord["images"] as $type => $value) {
                $_arRecord["images"][$type . "_bad"] = SITE_TEMPLATE_PATH . "/ajax/img_grey.php?quality=1&grey=false&path=" . urlencode($_SERVER["DOCUMENT_ROOT"] . $value);
                if ($status == "viewed") {
                    $_arRecord["images"][$type] = ITE_TEMPLATE_PATH . "/ajax/img_grey.php?&path=" . urlencode($_SERVER["DOCUMENT_ROOT"] . $value);
                    $_arRecord["images"][$type . "_bad"] = str_replace("&grey=false", "", $_arRecord["images"][$type . "_bad"]);
                }
            }
            $arDates[$date][$channel][] = $_arRecord;
        }
    }
}
if ($_REQUEST["AJAX_JSON"] == "Y") {
    echo json_encode(array("CHANNELS" => $arResult["CHANNELS"], "DATES" => $arDates, "TIME" => date("Y-m-d H:i:s", strtotime(\CTimeEx::dateOffset(date("Y-m-d H:i:s"))))));
    die;
} else {