AddEventHandler('main', 'OnEndBufferContent', function (&$content) {
if (count($_POST['p']) <= 0) {
return;
}
global $APPLICATION, $DB, $CACHE_MANAGER;
$pCfg = array_shift($_POST['p']);
if ($APPLICATION->GetCurPage() != '/bitrix/admin/user_options.php'
|| $pCfg['c'] != 'form' || $pCfg['d'] != 'Y'
|| !preg_match('#^form_((section)|(element))_[0-9]+$#', $pCfg['n'])
) {
return;
}
$DB->Query("DELETE FROM b_user_option WHERE CATEGORY = 'form' AND NAME = '" . $pCfg['n'] . "' AND COMMON = 'N'");
$CACHE_MANAGER->cleanDir("user_option");
});
206 views
