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