Skip to content

Instantly share code, notes, and snippets.

@btopro
Created May 14, 2018 20:16
Show Gist options
  • Select an option

  • Save btopro/9cc980e669cb906d2e9026eaacb024a5 to your computer and use it in GitHub Desktop.

Select an option

Save btopro/9cc980e669cb906d2e9026eaacb024a5 to your computer and use it in GitHub Desktop.
$json = '{
"details": {
"title": "' . t('Internal files') . '",
"icon": "perm-media",
"color": "light-blue",
"author": "Drupal",
"description": "Drupal site integration for HAX",
"tags": ["media", "drupal"]
},
"connection": {
"protocol": "' . $parts[0] . '",
"url": "' . $parts[1] . '",
"operations": {
"browse": {
"method": "GET",
"endPoint": "file.json",
"pagination": {
"style": "link",
"props": {
"first": "page.first",
"next": "page.next",
"previous": "page.previous",
"last": "page.last"
}
},
"search": {
},
"data": {
},
"resultMap": {
"defaultGizmoType": "image",
"items": "list",
"preview": {
"title": "name",
"details": "mime",
"image": "url",
"id": "uuid"
},
"gizmo": {
"source": "url",
"id": "uuid",
"title": "name",
"type": "type"
}
}
},
"add": {
"method": "POST",
"endPoint": "hax-file-save/' . drupal_get_token('hax') . '",
"acceptsGizmoTypes": [
"image",
"video",
"audio",
"pdf",
"svg",
"document",
"csv"
],
"resultMap": {
"item": "data.file",
"defaultGizmoType": "image",
"gizmo": {
"source": "url",
"id": "uuid"
}
}
}
}
}
}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment