Log in

hypeAttachments

Attachments for Elgg

Elgg 3.0

Features

  • API and UI for attaching files and other entities
  • Form input for uploading file attachments
  • Views for displaying attachments

Usage

Magic

If you add your entity subtype to a list of entities supporting attachments, the plugin will attempt to create all of the UI, necessary to upload and display attachments:

elgg_register_plugin_hook_handler('allow_attachments', 'object:my_subtype', '\Elgg\Values::getTrue');

Note that this generic approach might not work with all plugins, and may require additional customizations on your side.

Display an attachment input

echo elgg_view('input/attachments');

To add an attachments input to your comment and discussion replies forms, use the following code. You will not need to add any code to your save action.

echo elgg_view('input/attachments', [
    'name' => 'comment_attachments',
        ]);

To add an attachments input to your personal messages and replies forms, use the following code. You will not need to add any code to your save action.

echo elgg_view('input/attachments', [
        'name' => 'message_attachments',
    ]);

Note that if you are not using hypeDropzone, your form must have it's encoding set to multipart/form-data.

Attach uploaded files in an action

hypeapps_attach_uploaded_files($entity, 'upload', [
   'access_id' => $entity->access_id, // change the access level of uploaded files
]);

Attach an object

hypeapps_attach($entity, $attachment);

Display attachments


```php echo elgg_view('output/attachments', [ 'entity' => $entity, ]);

Acknowledgements

Package Releases

VersionRelease Date
hypeAttachments 3.1.03.1.0
hypeAttachments 3.0.43.0.4
hypeAttachments 3.0.23.0.2
hypeAttachments 3.0.13.0.1
hypeAttachments 3.0.03.0.0

Changelog

3.1.0 (2018-06-29)

Bug Fixes

  • sql: fix sql query to avoid fatal errors (d6f0138)
  • upload: use elgg/Ajax to submit the form (147b16f)

Features

  • core: updates and fixes (f915a9f)
  • fields: upgrade to new fields API (ad09845)

3.0.4 (2018-04-19)

3.0.3 (2018-04-19)

Bug Fixes

  • sql: fix sql query to avoid fatal errors (d6f0138)

3.0.2 (2018-03-28)

Features

  • fields: upgrade to new fields API (ad09845)

3.0.1 (2018-03-27)

Bug Fixes

  • upload: use elgg/Ajax to submit the form (147b16f)

3.0.0 (2018-03-19)

Bug Fixes

  • classes: make singleton instance static (22d37d1)
  • composer: add missing composer installer name (8fb28ee)
  • composer: add missing composer installer name (792b547)
  • composer: do not include namespace in autoloader (30505c6)
  • cs: fix coding style (f93256c)
  • cs: fix coding style (3626487)
  • deps: correctly resolve dependencies (d8d48e5)
  • forms: input names should not include [] (609d5d9)
  • js: add spinner for form submit action (1d4dc44)
  • js: fix variables and dependencies in AMD module (3b777a3)
  • js: form submission now works as expected with jquery.form (c3af65f)
  • languages: fix language strings (2357e74)
  • manifest: document require dependency on alc_builder_api (b364263)
  • messages: apply special rules to private messages (862f9cb)
  • notifications: throttle attachment notifications (187f440)
  • output: terminate early if no entity is passed to the output view (7b27f3a)
  • releases: fix release script (02ec463)
  • releases: fix supported version in release docs (746437c)
  • ui: do not append attachments to body when hypeUI is enabled (28ece82)
  • ui: do not set body if hypeUI is enabled (3c9cb28)
  • views: do not display attachments for entities that are not supported (c75a847)
  • views: no longer WSODs in scrict mode (d529b93)

Features

  • core: upgrade to Elgg 2.2, add UI (bbad331)
  • releases: now works with Elgg 1.9 (cb1f304)
  • ui: add menu item icons (9aaccd0)
  • ui: integrate menus with hypeUI (351cb67)
  • ui: integrate with hypeUI (8965264)
  • ui: integrate with hypeUI (e702f91)

2.2.2 (2017-07-11)

Bug Fixes

  • ui: do not append attachments to body when hypeUI is enabled (28ece82)

2.2.1 (2017-07-11)

Bug Fixes

  • ui: do not set body if hypeUI is enabled (3c9cb28)

2.2.0 (2017-07-08)

Features

  • ui: integrate menus with hypeUI (351cb67)
  • ui: integrate with hypeUI (8965264)
  • ui: integrate with hypeUI (e702f91)

2.1.3 (2016-10-16)

Bug Fixes

  • views: do not display attachments for entities that are not supported (c75a847)
  • views: no longer WSODs in scrict mode (d529b93)

2.1.2 (2016-09-22)

Bug Fixes

  • composer: do not include namespace in autoloader (30505c6)

2.1.1 (2016-09-22)

Bug Fixes

  • composer: do not include namespace in autoloader (30505c6)

2.1.1 (2016-09-22)

Bug Fixes

  • deps: correctly resolve dependencies (d8d48e5)

2.1.0 (2016-09-22)

2.0.5 (2016-09-22)

Bug Fixes

  • messages: apply special rules to private messages (862f9cb)
  • notifications: throttle attachment notifications (187f440)

Features

2.0.4 (2016-08-24)

Bug Fixes

  • js: add spinner for form submit action (1d4dc44)
  • js: fix variables and dependencies in AMD module (3b777a3)
  • js: form submission now works as expected with jquery.form (c3af65f)
  • releases: fix supported version in release docs (746437c)

2.0.3 (2016-08-22)

Bug Fixes

  • classes: make singleton instance static (22d37d1)
  • manifest: document require dependency on alc_builder_api (b364263)

2.0.2 (2016-08-17)

Bug Fixes

  • composer: add missing composer installer name (792b547)

2.0.1 (2016-08-17)

Bug Fixes

  • composer: add missing composer installer name (8fb28ee)

2.0.0 (2016-08-17)

Bug Fixes

Features

  • core: upgrade to Elgg 2.2, add UI (bbad331)

BREAKING CHANGES

  • core: Now requires Elgg 2.2 Modifies handlers to use classes - if you were unregistering handlers, update your code. Adds UI for configuring settings and magically adding UI elements to configured entity types

1.0.2 (2016-07-06)

Bug Fixes

  • forms: input names should not include [] (609d5d9)
  • languages: fix language strings (2357e74)
  • output: terminate early if no entity is passed to the output view (7b27f3a)

1.0.1 (2016-07-06)

Bug Fixes

  • releases: fix release script (02ec463)

1.0.0 (2016-07-06)

Features

  • releases: now works with Elgg 1.9 (cb1f304)

About

Dependencies

Requires
Elgg version >= 3.0
Plugin: file Any
Suggests
Plugin: hypeDropzone Any