I have the image_gallery module (part of the image module) installed. I'd like to allow users to create their own galleries in the same way that they create other content types. The problem is that 'galleries' are actually taxonomy entries, and the interface for creating galleries is via the Administration menu.
So, I'd like to be able to have an entry on the create content page and a menu item that says 'create new gallery'.
From what I can see, it looks like the obvious way to achieve this would be to create a new module that simply has a hook_menu
function.
I've tried to do this, but I can't seem to get it right.
Here's what I've got:
<?php
/**
*
*
* @version $Id$
* @copyright 2006
*/
function gallery_help($section='') {
$output = '';
switch ($section) {
case "admin/modules#description":
$output = t("Creates a new image gallery or 'set'");
break;
}
return $output;
} // function gallery_help
function gallery_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/image/add',
'title' => t('gallery'),
'type' => MENU_CALLBACK,
'callback arguments' => array('gallery'),
'callback' => 'category_add');
}
return $items;
}
?>
My guess is the I'm not passing the right variable into the $items[]=array()
, but I'm moving well outside my 'knowledge base' with this one. I'm learning, but it's slow.