Steven1987
09-14-2003, 03:29 PM
I have a hash inside a hash of menu items.
Each item of that hash has to conain another hash with submenu items. Example:
%menu = {
menu_for_admin = {
item1 => {
name => "Item 1",
subitems => [
{
name => "Subitem1.1",
url => "http://Domain.com/controlpanel/subitem1.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
item2 => {
name => "Item 2",
subitems => [
{
name => "Subitem2.1",
url => "http://Domain.com/my/controlpanel/subitem2.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
},
menu_for_guest = {
item1 => {
name => "Item 1",
subitems => [
{
name => "Subitem1.1",
url => "http://Domain.com/public/subitem1.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
item2 => {
name => "Item 2",
subitems => [
{
name => "Subitem2.1",
url => "http://Domain.com/public/subitem2.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
},
}
This code works fine. (or I must have made typos when entering the text here)
Now I have another hash wich contains more menu items with the same structure (instead of %menu this one is called %menu_extra).
menu_for_admin and menu_for_guest are defined in both hashes. item1 and item2 are always defined in the %menu hash, but not always in the %menu_extra hash. subitems from %menu are never defined in %menu_extra.
Is it possible to 'copy' %menu_extra into %menu_hash (you can compare it to copying folders with existing subfolders?
Each item of that hash has to conain another hash with submenu items. Example:
%menu = {
menu_for_admin = {
item1 => {
name => "Item 1",
subitems => [
{
name => "Subitem1.1",
url => "http://Domain.com/controlpanel/subitem1.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
item2 => {
name => "Item 2",
subitems => [
{
name => "Subitem2.1",
url => "http://Domain.com/my/controlpanel/subitem2.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
},
menu_for_guest = {
item1 => {
name => "Item 1",
subitems => [
{
name => "Subitem1.1",
url => "http://Domain.com/public/subitem1.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
item2 => {
name => "Item 2",
subitems => [
{
name => "Subitem2.1",
url => "http://Domain.com/public/subitem2.1.htm",
},
],
bgcolor => "black",
forecolor => "yellow",
},
},
}
This code works fine. (or I must have made typos when entering the text here)
Now I have another hash wich contains more menu items with the same structure (instead of %menu this one is called %menu_extra).
menu_for_admin and menu_for_guest are defined in both hashes. item1 and item2 are always defined in the %menu hash, but not always in the %menu_extra hash. subitems from %menu are never defined in %menu_extra.
Is it possible to 'copy' %menu_extra into %menu_hash (you can compare it to copying folders with existing subfolders?