Public Member Functions | |
GroupList () | |
Class constructor. | |
fillWithDatabase () | |
Fill in the list using the database. | |
databaseItemExists ($groupId, $groupname) | |
Check if a group exists. | |
databaseInsertItem ($name) | |
Insert a new group. | |
databaseUpdateItem ($groupId, $newName) | |
Update an existing group. | |
databaseDeleteItemsExcluding ($idArray) | |
Delete an existing group. | |
html () | |
Show the list of groups. | |
Public Attributes | |
$emptyListMessage = "There are no groups to display." | |
The empty list message. | |
$alreadyExistsMessage = "Sorry, that group already exists. Please choose a different groupname." | |
The already existing message. |
This class can generate a dynamic list of groups in an HTML form.
GroupList::GroupList | ( | ) |
GroupList::fillWithDatabase | ( | ) |
Fill in the list using the database.
This function is responsible for filling in the list using data from the database.
GroupList::databaseItemExists | ( | $ | groupId, | |
$ | groupname | |||
) |
Check if a group exists.
This function returns boolean true if a group exists.
groupId | The group ID to search for. | |
groupname | The groupname to search for. |
GroupList::databaseInsertItem | ( | $ | name | ) |
Insert a new group.
This function will insert a new group in the database.
GroupList::databaseUpdateItem | ( | $ | groupId, | |
$ | newName | |||
) |
Update an existing group.
This function will update an existing group in the database.
groupId | The groupId of the group. | |
newName | The new name of the group. |
GroupList::databaseDeleteItemsExcluding | ( | $ | idArray | ) |
Delete an existing group.
This function is responsible for removing a group from the database.
name | The name of the group. |
GroupList::html | ( | ) |
Show the list of groups.
This function overrides DynamicList::html(), because we also need radio buttons for the default group.
GroupList::$emptyListMessage = "There are no groups to display." |
The empty list message.
GroupList::$alreadyExistsMessage = "Sorry, that group already exists. Please choose a different groupname." |
The already existing message.