コード例 #1
0
ファイル: component.php プロジェクト: Satariall/izurit
    $arParams["EDITABLE"] = false;
} else {
    $arParams["EDITABLE"] = true;
}
if ($arParams["USE_THEMES"] !== 'N' && $arParams["USE_THEMES"] !== false && CPageOption::GetOptionString("main.interface", "use_themes", "Y") !== "N") {
    $arParams["USE_THEMES"] = true;
} else {
    $arParams["USE_THEMES"] = false;
}
$arParams["GRID_ID"] = preg_replace("/[^a-z0-9_]/i", "", $arParams["GRID_ID"]);
$arResult["HEADERS"] = array();
//*********************
//get saved columns and sorting from user settings
//*********************
$grid_options = new CGridOptions($arParams["GRID_ID"]);
$aOptions = $grid_options->GetOptions();
if (!isset($aOptions["views"]["default"]["name"])) {
    $aOptions["views"]["default"]["name"] = GetMessage("interface_grid_default_view");
}
$func = create_function('$a, $b', 'return strcmp($a["name"], $b["name"]);');
uasort($aOptions["views"], $func);
$arResult["OPTIONS"] = $aOptions;
$arResult["GLOBAL_OPTIONS"] = CUserOptions::GetOption("main.interface", "global", array(), 0);
if ($arParams["USE_THEMES"]) {
    if ($arResult["GLOBAL_OPTIONS"]["theme_template"][SITE_TEMPLATE_ID] != '') {
        $arResult["GLOBAL_OPTIONS"]["theme"] = $arResult["GLOBAL_OPTIONS"]["theme_template"][SITE_TEMPLATE_ID];
    }
    if ($arResult["OPTIONS"]["theme"] == '') {
        $arResult["OPTIONS"]["theme"] = $arResult["GLOBAL_OPTIONS"]["theme"];
    }
    $arResult["OPTIONS"]["theme"] = preg_replace("/[^a-z0-9_.-]/i", "", $arResult["OPTIONS"]["theme"]);