I have a module I'm creating and its purpose is to import a specific type of data and append it to nodes depending on that data.
To do this, I need to create a page letting the user enter where the data is stored at for the system to import.
To do this, I'm hooking into hook_menu to create the page like this:
function lbar_image_importer_menu(){
$items = array();
$items[] = array(
'path' => "admin/content/lbar_image_importer",
'title' => "Import LBar Images",
'description' => "Innitiate an importation of LBar images from a ZIP file.",
'page callback' => 'drupal_get_form',
);
return $items;
}
I populate the form that it will use by hooking into the hook_form_alter function like thus:
function lbar_image_importer_form_alter(&$form, &$form_state, $form_id) {
$form['admin']['lbar_zip_loc'] = array(
'#type' => 'textfield',
'#title' => 'Location of LBar Zip file: ',
'#description' => 'This is where one or many of the lbar zip files are located. If this is a file, it will access only that zip file. If it is a directory it will open all zip files in that directory.',
);
$form['admin']['submit'] = array(
"#type" => "submit",
"#value" => "Import",
'#submit' => array('lbar_image_importer_submit'),
);
return $form;
}
However, I am having no luck. It appends my form elements to the search form, and redisplays the admin/content page. How can I make it so I have my own page, like admin/content/node?