If there's only one option for plugin or definition, select it

This commit is contained in:
Nathan Gray 2011-04-04 14:31:37 +00:00
parent cbcc4c6c49
commit af7ad5bec1

View File

@ -205,7 +205,11 @@
$response->addScript("selectbox_add_option('exec[plugin]','$title', '$value',false);"); $response->addScript("selectbox_add_option('exec[plugin]','$title', '$value',false);");
} }
} }
if(count($options['plugin']) == 1) {
$response->assign('exec[plugin]','value',$value);
} else {
$response->addScript("xajax_doXMLHTTP('importexport.importexport_schedule_ui.ajax_get_definitions', '$appname', document.getElementById('exec[plugin]').value);"); $response->addScript("xajax_doXMLHTTP('importexport.importexport_schedule_ui.ajax_get_definitions', '$appname', document.getElementById('exec[plugin]').value);");
}
return $response->getXML(); return $response->getXML();
} }
@ -222,7 +226,11 @@
$response->addScript("selectbox_add_option('exec[definition]','$title', '$value',false);"); $response->addScript("selectbox_add_option('exec[definition]','$title', '$value',false);");
} }
} }
if(count($options['definition']) == 1) {
$response->assign('exec[definition]','value',$value);
} else {
$response->addScript("document.getElementById('exec[definition]').value = ''"); $response->addScript("document.getElementById('exec[definition]').value = ''");
}
return $response->getXML(); return $response->getXML();
} }