From 2.1 to 2.2¶
Contents
Deprecated APIs¶
elgg.ui.riverJavaScript library: Remove calls toelgg_load_js('elgg.ui.river')from plugin code. Updatecore/river/filterandforms/comment/save, if overwritten, to require component AMD moduleselgg.ui.popupOpen()andelgg.ui.popupClose()methods inelgg.uiJS library: Useelgg/popupmodule instead.lightbox.jslibrary: Do not useelgg_load_js('lightbox.js');unless your code references deprecatedelgg.ui.lightboxnamespace. Useelgg/lightboxAMD module instead.elgg.embedlibrary andelgg.embedobject: Do not useelgg_load_js('elgg.embed'). Useelgg/embedAMD module instead- Accessing
icons_sizesconfig value directly: Useelgg_get_icon_sizes()can_write_to_container(): UseElggEntity::canWriteToContainer()
Deprecated Views¶
elgg/ui.river.jsis deprecated: Do not rely on simplecache URLs to work.groups/jsis deprecated: Usegroups/navigationAMD module as a menu item dependency for “feature” and “unfeature” menu items instead.lightbox/settings.jsis deprecated: UsegetOptions, ui.lightboxJS plugin hook ordata-colorbox-optsattribute.elgg/ckeditor/insert.jsis deprecated: You no longer need to include it, hook registration takes place inelgg/ckeditormoduleembed/embed.jsis deprecated: Useelgg/embedAMD module.
Added elgg/popup module¶
New elgg/popup module can be used to build out more complex trigger-popup interactions, including binding custom anchor types and opening/closing popups programmatically.
Added elgg/lightbox module¶
New elgg/lightbox module can be used to open and close the lightbox programmatically.
Added elgg/embed module¶
Even though rarely necessary, elgg/embed AMD module can be used to access the embed methods programmatically. The module bootstraps itself when necessary and is unlikely to require further decoration.
New API for handling entity icons¶
ElggEntitynow implements\Elgg\EntityIconinterfaceelgg_get_icon_sizes()- return entity type/subtype specific icon sizesElggEntity::saveIconFromUploadedFile()- creates icons from an uploaded fileElggEntity::saveIconFromLocalFile()- creates icons from a local fileElggEntity::saveIconFromElggFile()- creates icons from an instance ofElggFileElggEntity::getIcon()- returns an instanceofElggIconthat points to entity icon location on filestore (this may be just a placeholder, useElggEntity::hasIcon()to validate if file has been written)ElggEntity::deleteIcon()- deletes entity iconsElggEntity::getIconLastChange()- return modified time of the icon fileElggEntity::hasIcon()- checks if an icon with given size has been createdelgg_get_embed_url()- can be used to return an embed URL for an entity’s icon (served via /serve-icon handler)
User avatars are now served via serve-file handler. Plugins should start using elgg_get_inline_url() and note that:
/avatar/viewpage handler and resource view have been deprecated/mod/profile/icondirect.phpfile has been deprecatedprofile_set_icon_url()is no longer registered as a callback for"entity:icon:url","user"plugin hook
Group avatars are now served via serve-file handler. Plugins should start using elgg_get_inline_url() and note that:
groupiconpage handler (groups_icon_handler()) has been deprecated/mod/groups/icon.phpfile has been deprecated
File entity thumbs and downloads are now served via serve-file handler. Plugins should start using elgg_get_inline_url() and elgg_get_download_url() and note that:
file/downloadpage handler and resource view have been deprecatedmod/file/thumbnail.phpfile has been deprecated- Several views have been updated to use new download URLs, including:
mod/file/views/default/file/specialcontent/audio/default.phpmod/file/views/default/file/specialcontent/image/default.phpmod/file/views/default/resources/file/view.phpmod/file/views/rss/file/enclosure.php
Removed APIs¶
Just a warning that the private entity cache functions (e.g. _elgg_retrieve_cached_entity) have been removed. Some plugins may have been using them. Plugins should not use private APIs as they will more often be removed without notice.
Improved elgg/ckeditor module¶
elgg/ckeditor module can now be used to add WYSIWYG to a textarea programmatically with elgg/ckeditor#bind.