// The story so far...
function fringslate_menu() {
/*
* Lots of irrelevant menu entries
* ...and then:
*/
$items['strings/js'] =
array(
'title' => 'administer fring strings',
'page callback' => "fr_strings_admin_ajax",
'access arguments' =>
array('create strings'),
);
}
function fr_strings_admin_form($form_id, $strings) {
foreach($strings as $string){
if(!
empty($string['nid'])) {
$form['str_key'.
$string['nid']] =
array(
'#type' => 'textfield',
'#size' => '20',
'#default_value' => $string['str_key'],
'event' => 'change',
'path' => 'strings/js',
)
);
/*
* some other form fields
* ...
*/
}
return $form;
}
function fr_strings_admin_ajax(){
//just testing this out to learn how it works
$cache =
cache_get('form_'.
$_POST['form_build_id'],
'cache_form');
$form = $cache->data;
$form_state =
array('values' =>
$_POST);
// for right now I'm writing to a file so that I can see what's going on back there
$handle =
fopen("/home/lisha/ajax.txt",
"w");
// here's where I want to see what's going on so that I can figure out what to write next
$output =
drupal_render($form) ;
//this gives me a form with NO names or ids... WHY?? Oh, dear.
}