Esempio n. 1
0
$request = $context->getRequest();
Loc::loadMessages($context->getServer()->getDocumentRoot() . "/bitrix/modules/main/options.php");
Loc::loadMessages(__FILE__);
$tabControl = new CAdminTabControl("tabControl", array(array("DIV" => "edit1", "TAB" => Loc::getMessage("MAIN_TAB_SET"), "TITLE" => Loc::getMessage("MAIN_TAB_TITLE_SET"))));
if ((!empty($save) || !empty($restore)) && $request->isPost() && check_bitrix_sessid()) {
    if (!empty($restore)) {
        Option::delete(ADMIN_MODULE_NAME);
        CAdminMessage::showMessage(array("MESSAGE" => Loc::getMessage("REFERENCES_OPTIONS_RESTORED"), "TYPE" => "OK"));
    } elseif ($request->getPost('max_image_size') && $request->getPost('max_image_size') > 0 && $request->getPost('max_image_size') < 100000) {
        Option::set(ADMIN_MODULE_NAME, "max_image_size", $request->getPost('max_image_size'));
        CAdminMessage::showMessage(array("MESSAGE" => Loc::getMessage("REFERENCES_OPTIONS_SAVED"), "TYPE" => "OK"));
    } else {
        CAdminMessage::showMessage(Loc::getMessage("REFERENCES_INVALID_VALUE"));
    }
}
$tabControl->begin();
?>

<form method="post" action="<?php 
echo sprintf('%s?mid=%s&lang=%s', $request->getRequestedPage(), urlencode($mid), LANGUAGE_ID);
?>
">
    <?php 
echo bitrix_sessid_post();
$tabControl->beginNextTab();
?>
    <tr>
        <td width="40%">
            <label for="max_image_size"><?php 
echo Loc::getMessage("REFERENCES_MAX_IMAGE_SIZE");
?>