SwitchFilterPreset
void public function switchFilterPreset( $presetId );
This method returns the list of preset and user filters available for the user.
Method parameters
Parameter | Description |
---|---|
$presetId | ID of the filter that should be considered as current. |
Returned value
None.
Examples of use
<?php CModule::IncludeModule('tasks'); $userId = (int) $GLOBALS['USER']->getId(); $bGroupMode = false; $oFilter = CTaskFilterCtrl::getInstance($userId, $bGroupMode); // Specify «All my tasks» filter as the current $oFilter->switchFilterPreset(CTaskFilterCtrl::STD_PRESET_ALL_MY_TASKS); $selectedFilter = $oFilter->getSelectedFilterPresetId(); echo $selectedFilter; // Shows number «-9», which is the value of the CTaskFilterCtrl::STD_PRESET_ALL_MY_TASKS constant ?>
© «Bitrix24», 2001-2024