1 | <?php |
||
28 | class NextNoteShareBackend implements Share_Backend { |
||
29 | |||
30 | private $db; |
||
31 | |||
32 | public function __construct() { |
||
35 | |||
36 | /** |
||
37 | * Check if this $itemSource exist for the user |
||
38 | * @param string $itemSource |
||
39 | * @param string $uidOwner Owner of the item |
||
40 | * @return boolean|null Source |
||
41 | * |
||
42 | * Return false if the item does not exist for the user |
||
43 | * @since 5.0.0 |
||
44 | */ |
||
45 | public function isValidSource($itemSource, $uidOwner) { |
||
51 | |||
52 | /** |
||
53 | * Get a unique name of the item for the specified user |
||
54 | * @param string $itemSource |
||
55 | * @param string|false $shareWith User the item is being shared with |
||
56 | * @param array|null $exclude List of similar item names already existing as shared items @deprecated since version OC7 |
||
57 | * @return string Target name |
||
58 | * |
||
59 | * This function needs to verify that the user does not already have an item with this name. |
||
60 | * If it does generate a new name e.g. name_# |
||
61 | * @since 5.0.0 |
||
62 | */ |
||
63 | public function generateTarget($itemSource, $shareWith, $exclude = null) { |
||
67 | |||
68 | /** |
||
69 | * Converts the shared item sources back into the item in the specified format |
||
70 | * @param array $items Shared items |
||
71 | * @param int $format |
||
72 | * @return array |
||
73 | * |
||
74 | * The items array is a 3-dimensional array with the item_source as the |
||
75 | * first key and the share id as the second key to an array with the share |
||
76 | * info. |
||
77 | * |
||
78 | * The key/value pairs included in the share info depend on the function originally called: |
||
79 | * If called by getItem(s)Shared: id, item_type, item, item_source, |
||
80 | * share_type, share_with, permissions, stime, file_source |
||
81 | * |
||
82 | * If called by getItem(s)SharedWith: id, item_type, item, item_source, |
||
83 | * item_target, share_type, share_with, permissions, stime, file_source, |
||
84 | * file_target |
||
85 | * |
||
86 | * This function allows the backend to control the output of shared items with custom formats. |
||
87 | * It is only called through calls to the public getItem(s)Shared(With) functions. |
||
88 | * @since 5.0.0 |
||
89 | */ |
||
90 | public function formatItems($items, $format, $parameters = null) { |
||
120 | |||
121 | /** |
||
122 | * Check if a given share type is allowd by the back-end |
||
123 | * |
||
124 | * @param int $shareType share type |
||
125 | * @return boolean |
||
126 | * |
||
127 | * The back-end can enable/disable specific share types. Just return true if |
||
128 | * the back-end doesn't provide any specific settings for it and want to allow |
||
129 | * all share types defined by the share API |
||
130 | * @since 8.0.0 |
||
131 | */ |
||
132 | public function isShareTypeAllowed($shareType) { |
||
135 | |||
136 | } |