Ejemplo n.º 1
0
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$bChecked = false;
if ($arResult['FILTER_VALUES'][$arParams['FILTER_NAME'] . '_IS_ONLINE']) {
    if ($key = array_search($arParams['FILTER_NAME'] . '_IS_ONLINE', $arResult['FILTER_PARAMS'], true)) {
        $bChecked = true;
        unset($arResult['FILTER_PARAMS'][$key]);
    }
}
$arParams['LIST_URL'] .= strpos($arParams['LIST_URL'], '?') === false ? '?' : '&';
$arExtraVars = array('current_view' => $arParams['CURRENT_VIEW'], 'current_filter' => $arParams['CURRENT_FILTER']);
$extraUrl = 'set_filter_' . $arParams['FILTER_NAME'] . '=Y' . GetFilterParams($arResult['FILTER_PARAMS'], true, $arExtraVars);
// ajax mode hack - especially for complex component
if ($arParams['AJAX_MODE'] == 'Y') {
    $url = CAjax::AddSessionParam($arParams['LIST_URL'] . $extraUrl, $arParams['AJAX_ID']);
    $onclick = 'jsAjaxUtil.InsertDataToNode(\'' . CUtil::JSEscape($url) . '\' + (this.checked ? \'' . CUtil::JSEscape('&' . $arParams['FILTER_NAME'] . '_IS_ONLINE=Y') . '\' : \'\'), \'comp_' . $arParams['AJAX_ID'] . '\', ' . ($arParams['AJAX_OPTION_SHADOW'] == 'Y' ? 'true' : 'false') . ');';
} else {
    $onclick = 'window.location.href=\'' . CUtil::JSEscape($arParams['LIST_URL'] . $extraUrl) . '\' + (this.checked ? \'' . CUtil::JSEscape('&' . $arParams['FILTER_NAME'] . '_IS_ONLINE=Y') . '\' : \'\')';
}
?>
<input type="checkbox" name="<?php 
echo $arParams['FILTER_NAME'] . '_IS_ONLINE';
?>
" value="Y" <?php 
echo $bChecked ? 'checked="checked"' : '';
?>
 id="<?php 
echo $arParams['FILTER_NAME'] . '_IS_ONLINE';
?>
" title="<?php 
Ejemplo n.º 2
0
 function LocalRedirectHandler(&$url)
 {
     if (!$this->bAjaxSession) {
         return;
     }
     if ($this->__isAjaxURL($url)) {
         if (!$this->bIFrameMode) {
             Header('X-Bitrix-Ajax-Status: OK');
         }
     } else {
         if (!$this->bRestartBufferCalled) {
             ob_end_clean();
         }
         if (!$this->bIFrameMode) {
             Header('X-Bitrix-Ajax-Status: Redirect');
         }
         $this->bWrongRedirect = true;
         echo '<script type="text/javascript">' . ($this->bIFrameMode ? 'top.' : 'window.') . 'location.href = \'' . CUtil::JSEscape($url) . '\'</script>';
         require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
         exit;
     }
     $url = CAjax::AddSessionParam($url, $this->componentID);
     $this->__removeHandlers();
 }