PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.6
VikBooking Hotel Booking Engine & PMS v1.8.6
1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 All 36 releases
vikbooking / admin / helpers / src / chat / context.php

context.php in VikBooking Hotel Booking Engine & PMS 1.8.6, at admin/helpers/src/chat/context.php

86 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * This interface can be used to differentiate the behavior depending on
16 * the context where a message may be sent.
17 *
18 * @since 1.8
19 */
20 interface VBOChatContext
21 {
22 /**
23 * Returns the foreign key to link a message to an external context.
24 *
25 * @return int
26 */
27 public function getID();
28
29 /**
30 * Returns the alias to identify the context type.
31 *
32 * @return string
33 */
34 public function getAlias();
35
36 /**
37 * Returns a list of recipients that may receive notifications
38 * about new messages under this context.
39 *
40 * @return VBOChatUser[]
41 */
42 public function getRecipients();
43
44 /**
45 * Forces the pre-loading of the resources to make the context scripts work.
46 *
47 * @return void
48 */
49 public function useAssets();
50
51 /**
52 * Returns a short description to identify the context.
53 *
54 * @return string
55 */
56 public function getSubject();
57
58 /**
59 * Returns an array of supported actions, which will be added to the
60 * contextual menu displayed within the chat interface.
61 *
62 * @return array
63 */
64 public function getActions();
65
66 /**
67 * Returns the URL that can be used to access the chat interface.
68 *
69 * @return string
70 */
71 public function getURL();
72
73 /**
74 * Checks whether the provided user is allowed to perform the given action
75 * under the current context.
76 *
77 * NOTE: calling `$user->can()` in this method will result in recursion.
78 *
79 * @param string $scope The action identifier.
80 * @param VBOChatUser $user The involved user.
81 *
82 * @return bool True if allowed, false otherwise.
83 */
84 public function can(string $scope, VBOChatUser $user);
85 }
86