summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrel O\'Pry2008-07-17 04:54:15 (GMT)
committer Darrel O\'Pry2008-07-17 04:54:15 (GMT)
commit6c3526422002ec1dfedc8be82aa27d3c1b4313ce (patch)
tree99a5a008296853caacb44be074c7fd99e75d7660
parent3d3b3ed1d12a725dfc6f76d5dbc338fd054aec80 (diff)
beginning to restore ahah magic... need to figure out the change from the old multiform callback,
and the current widget system....
-rw-r--r--filefield.module6
-rw-r--r--filefield_widget.inc17
2 files changed, 19 insertions, 4 deletions
diff --git a/filefield.module b/filefield.module
index 4ac0c82..9113c8d 100644
--- a/filefield.module
+++ b/filefield.module
@@ -19,6 +19,8 @@ function filefield_init() {
// file hooks and callbacks.
module_load_include('inc', 'filefield', 'filefield_file');
module_load_include('inc', 'filefield', 'field_file');
+
+ drupal_add_js(drupal_get_path('module', 'filefield') .'/filefield.js');
drupal_add_css(drupal_get_path('module', 'filefield') .'/filefield.css');
}
@@ -30,7 +32,7 @@ function filefield_menu() {
$items['filefield/js/upload/%/%/%'] = array(
'page callback' => 'filefield_js',
- 'page arguments' => array(3, 4, 5, 'filefield_file_upload_js'),
+ 'page arguments' => array(3, 4, 5, '_filefield_file_upload'),
'access callback' => 'filefield_edit_access',
'access arguments' => array(3),
'type' => MENU_CALLBACK,
@@ -38,7 +40,7 @@ function filefield_menu() {
);
$items['filefield/js/delete/%/%/%'] = array(
'page callback' => 'filefield_js',
- 'page arguments' => array(3, 4, 5, 'filefield_file_edit_delete_js'),
+ 'page arguments' => array(3, 4, 5, '_filefield_file_delete'),
'access callback' => 'filefield_edit_access',
'access arguments' => array(3),
'type' => MENU_CALLBACK,
diff --git a/filefield_widget.inc b/filefield_widget.inc
index 2a5b6b5..5bb71ae 100644
--- a/filefield_widget.inc
+++ b/filefield_widget.inc
@@ -170,8 +170,15 @@ function filefield_widget_process($element, $edit, &$form_state, $form) {
'#name' => $element['#field_name'] .'_'. $element['#delta'] .'_remove_btn',
'#type' => 'submit',
'#value' => t('Remove'),
- '#process' => array('filefield_widget_process_remove_btn'),
+ '#process' => array('filefield_widget_process_remove_btn', 'form_expand_ahah'),
'#submit' => array('filefield_widget_submit_remove_btn'),
+ '#ahah' => array( // with JavaScript
+ 'path' => 'filefield/js/remove/'. $element['#field_name'] .'/'. $element['#type_name'] .'/'. $element['#delta'],
+ 'wrapper' => $element['#id'],
+ 'method' => 'replace',
+ 'effect' => 'fade',
+ ),
+
'#field_name' => $element['#field_name'],
'#delta' => $element['#delta'],
);
@@ -189,8 +196,14 @@ function filefield_widget_process($element, $edit, &$form_state, $form) {
$element['upload_btn'] = array(
'#type' => 'submit',
'#value' => t('Upload'),
- '#process' => array('filefield_widget_process_upload_btn'),
+ '#process' => array('filefield_widget_process_upload_btn', 'form_expand_ahah'),
'#submit' => array('filefield_widget_submit_upload_btn'),
+ '#ahah' => array( // with JavaScript
+ 'path' => 'filefield/js/upload/'. $element['#field_name'] .'/'. $element['#type_name'] .'/'. $element['#delta'],
+ 'wrapper' => $element['#id'],
+ 'method' => 'replace',
+ 'effect' => 'fade',
+ ),
'#field_name' => $element['#field_name'],
'#delta' => $element['#delta'],
'#type_name' => $element['#type_name'],