| 18 |
case 'admin/modules#description': |
case 'admin/modules#description': |
| 19 |
return t('Import nodes from a typepad file.'); |
return t('Import nodes from a typepad file.'); |
| 20 |
case 'admin/help#import_typepad': |
case 'admin/help#import_typepad': |
| 21 |
return t(' ', array('%admin-node-import_typepad' => url('admin/node/import_typepad'), '%admin-access-permission' => url('admin/access/permission'))); |
return t(' ', array('%admin-node-import_typepad' => url('admin/content/import_typepad'), '%admin-access-permission' => url('admin/access/permission'))); |
| 22 |
} |
} |
| 23 |
} |
} |
| 24 |
|
|
| 25 |
function import_typepad_menu($may_cache) { |
function import_typepad_menu($may_cache) { |
| 26 |
$links = array(); |
$links = array(); |
| 27 |
if ($may_cache) { |
if ($may_cache) { |
| 28 |
$links[] = array('path' => 'admin/node/import_typepad', 'title' => t('type pad'), 'callback' => 'import_typepad_page', 'weight' => 5, 'access' => user_access('import nodes')); |
$links[] = array('path' => 'admin/content/import_typepad', |
| 29 |
$links[] = array('path' => 'admin/node/import_typepad/preview', 'title' => t('type pad'), 'callback' => 'import_typepad_preview', 'weight' => 5, 'access' => user_access('import nodes'), 'type' => MENU_CALLBACK); |
'title' => t('Import Typepad Content'), |
| 30 |
|
'callback' => 'import_typepad_page', |
| 31 |
|
'weight' => 5, |
| 32 |
|
'access' => user_access('import nodes')); |
| 33 |
|
$links[] = array('path' => 'admin/content/import_typepad/preview', |
| 34 |
|
'title' => t('type pad'), |
| 35 |
|
'callback' => 'import_typepad_preview', |
| 36 |
|
'weight' => 5, |
| 37 |
|
'access' => user_access('import nodes'), |
| 38 |
|
'type' => MENU_CALLBACK); |
| 39 |
} |
} |
| 40 |
return $links; |
return $links; |
| 41 |
} |
} |
| 52 |
if ($edit[_WORKING_FILE]) { |
if ($edit[_WORKING_FILE]) { |
| 53 |
$output .= form_item(t('File'), $edit[_WORKING_FILE] .' ('. format_size( filesize($edit[_WORKING_FILE]) ) .')<br />'. form_submit(t('Use a different file'))); |
$output .= form_item(t('File'), $edit[_WORKING_FILE] .' ('. format_size( filesize($edit[_WORKING_FILE]) ) .')<br />'. form_submit(t('Use a different file'))); |
| 54 |
} |
} |
|
else { |
|
|
$form['upload_file'] = array( |
|
|
'#type' => 'file', |
|
|
'#title' => t('Upload Type Pad/Movable Type file'), |
|
|
'#description' => t('The export file you wish to import')); |
|
|
$form['serverside_file'] = array( |
|
|
'#type' => 'textfield', |
|
|
'#title' => t('Server side file'), |
|
|
'#description' => t('The file located on the server you wish to import')); |
|
|
} |
|
|
|
|
| 55 |
// todo add an insert/update option |
// todo add an insert/update option |
| 56 |
$form['submit'] = array( |
$form['submit'] = array( |
| 57 |
'#type' => 'submit', |
'#type' => 'submit', |
| 95 |
/** |
/** |
| 96 |
* If the validation passed then simple redirect to the preview |
* If the validation passed then simple redirect to the preview |
| 97 |
*/ |
*/ |
| 98 |
function typepad_step1_submit($form_id, $form_values){ |
function import_typepad_form_select_submit($form_id, $form_values){ |
| 99 |
return 'admin/node/import_typepad/preview'; |
return 'admin/content/import_typepad/preview'; |
| 100 |
} |
} |
| 101 |
|
|
| 102 |
/** |
/** |
| 198 |
/** |
/** |
| 199 |
* Simply run the import, passing the form in for the taxonomy and author maps |
* Simply run the import, passing the form in for the taxonomy and author maps |
| 200 |
*/ |
*/ |
| 201 |
function import_typepad_process_submit($formid, $form_elements){ |
function import_typepad_form_process_submit($formid, $form_elements){ |
| 202 |
$cats = array(); // unused |
$cats = array(); // unused |
| 203 |
|
|
| 204 |
variable_set(_CTYPE, $form_elements['type']); |
variable_set(_CTYPE, $form_elements['type']); |
| 209 |
} |
} |
| 210 |
variable_del(_WORKING_FILE); |
variable_del(_WORKING_FILE); |
| 211 |
variable_del(_FILE_TYPE); |
variable_del(_FILE_TYPE); |
| 212 |
return 'admin/node/import_typepad'; |
return 'admin/content/import_typepad'; |
| 213 |
} |
} |
| 214 |
|
|
| 215 |
/** |
/** |