AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", Array("Class", "addBonus"));
class Class
public function addBonus($arFields){
$IBLOCK_ID = 10;
$PROP = array(
'online' => 35,
'bonus' => 10,
'rating' => 45
);
if(CIBlockElement::SetPropertyValuesEx($arFields['ID'], $IBLOCK_ID, $PROP))
{
return true;
} else {
return false;
}
}
|