Exemple #1
0
echo GetMessage("MAIN_SITE_LANG");
?>
</td>
		<td><?php 
echo CLanguage::SelectBox("LANGUAGE_ID", $str_LANGUAGE_ID);
?>
</td>
	</tr>
	<tr class="adm-detail-required-field">
		<td><?php 
echo GetMessage("site_edit_culture");
?>
</td>
		<td>
<?php 
$cultureRes = \Bitrix\Main\Localization\CultureTable::getList(array('order' => array('NAME' => 'ASC')));
$cultures = array();
while ($cult = $cultureRes->fetch()) {
    $cult["WEEK_START"] = GetMessage('DAY_OF_WEEK_' . $cult["WEEK_START"]);
    $cult["DIRECTION"] = $cult["DIRECTION"] == "Y" ? GetMessage('DIRECTION_LTR') : GetMessage('DIRECTION_RTL');
    $cultures[] = $cult;
}
?>
<script type="text/javascript">
function BXSetCulture()
{
	var selObj = BX('bx_culture_select');
	var form = selObj.form;
	var cultures = <?php 
echo CUtil::PhpToJSObject($cultures);
?>
Exemple #2
0
        switch ($request['action_button']) {
            case "delete":
                $result = CultureTable::delete($ID);
                if (!$result->isSuccess()) {
                    $adminList->AddGroupError("(ID=" . $ID . ") " . implode("<br>", $result->getErrorMessages()), $ID);
                }
                break;
        }
    }
}
$APPLICATION->SetTitle(Loc::getMessage("TITLE"));
/**
 * @global $by
 * @global $order
 */
$cultureList = CultureTable::getList(array('order' => array(strtoupper($by) => $order)));
$data = new CAdminResult($cultureList, $tableID);
$data->NavStart();
$adminList->NavText($data->GetNavPrint(Loc::getMessage("PAGES"), false));
$adminList->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("NAME"), "sort" => "NAME", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("culture_code"), "sort" => "CODE", "default" => true), array("id" => "FORMAT_DATE", "content" => Loc::getMessage("culture_date"), "sort" => "FORMAT_DATE", "default" => true), array("id" => "FORMAT_DATETIME", "content" => Loc::getMessage("culture_datetime"), "sort" => "FORMAT_DATETIME", "default" => true), array("id" => "FORMAT_NAME", "content" => Loc::getMessage("culture_name"), "sort" => "FORMAT_NAME", "default" => true), array("id" => "CHARSET", "content" => Loc::getMessage("culture_charset"), "sort" => "CHARSET", "default" => true), array("id" => "WEEK_START", "content" => Loc::getMessage("culture_week"), "sort" => "WEEK_START", "default" => false), array("id" => "DIRECTION", "content" => Loc::getMessage("culture_direction"), "sort" => "DIRECTION", "default" => false)));
$days = array(Loc::getMessage("culture_su"), Loc::getMessage("culture_mo"), Loc::getMessage("culture_tu"), Loc::getMessage("culture_we"), Loc::getMessage("culture_th"), Loc::getMessage("culture_fr"), Loc::getMessage("culture_sa"));
while ($culture = $data->Fetch()) {
    $id = htmlspecialcharsbx($culture["ID"]);
    $name = htmlspecialcharsbx($culture["NAME"]);
    $row =& $adminList->AddRow($id, $culture, "culture_edit.php?ID=" . $id . "&lang=" . LANGUAGE_ID, Loc::getMessage("LANG_EDIT_TITLE"));
    $row->AddViewField("ID", $id);
    $row->AddField("NAME", '<a href="culture_edit.php?ID=' . $id . '&amp;lang=' . LANGUAGE_ID . '" title="' . Loc::getMessage("LANG_EDIT_TITLE") . '">' . $name . '</a>', $name);
    $row->AddInputField("CODE");
    $row->AddInputField("FORMAT_DATE");
    $row->AddInputField("FORMAT_DATETIME");
    $row->AddInputField("FORMAT_NAME");
Exemple #3
0
echo GetMessage("MAIN_SITE_LANG");
?>
</td>
		<td><?php 
echo CLanguage::SelectBox("LANGUAGE_ID", $str_LANGUAGE_ID);
?>
</td>
	</tr>
	<tr class="adm-detail-required-field">
		<td><?php 
echo GetMessage("site_edit_culture");
?>
</td>
		<td>
<?php 
$cultureRes = \Bitrix\Main\Localization\CultureTable::getList(array('order' => array('name' => 'asc')));
$cultures = array();
while ($cult = $cultureRes->fetch()) {
    $cult["WEEK_START"] = GetMessage('DAY_OF_WEEK_' . $cult["WEEK_START"]);
    $cult["DIRECTION"] = $cult["DIRECTION"] == "Y" ? GetMessage('DIRECTION_LTR') : GetMessage('DIRECTION_RTL');
    $cultures[] = $cult;
}
?>
<script type="text/javascript">
function BXSetCulture()
{
	var selObj = BX('bx_culture_select');
	var form = selObj.form;
	var cultures = <?php 
echo CUtil::PhpToJSObject($cultures);
?>
        switch ($_REQUEST['action']) {
            case "delete":
                $result = CultureTable::delete($ID);
                if (!$result->isSuccess()) {
                    $adminList->AddGroupError("(ID=" . $ID . ") " . implode("<br>", $result->getErrorMessages()), $ID);
                }
                break;
        }
    }
}
$APPLICATION->SetTitle(Loc::getMessage("TITLE"));
/**
 * @global $by
 * @global $order
 */
$cultureList = CultureTable::getList(array('order' => array($by => $order)));
$data = new CAdminResult($cultureList, $tableID);
$data->NavStart();
$adminList->NavText($data->GetNavPrint(Loc::getMessage("PAGES"), false));
$adminList->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("NAME"), "sort" => "name", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("culture_code"), "sort" => "CODE", "default" => true), array("id" => "FORMAT_DATE", "content" => Loc::getMessage("culture_date"), "sort" => "FORMAT_DATE", "default" => true), array("id" => "FORMAT_DATETIME", "content" => Loc::getMessage("culture_datetime"), "sort" => "FORMAT_DATETIME", "default" => true), array("id" => "FORMAT_NAME", "content" => Loc::getMessage("culture_name"), "sort" => "FORMAT_NAME", "default" => true), array("id" => "CHARSET", "content" => Loc::getMessage("culture_charset"), "sort" => "CHARSET", "default" => true), array("id" => "WEEK_START", "content" => Loc::getMessage("culture_week"), "sort" => "WEEK_START", "default" => false), array("id" => "DIRECTION", "content" => Loc::getMessage("culture_direction"), "sort" => "DIRECTION", "default" => false)));
$days = array(Loc::getMessage("culture_su"), Loc::getMessage("culture_mo"), Loc::getMessage("culture_tu"), Loc::getMessage("culture_we"), Loc::getMessage("culture_th"), Loc::getMessage("culture_fr"), Loc::getMessage("culture_sa"));
while ($culture = $data->Fetch()) {
    $id = htmlspecialcharsbx($culture["ID"]);
    $name = htmlspecialcharsbx($culture["NAME"]);
    $row =& $adminList->AddRow($id, $culture, "culture_edit.php?ID=" . $id . "&lang=" . LANGUAGE_ID, Loc::getMessage("LANG_EDIT_TITLE"));
    $row->AddViewField("ID", $id);
    $row->AddField("NAME", '<a href="culture_edit.php?ID=' . $id . '&amp;lang=' . LANGUAGE_ID . '" title="' . Loc::getMessage("LANG_EDIT_TITLE") . '">' . $name . '</a>', $name);
    $row->AddInputField("CODE");
    $row->AddInputField("FORMAT_DATE");
    $row->AddInputField("FORMAT_DATETIME");
    $row->AddInputField("FORMAT_NAME");
            case "delete":
                $result = CultureTable::delete($ID);
                if (!$result->isSuccess()) {
                    $adminList->AddGroupError("(ID=" . $ID . ") " . implode("<br>", $result->getErrorMessages()), $ID);
                }
                break;
        }
    }
}
$APPLICATION->SetTitle(Loc::getMessage("TITLE"));
/**
 * @global $by
 * @global $order
 */
$nav = new \Bitrix\Main\UI\AdminPageNavigation("nav-culture");
$cultureList = CultureTable::getList(array('order' => array(strtoupper($by) => $order), 'count_total' => true, 'offset' => $nav->getOffset(), 'limit' => $nav->getLimit()));
$nav->setRecordCount($cultureList->getCount());
$adminList->setNavigation($nav, Loc::getMessage("PAGES"));
$adminList->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("NAME"), "sort" => "NAME", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("culture_code"), "sort" => "CODE", "default" => true), array("id" => "FORMAT_DATE", "content" => Loc::getMessage("culture_date"), "sort" => "FORMAT_DATE", "default" => true), array("id" => "FORMAT_DATETIME", "content" => Loc::getMessage("culture_datetime"), "sort" => "FORMAT_DATETIME", "default" => true), array("id" => "FORMAT_NAME", "content" => Loc::getMessage("culture_name"), "sort" => "FORMAT_NAME", "default" => true), array("id" => "CHARSET", "content" => Loc::getMessage("culture_charset"), "sort" => "CHARSET", "default" => true), array("id" => "WEEK_START", "content" => Loc::getMessage("culture_week"), "sort" => "WEEK_START", "default" => false), array("id" => "DIRECTION", "content" => Loc::getMessage("culture_direction"), "sort" => "DIRECTION", "default" => false)));
$days = array(Loc::getMessage("culture_su"), Loc::getMessage("culture_mo"), Loc::getMessage("culture_tu"), Loc::getMessage("culture_we"), Loc::getMessage("culture_th"), Loc::getMessage("culture_fr"), Loc::getMessage("culture_sa"));
while ($culture = $cultureList->fetch()) {
    $id = htmlspecialcharsbx($culture["ID"]);
    $name = htmlspecialcharsbx($culture["NAME"]);
    $row =& $adminList->AddRow($id, $culture, "culture_edit.php?ID=" . $id . "&lang=" . LANGUAGE_ID, Loc::getMessage("LANG_EDIT_TITLE"));
    $row->AddViewField("ID", $id);
    $row->AddField("NAME", '<a href="culture_edit.php?ID=' . $id . '&amp;lang=' . LANGUAGE_ID . '" title="' . Loc::getMessage("LANG_EDIT_TITLE") . '">' . $name . '</a>', $name);
    $row->AddInputField("CODE");
    $row->AddInputField("FORMAT_DATE");
    $row->AddInputField("FORMAT_DATETIME");
    $row->AddInputField("FORMAT_NAME");
    $row->AddViewField("WEEK_START", $days[$culture["WEEK_START"]]);