cliffparnitzky/birthday-lister

Provides a module to list member birthdays (past, actual, upcoming).

2.0.3 2016-11-09 21:41 UTC

README

Latest Version on Packagist Installations via composer per month Installations via composer total

Contao Extension: BirthdayLister

Provides a module to list member birthdays (past, actual, upcoming).

Installation

Install the extension via composer: cliffparnitzky/birthday-lister.

If you prefer to install it manually, download the latest release here: https://github.com/cliffparnitzky/BirthdayLister/releases

Tracker

https://github.com/cliffparnitzky/BirthdayLister/issues

Compatibility

  • min. Contao version: >= 3.2.0
  • max. Contao version: < 3.6.0

Dependency

This extension is dependent on the following extensions:

Screenshots

Screenshot: System settings

CSS classes

  • birthday_is_today : marks a list item which birthday is today
  • member_is_inactive : marks a list item which member is inactive
  • birthday : marks the span inside a list item containing the date of birth
  • name : marks the span inside a list item containing the name (firstname and lastname)
  • age : marks the span inside a list item containing the age
  • first, last : marks the first and last list item
  • even, odd : marks each list item as even or odd

Hooks

birthdayListerModifyBirthdayChildren

The "birthdayListerModifyBirthdayChildren" hook is triggered for modifying the list of birthday children. So custom sorting is possible or removing of birthday children. It passes $arrBirthdayChildren (the array of birthday children), $modulConfig (the modul configuration to get user definings). It expects an array of birthday children as return value.

// config.php

$GLOBALS['TL_HOOKS']['birthdayListerModifyBirthdayChildren'][]   = array('MyClass', 'myModification');

// MyClass.php

class MyClass
{
	public function myModification($arrBirthdayChildren, $modulConfig)
	{
		if ($modulConfig->birthdayListPeriod == 'mySpecialPeriod')
		{
			// do custom modification here
		}
		return $arrBirthdayChildren;
	}
}

birthdayListerCheckBirthdayInPeriod

The "birthdayListerCheckBirthdayInPeriod" hook is triggered when checking if a birthday is in the defined period. So custom periods could be added or custom checking is possible. It passes $birthdayInPeriod (current decision if the birthday is in period), $modulConfig (the modul configuration to get user definings), $birthday (the date of birth normalized to the actual year), $birthdayChild (the database object of a member). It expects a boolean (is birthday in period) as return value.

// config.php

$GLOBALS['TL_HOOKS']['birthdayListerCheckBirthdayInPeriod'][]   = array('MyClass', 'myPeriodCheck');

// MyClass.php

class MyClass
{
	public function myPeriodCheck($birthdayInPeriod, $modulConfig, $birthday, $birthdayChild)
	{
		if ($modulConfig->birthdayListPeriod == 'mySpecialPeriod')
		{
			// do custom checking here
		}
		return $birthdayInPeriod;
	}
}