Methods
Class \Bitrix\Main\UI\Spotlight
allows:
- Registering a hint view instance by a specific user.
- Determines to show pulsating circle to a specific user.
Method | Description | Available from version |
---|---|---|
new Spotlight( $id ) | Class constructor.
Parameter:
Example: use \Bitrix\Main\UI\Spotlight; $spotlight = new Spotlight("my-hint"); $spotlight->setEndDate(time() - 3600); $spotlight->setLifetime(3600 * 5); $spotlight->setUserTimeSpan(3600 * 5); $spotlight->setUserType(Spotlight::USER_TYPE_NEW); //for new users if ($spotlight->isAvailable()) { //allow showing the hint } | |
spotlight.isAvailable( $userId = false ) | Returns true, when hint is shown to the user.
Parameters:
| |
spotlight.getActivationDate | Returns date (timestamp) for hint activation on site. | |
spotlight.activate( $activationDate = false ) | Activate hint on site.
Parameters:
| |
spotlight.deactivate | Deactivates hint on site. | |
spotlight.isViewed( $userId ) | Returns true, when hint was viewed.
Parameters:
| |
spotlight.getViewDate( $userId ) | Returns date for hint view.
Parameters:
| |
spotlight.setViewDate( $userId, $date = false ) | Sets date for hint view.
Parameters:
| |
spotlight.unsetViewDate( $userId ) | Resets hint view date.
Parameters:
| |
spotlight.getId | Returns hint ID. | |
spotlight.getUserType | Returns user type. Returned values:
| |
spotlight.setUserType( $userType ) | Sets user type to determine hint availability.
Parameters:
| |
spotlight.setUserTimeSpan( $userTimeSpan ) | Sets time span, used to determine new/old user.
Parameters:
| |
spotlight.getUserTimeSpan | Returns time span, used to determine new/old user. | |
spotlight.getLifetime | Returns hint lifetime in seconds. | |
spotlight.setLifetime( $lifetime ) | Sets hint's lifetime.
Parameters:
| |
spotlight.getStartDate | Returns start date for showing a hint. Returns null, if date is not specified. | |
spotlight.setStartDate( $startDate ) | Sets start date, from which the hint showing starts.
Parameters:
| |
spotlight.getEndDate | Returns end date, until which the hint is shown. Returns null, if date is not specified. | |
spotlight.setEndDate( $endDate ) | Sets date, until the hint showing is available.
Parameters:
|
© «Bitrix24», 2001-2024