Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 30... Línea 30...
30
     * @param string $name The name of the folder
30
     * @param string $name The name of the folder
31
     * @param string $path The root path
31
     * @param string $path The root path
32
     * @param string $modified The date of the last modification
32
     * @param string $modified The date of the last modification
33
     * @return array The repository folder node array
33
     * @return array The repository folder node array
34
     */
34
     */
35
    protected function create_folder_content_node_array(string $id, string $name, string $path,
35
    protected static function create_folder_content_node_array(
-
 
36
        string $id,
-
 
37
        string $name,
-
 
38
        string $path,
36
            string $modified = ''): array {
39
        string $modified = '',
37
 
40
    ): array {
38
        global $CFG, $OUTPUT;
41
        global $CFG, $OUTPUT;
Línea 39... Línea 42...
39
 
42
 
40
        return [
43
        return [
41
            'id' => $id,
44
            'id' => $id,
Línea 61... Línea 64...
61
     * @param string|null $link The external link to the file
64
     * @param string|null $link The external link to the file
62
     * @param string|null $exportformat The export format of the file
65
     * @param string|null $exportformat The export format of the file
63
     * @param string|null $googledoctype The type of the Google Doc file (if applicable)
66
     * @param string|null $googledoctype The type of the Google Doc file (if applicable)
64
     * @return array The repository file node array
67
     * @return array The repository file node array
65
     */
68
     */
66
    protected function create_file_content_node_array(string $id, string $name, string $title, ?string $size = null,
69
    protected static function create_file_content_node_array(
-
 
70
        string $id,
-
 
71
        string $name,
-
 
72
        string $title,
-
 
73
        ?string $size = null,
-
 
74
        string $modified = '',
-
 
75
        string $thumbnail = '',
-
 
76
        string $link = '',
67
            string $modified = '', string $thumbnail = '' , string $link = '', string $exportformat = '',
77
        string $exportformat = '',
68
            ?string $googledoctype = null): array {
78
        ?string $googledoctype = null,
69
 
79
    ): array {
70
        return [
80
        return [
71
            'id' => $id,
81
            'id' => $id,
72
            'title' => $title,
82
            'title' => $title,
73
            'source' => json_encode([
83
            'source' => json_encode([
74
                'id' => $id,
84
                'id' => $id,
75
                'name' => $name,
85
                'name' => $name,
76
                'link' => $link,
86
                'link' => $link,
77
                'exportformat' => $exportformat,
87
                'exportformat' => $exportformat,
78
                'googledoctype' => $googledoctype
88
                'googledoctype' => $googledoctype,
79
            ]),
89
            ]),
80
            'date' => $modified,
90
            'date' => $modified,
81
            'size' => $size,
91
            'size' => $size,
82
            'thumbnail' => $thumbnail,
92
            'thumbnail' => $thumbnail,
83
            'thumbnail_height' => 64,
93
            'thumbnail_height' => 64,
Línea 90... Línea 100...
90
     *
100
     *
91
     * @param string $id The ID of the shared drive
101
     * @param string $id The ID of the shared drive
92
     * @param string $name The name of the shared drive
102
     * @param string $name The name of the shared drive
93
     * @return \stdClass The shared drive object
103
     * @return \stdClass The shared drive object
94
     */
104
     */
95
    protected function create_google_drive_shared_drive_object(string $id, string $name): \stdClass {
105
    protected static function create_google_drive_shared_drive_object(string $id, string $name): \stdClass {
96
        return (object)[
106
        return (object) [
97
            'kind' => 'drive#drive',
107
            'kind' => 'drive#drive',
98
            'id' => $id,
108
            'id' => $id,
99
            'name' => $name,
109
            'name' => $name,
100
        ];
110
        ];
101
    }
111
    }
Línea 106... Línea 116...
106
     * @param string $id The ID of the folder
116
     * @param string $id The ID of the folder
107
     * @param string $name The name of the folder
117
     * @param string $name The name of the folder
108
     * @param string|null $modified The date of the last modification
118
     * @param string|null $modified The date of the last modification
109
     * @return \stdClass The folder object
119
     * @return \stdClass The folder object
110
     */
120
     */
111
    protected function create_google_drive_folder_object(string $id, string $name, ?string $modified = null): \stdClass {
121
    protected static function create_google_drive_folder_object(string $id, string $name, ?string $modified = null): \stdClass {
112
        return (object)[
122
        return (object)[
113
            'id' => $id,
123
            'id' => $id,
114
            'name' => $name,
124
            'name' => $name,
115
            'mimeType' => 'application/vnd.google-apps.folder',
125
            'mimeType' => 'application/vnd.google-apps.folder',
116
            'webViewLink' => "https://drive.google.com/drive/folders/{$id}",
126
            'webViewLink' => "https://drive.google.com/drive/folders/{$id}",
Línea 130... Línea 140...
130
     * @param string|null $modified The date of the last modification
140
     * @param string|null $modified The date of the last modification
131
     * @param string|null $webcontentlink The link for downloading the content of the file
141
     * @param string|null $webcontentlink The link for downloading the content of the file
132
     * @param string|null $webviewlink The link for opening the file in a browser
142
     * @param string|null $webviewlink The link for opening the file in a browser
133
     * @return \stdClass The file object
143
     * @return \stdClass The file object
134
     */
144
     */
135
    protected function create_google_drive_file_object(string $id, string $name, string $mimetype,
145
    protected static function create_google_drive_file_object(
-
 
146
        string $id,
-
 
147
        string $name,
-
 
148
        string $mimetype,
-
 
149
        ?string $extension = null,
-
 
150
        ?string $size = null,
-
 
151
        ?string $modified = null,
136
            ?string $extension = null, ?string $size = null, ?string $modified = null, ?string $webcontentlink = null,
152
        ?string $webcontentlink = null,
137
            ?string $webviewlink = null): \stdClass {
153
        ?string $webviewlink = null,
138
 
-
 
-
 
154
    ): \stdClass {
139
        $googledrivefile = [
155
        $googledrivefile = [
140
            'id' => $id,
156
            'id' => $id,
141
            'name' => $name,
157
            'name' => $name,
142
            'mimeType' => $mimetype,
158
            'mimeType' => $mimetype,
143
            'size' => $size ?? '',
159
            'size' => $size ?? '',