I am using the Hosting module through Aegir. I created a module with some extra fields such as "site_name," "fields," and "description," which was done successfully. I want to use these fields on a newly created website. I am using this code in the new site:
function silverpack_config_menu() {
// Create additional primary menu items
$items = array(
array('link_path' => '<front>', 'link_title' => t('Home'), 'weight' => 0),
array('link_path' => 'node/2', 'link_title' =>t(drush_get_option('site_name')), 'weight' => 6),
array('link_path' => 'node/3', 'link_title' => t('Contact'), 'weight' => 8),
array('link_path' => 'node/4', 'link_title' => t('Contact US'), 'weight' => 10),
array('link_path' => 'node/5', 'link_title' => t('Terms & Conditions'), 'weight' => 10),
);
foreach ($items as $item) {
$item += array(
'mlid' => 0,
'module' => 'menu',
'has_children' => 0,
'options' => array(
'attributes' => array(
'title' => '',
),
),
'customized' => 1,
'original_item' => array(
'link_title' => '',
'mlid' => 0,
'plid' => 0,
'menu_name' => 'primary-links',
'weight' => 1,
'link_path' => '',
'options' => array(),
'module' => 'menu',
'expanded' => 0,
'hidden' => 0,
'has_children' => 0,
),
'description' => '',
'expanded' => 0,
'parent' => 'primary-links:0',
'hidden' => 0,
'plid' => 0,
'menu_name' => 'primary-links',
);
menu_link_save($item);
}
}
Here, I want to use drush_get_option('site_name')
. "site_name" is one of the fields I use in Aegir's Hosting module.
Does anybody have an idea on how to do this?