| 446 |
'access arguments' => array(1), |
'access arguments' => array(1), |
| 447 |
'title' => 'Mass import', |
'title' => 'Mass import', |
| 448 |
'page callback' => 'drupal_get_form', |
'page callback' => 'drupal_get_form', |
| 449 |
'page arguments' => array('acidfree_mass_import_form', 1), |
'page arguments' => array('acidfree_mass_import', 1), |
| 450 |
'type' => variable_get('acidfree_mass_import_local_task', false) ? |
'type' => variable_get('acidfree_mass_import_local_task', false) ? |
| 451 |
MENU_LOCAL_TASK : MENU_SUGGESTED_ITEM, |
MENU_LOCAL_TASK : MENU_SUGGESTED_ITEM, |
| 452 |
); |
); |
| 1373 |
$nid = _nid_from_tid($tid); |
$nid = _nid_from_tid($tid); |
| 1374 |
drupal_goto("node/{$nid}"); |
drupal_goto("node/{$nid}"); |
| 1375 |
} elseif ($argv[0] == 'version') { |
} elseif ($argv[0] == 'version') { |
| 1376 |
$version = '$Id: acidfree.module 598 2008-12-15 15:09:07Z vhmauery $'; |
$version = '$Id: acidfree.module 599 2008-12-15 15:47:48Z vhmauery $'; |
| 1377 |
return $version; |
return $version; |
| 1378 |
} elseif ($argv[0] == 'test') { |
} elseif ($argv[0] == 'test') { |
| 1379 |
if (user_access('site administration')) { |
if (user_access('site administration')) { |
| 1777 |
return $valid; |
return $valid; |
| 1778 |
} |
} |
| 1779 |
|
|
| 1780 |
function acidfree_mass_import_submit($form_id, $form) { |
function acidfree_mass_import_submit(&$form, &$form_state) { |
| 1781 |
$op = isset($_POST['op']) ? $_POST['op'] : ''; |
$op = isset($_POST['op']) ? $_POST['op'] : ''; |
| 1782 |
$extime = ini_set('max_execution_time', 600); |
$extime = ini_set('max_execution_time', 600); |
| 1783 |
//drupal_set_message("mass import submit($op)"); |
//drupal_set_message("mass import submit($op)"); |
| 1784 |
$recursive = isset($form['recursive']) ? $form['recursive'] : true; |
$recursive = isset($form_state['values']['recursive']) ? $form_state['values']['recursive'] : true; |
| 1785 |
$nokeep = array('parent', 'path', 'op', 'upload', 'recursive', 'import', 'form_token', 'form_id'); |
$nokeep = array('parent', 'path', 'op', 'upload', 'recursive', 'import', 'form_token', 'form_id'); |
| 1786 |
for ($i=0; $i<5; $i++) { |
for ($i=0; $i<5; $i++) { |
| 1787 |
$nokeep[] = "acidfreeupload$i"; |
$nokeep[] = "acidfreeupload$i"; |
| 1866 |
); |
); |
| 1867 |
} |
} |
| 1868 |
|
|
| 1869 |
function acidfree_mass_import(&$parent) { |
function acidfree_mass_import($form_state, &$parent) { |
| 1870 |
drupal_set_title(t('Mass import')); |
drupal_set_title(t('Mass import')); |
| 1871 |
// just as a sanity check make sure the destination stuff is configured |
// just as a sanity check make sure the destination stuff is configured |
| 1872 |
if (module_exists('image') || module_exists('video_image')) { |
if (module_exists('image') || module_exists('video_image')) { |
| 1981 |
return $form; |
return $form; |
| 1982 |
} |
} |
| 1983 |
|
|
|
function acidfree_mass_import_form() { |
|
|
$argv = func_get_args(); |
|
|
$argc = func_num_args(); |
|
|
if ($argc == 1) { |
|
|
$parent = acidfree_node_load($argv[0]); |
|
|
} else { |
|
|
$parent = acidfree_get_root(); |
|
|
$parent = acidfree_node_load($parent); |
|
|
} |
|
|
drupal_add_js(drupal_get_path('module', 'acidfree').'/acidfree.js'); |
|
|
return drupal_get_form('acidfree_mass_import', $parent); |
|
|
} |
|
|
|
|
| 1984 |
/* tags we recognize: |
/* tags we recognize: |
| 1985 |
* style => css style info for the image |
* style => css style info for the image |
| 1986 |
* size => image size in pixels (can be WxH or just largest dimension) |
* size => image size in pixels (can be WxH or just largest dimension) |
| 3091 |
$form['parent']['#size'] = 0; |
$form['parent']['#size'] = 0; |
| 3092 |
$form['parent']['#required'] = 1; |
$form['parent']['#required'] = 1; |
| 3093 |
if (($arg = _path_match('node', 'add', 'acidfree', '%d'))) { |
if (($arg = _path_match('node', 'add', 'acidfree', '%d'))) { |
| 3094 |
|
here(); |
| 3095 |
$album = acidfree_node_load($arg[0]); |
$album = acidfree_node_load($arg[0]); |
| 3096 |
$form['taxonomy'][$vid]['#default_value'] = array($album->tid); |
$form['taxonomy'][$vid]['#default_value'] = array($album->tid); |
| 3097 |
} |
} |