/[drupal]/contributions/modules/import_typepad/import_typepad.module
ViewVC logotype

Diff of /contributions/modules/import_typepad/import_typepad.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.7.2.4, Tue Jan 22 00:34:23 2008 UTC revision 1.7.2.5, Mon May 26 22:29:26 2008 UTC
# Line 18  function import_typepad_help($section) { Line 18  function import_typepad_help($section) {
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  }  }
# Line 43  function import_typepad_page($form_value Line 52  function import_typepad_page($form_value
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',
# Line 97  function typepad_step1_validate($form_id Line 95  function typepad_step1_validate($form_id
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  /**  /**
# Line 200  function _import_typepad_taxonomy_list($ Line 198  function _import_typepad_taxonomy_list($
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']);
# Line 211  function import_typepad_process_submit($ Line 209  function import_typepad_process_submit($
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  /**  /**

Legend:
Removed from v.1.7.2.4  
changed lines
  Added in v.1.7.2.5

  ViewVC Help
Powered by ViewVC 1.1.2