Album Groups Module

masi

Joined: 2005-05-02
Posts: 6
Posted: Tue, 2005-12-13 18:58

Hi,

I wrote a little module that creates a user group for each added album. I used the useralbum module as a template.

AttachmentSize
albumgroups.zip2.14 KB
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-12-13 20:38

i always thought that someone would copy the useralbum module for a groupalbum module, each group could have an album.
but you thought of it the other way around. each album should have a corresponding group... ok.

	function getSystemLinks() {
....
			if ($userId != $anonymousUserId) {
				list ($ret, $albumId) =
						GalleryCoreApi::getPluginParameter('module', 'albumgroups', 'albumId', $userId);
				if ($ret->isError()) {
					return array($ret->wrap(__FILE__, __LINE__), null);
				}

				if (!empty($albumId) || $params['create'] == 'access') {
					$links['YourAlbum'] = array('text' => $this->translate('Your Album'),
						'params' => empty($albumId) ? array('controller' => 'useralbum.UserAlbum')
									: array('view' => 'core.ShowItem',
										'itemId' => $albumId));
				}
			}

useralbum.UserlAbum ? is this a typo? you can't assume that the useralbum module is installed.

					$groupName = $album->getTitle();
					if (empty($groupName)) {
						$groupName = 'where to get the required album path from';
					}

use:

list ($ret, $albumPath) = $album->fetchPath();
	if ($ret->isError()) {
	    return $ret->wrap(__FILE__, __LINE__);
	}
// Set our error status and fall back to the view.
						$error[] = 'form[error][groupName][exists]';

$error has no meaning in handleEvent... what do you plan to do?

and why don't you delete the group that corresponds to an album when the album is deleted?

also, you should map albums and groups the way the useralbum module maps them. with a pluginParam.

 
drhiii

Joined: 2003-04-27
Posts: 397
Posted: Wed, 2005-12-28 08:56

The group album creation mechanism would open up to the world of event photography, like weddings for starters. This, and a couple other tweaks, is all that is holding this genre back imo inside G2.