| 1 |
<?php |
<?php |
| 2 |
// $Id: advogato_import.module,v 1.4 2006/03/18 08:41:07 deekayen Exp $ |
// $Id: advogato_import.module,v 1.5 2006/08/20 07:58:06 deekayen Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Imports diary entries to Drupal 4.7 from Advogato.org XMLRPC |
* Imports diary entries to Drupal from Advogato.org XMLRPC |
| 7 |
* |
* |
| 8 |
* @author David Kent Norman <deekayen at: deekayen (dot) net> |
* @author David Kent Norman |
| 9 |
* @link http://deekayen.net/ |
* @link http://deekayen.net/ |
| 10 |
* @link http://www.advogato.org/xmlrpc.html |
* @link http://www.advogato.org/xmlrpc.html |
| 11 |
* @copyright Copyright 2005, David Kent Norman |
* @copyright Copyright 2006, David Kent Norman |
| 12 |
* @license http://www.statistica.unimib.it/utenti/dellavedova/software/artistic2.html Clarified Artistic License |
* @license http://www.statistica.unimib.it/utenti/dellavedova/software/artistic2.html Clarified Artistic License |
| 13 |
* @todo make option to delete diary entries from Advogato after imported to Drupal |
* @todo make option to delete diary entries from Advogato after imported to Drupal |
|
* |
|
|
* Database definition: |
|
|
* @code |
|
|
|
|
|
CREATE TABLE advogato_import ( |
|
|
qid int(10) unsigned NOT NULL auto_increment, |
|
|
uid int(10) unsigned NOT NULL default '0', |
|
|
username varchar(50) NOT NULL default '', |
|
|
startentry mediumint(5) NOT NULL default '0', |
|
|
endentry mediumint(5) NOT NULL default '0', |
|
|
PRIMARY KEY (qid), |
|
|
KEY uid (uid) |
|
|
); |
|
|
|
|
|
* @endcode |
|
| 14 |
*/ |
*/ |
| 15 |
|
|
| 16 |
/** |
/** |
|
* Displays module description in the module activation page |
|
|
*/ |
|
|
function advogato_import_help($section) { |
|
|
switch ($section) { |
|
|
case 'admin/modules#description': |
|
|
return t('Imports diary entries from Advogato.'); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
| 17 |
* Administration variables must be set before users can queue imports |
* Administration variables must be set before users can queue imports |
| 18 |
* |
* |
| 19 |
* @return array |
* @return array |
| 20 |
*/ |
*/ |
| 21 |
function advogato_import_settings() { |
function advogato_import_admin_settings() { |
| 22 |
$form['advogato_import_cron_limit'] = array( |
$form['advogato_import_cron_limit'] = array( |
| 23 |
'#type' => 'select', |
'#type' => 'select', |
| 24 |
'#title' => t('Import limit'), |
'#title' => t('Import limit'), |
| 88 |
'#type' => 'hidden', |
'#type' => 'hidden', |
| 89 |
'#value' => 1 |
'#value' => 1 |
| 90 |
); |
); |
| 91 |
return $form; |
return system_settings_form($form); |
| 92 |
} |
} |
| 93 |
|
|
| 94 |
/** |
/** |
| 108 |
} |
} |
| 109 |
} |
} |
| 110 |
} |
} |
| 111 |
|
$items[] = array( |
| 112 |
|
'path' => 'admin/settings/advogato_import', |
| 113 |
|
'title' => t('Advogato import'), |
| 114 |
|
'description' => t('Set default import locations, settings, and limits.'), |
| 115 |
|
'callback' => 'drupal_get_form', |
| 116 |
|
'callback arguments' => 'advogato_import_admin_settings', |
| 117 |
|
'access' => user_access('administer site configuration'), |
| 118 |
|
'type' => MENU_NORMAL_ITEM, |
| 119 |
|
); |
| 120 |
|
|
| 121 |
return $items; |
return $items; |
| 122 |
} |
} |