1 | <?php |
||
31 | class NextNoteShareBackend implements Share_Backend { |
||
32 | |||
33 | private $db; |
||
34 | public function __construct() { |
||
37 | |||
38 | public function getSharedNotes(){ |
||
41 | |||
42 | /** |
||
43 | * Check if this $itemSource exist for the user |
||
44 | * @param string $itemSource |
||
45 | * @param string $uidOwner Owner of the item |
||
46 | * @return boolean|null Source |
||
47 | * |
||
48 | * Return false if the item does not exist for the user |
||
49 | * @since 5.0.0 |
||
50 | */ |
||
51 | public function isValidSource($itemSource, $uidOwner) { |
||
57 | |||
58 | /** |
||
59 | * Get a unique name of the item for the specified user |
||
60 | * @param string $itemSource |
||
61 | * @param string|false $shareWith User the item is being shared with |
||
62 | * @param array|null $exclude List of similar item names already existing as shared items @deprecated since version OC7 |
||
63 | * @return string Target name |
||
64 | * |
||
65 | * This function needs to verify that the user does not already have an item with this name. |
||
66 | * If it does generate a new name e.g. name_# |
||
67 | * @since 5.0.0 |
||
68 | */ |
||
69 | public function generateTarget($itemSource, $shareWith, $exclude = null) { |
||
73 | |||
74 | /** |
||
75 | * Converts the shared item sources back into the item in the specified format |
||
76 | * @param array $items Shared items |
||
77 | * @param int|string $format |
||
78 | * @return array |
||
79 | * |
||
80 | * The items array is a 3-dimensional array with the item_source as the |
||
81 | * first key and the share id as the second key to an array with the share |
||
82 | * info. |
||
83 | * |
||
84 | * The key/value pairs included in the share info depend on the function originally called: |
||
85 | * If called by getItem(s)Shared: id, item_type, item, item_source, |
||
86 | * share_type, share_with, permissions, stime, file_source |
||
87 | * |
||
88 | * If called by getItem(s)SharedWith: id, item_type, item, item_source, |
||
89 | * item_target, share_type, share_with, permissions, stime, file_source, |
||
90 | * file_target |
||
91 | * |
||
92 | * This function allows the backend to control the output of shared items with custom formats. |
||
93 | * It is only called through calls to the public getItem(s)Shared(With) functions. |
||
94 | * @since 5.0.0 |
||
95 | */ |
||
96 | public function formatItems($items, $format, $parameters = null) { |
||
123 | |||
124 | /** |
||
125 | * Check if a given share type is allowd by the back-end |
||
126 | * |
||
127 | * @param int $shareType share type |
||
128 | * @return boolean |
||
129 | * |
||
130 | * The back-end can enable/disable specific share types. Just return true if |
||
131 | * the back-end doesn't provide any specific settings for it and want to allow |
||
132 | * all share types defined by the share API |
||
133 | * @since 8.0.0 |
||
134 | */ |
||
135 | public function isShareTypeAllowed($shareType) { |
||
138 | |||
139 | /** |
||
140 | * Check if the current user has the requested permission. |
||
141 | * For permissions |
||
142 | * @see \OCP\Constants |
||
143 | * @param $permission |
||
144 | * @param $note NextNote |
||
145 | * @return bool|int |
||
146 | */ |
||
147 | public function checkPermissions($permission, $note) { |
||
160 | } |