Gallery2:API Changes From 2.1 To 2.2 - Gallery Codex
Personal tools

Gallery2:API Changes From 2.1 To 2.2

From Gallery Codex

This is the history of API changes since the Gallery 2.1 official release.

GalleryCoreApi

7.2 => 7.3

  • Added GalleryPlatform::recursiveChmod
  • Marked GalleryPlatform::recursiveFixDirPermissions as deprecated, to remove in next major version bump

7.3 => 7.4

  • GalleryCoreApi::error() API unchanged, but fileName and lineNumber args are ignored
  • GalleryStatus::wrap() deprecated, will be removed on next major version bump
  • Error handling pattern changed. Old:
 if ($ret) { 
   return $ret->wrap(__FILE__, __LINE__); 
 }

new:

 if ($ret) {
   return $ret;
 }

7.4 => 7.5

  • Added optional $userId parameter for fetchItemIdCount and isUserInSiteAdminGroup
  • Added GalleryCoreApi::getDefaultAlbumId, getAnonymousUserId, isAnonymousUser

7.5 => 7.6

  • Added GalleryCoreApi::unregisterToolkitsByModuleId

7.6 => 7.7

  • Added GalleryCoreApi::deleteSortOrder
  • Renamed core.AdminModules view to core.AdminPlugins (now includes themes too)

7.7 => 7.8

  • Added renderers to GalleryItem, and the new GalleryRenderer class. If you want to provide your own way of rendering photos (for example) you can now create a subclass of GalleryRenderer and register it in the factory, then specify that renderer name for any GalleryItem. See the panorama module for an example.
  • GalleryCapabilities is now deprecated; use $gallery->setConfig and getConfig instead.

7.8 => 7.9

  • Added GalleryCoreApi::deleteRenderer, which modules can use in their uninstall method to get rid of any renderers that they registered.
  • Added Mail_mail in lib/pear/mime.php

7.9 => 7.10

  • Added GalleryCoreApi::getMapEntry: allows modules to get all or specific map entries without crafting the SQL query to get it
  • Added GalleryAuthPlugin interface
  • Added optional $removePrefix parameter for GalleryUtilities::getUrlVariablesFiltered
  • Added GalleryCoreApi::loadThemeSettingsForm, ::loadAvailableBlocks and ::handleThemeSettingsRequest
  • GallerySortInterface_1_1 bumped to GallerySortInterface_1_2 with new JOIN syntax that will work with queries for dynamic albums
  • Added GalleryCoreApi::buildItemQuery
  • GalleryTranslator::translateDomain now accepts a string for $data parameter, and also accepts $data['args'] (array of parameters) as an alternative to 'arg1', 'arg2', etc.
  • core.EmergencyEditItemLink block now accepts parameter of the form checkBlocks="sidebar,album"
    The old check[Sidebar|Album|Photo]Blocks parameters are deprecated (still work, but will be removed in Core API 8.0)
  • Added GalleryUtilities::setResponseHeader to avoid replacing headers already set by other modules

7.10 => 7.11

  • Added GalleryCoreApi::applyDerivativePreferences (this is just addExistingItemToAlbum without settings the order weight)
  • Added GalleryPhpVm::crc32
  • GalleryView::_getItem is deprecated, now called GalleryView::getItem
  • class GallerySqlFragment now available by default, you don't need to do requireOnce to use it; the file GallerySqlFragment.class is deprecated (will be removed later)

7.11 => 7.12

  • Added GalleryCoreApi::utf8Strcut
  • GalleryUtilities::utf8Substring is deprecated; use new GalleryCoreApi::utf8Substring instead
  • Added GalleryUtilities::isSafeHttpHeader($string)

7.12 => 7.14

  • Added isDisabledUsername()
  • Added GalleryUrlGenerator::generateUrl useAuthToken option to force auth token to be in / not in the URL; by default it is included in controller URLs
  • Added GallerySession::getAuthToken() / $session->getAuthToken() to get the auth-token (usually added automagically in generateUrl for you).

7.14 => 7.15

  • Added GalleryCoreApi::requestWebPage
  • Added optional parameter $filterBreadcrumb to functions fetchParentSequence() and fetchParents() which defaults to false

7.15 => 7.16

  • New option 'protocol' for GalleryUrlGenerator's generateUrl() method to use a specific protocol when generating a URL
  • New optional parameters $htmlEntities and $urlEncode for GalleryUrlGenerator::appendParamsToUrl() which both default to true.

7.15 => 7.17

  • Added method getExternalAccessMemberList($entityName) to the core API

7.17 => 7.18

  • Added GalleryUrlGenerator::makeAbsoluteUrl()

GalleryModuleApi

3.0 => 3.1

  • Added $userId parameter for GalleryModule::getItemLinks to specify acting user id (for guest preview mode)

3.1 => 3.2

  • Added GalleryDynamicAlbum and ability for a VIEW_TYPE_SHOW_ITEM view to set $theme['allChildsIds'] and $theme['pageUrl'] for a dynamic album view
  • Added GalleryView::loadThemeAndSettings which a view can override to change default handling

3.2 => 3.3

  • Added GalleryController::omitAuthTokenCheck() for controllers that need to opt-out from the framework's auth-token check
  • Added GalleryView::isControllerLike() to declare views that change persistent data or persistent state information

3.3 => 3.4

  • Added core template JavaScriptWarning.tpl; include anywhere a warning should be displayed if JavaScript is disabled.

3.4 => 3.5

  • GalleryModule::getRewriteRules() has been extended (details: URL Rewrite Development docs:
    • rewrite rules can now have 'conditions'
    • It's no longer necessary to provide a pseudo pattern '.' in case 'restriction' is used
    • 'restriction' implies a 'preGallery' parser automatically

GalleryThemeApi

2.3 => 2.4

  • Support for links using $theme.pageUrl so a theme can support browsing of dynamic albums. Use {g->url params=$theme.pageUrl arg1="itemId=.."} rather than referencing view=core.ShowItem.
  • $theme.parents data now includes $parent.urlParams for each entry, to support browsing of dynamic albums. Use {g->url params=$parent.urlParams} rather than referencing view=core.ShowItem.
  • All theme parameters matching *Blocks are treated as block lists, so parameters will be loaded and preload functions called (previously only sidebarBlocks, albumBlocks and photoBlocks were block lists).
  • 'dynamicLinks' added as available standard setting in GalleryTheme.
  • Summary info shown by core.ItemInfo block now inside a div instead of span; change span.summary or span.summary-{name} in theme.css to start with div.summary or just .summary

2.4 => 2.5

  • Added core template JavaScriptWarning.tpl; include anywhere a warning should be displayed if JavaScript is disabled.

Theme changes in Gallery 2.2: A theme for Gallery 2.1 will work with 2.2 for browsing normal albums. Display of a dynamic album should work correctly in the album view, but clicking a thumbnail will jump to the album where that photo resides rather than "browsing the dynamic album". A theme updated for 2.2 will not work with Gallery 2.1 but will properly function with dynamic albums.


GalleryEmbedApi

1.1 => 1.2

GalleryCapabilities is now deprecated; use $gallery->setConfig and getConfig instead.