/** * Display/process the Copy options form */ function oik_ms_settings() { p("Use this form to copy oik options values from a site of your choice."); p("You should only need to do this once per new site."); oik_ms_copy_site_settings(); bw_form(); stag("table", "widefat"); $sites = oik_ms_site_list(); bw_select("oik_ms_site", "Source site", null, array("#options" => $sites)); $alts = array(0 => "options", 1 => "more options (alt=1)", 2 => "more options 2 ( alt=2)"); bw_select("oik_ms_alt_source", "Source options set", null, array("#options" => $alts)); bw_select("oik_ms_alt_target", "Target options set", null, array("#options" => $alts)); etag("table"); p(isubmit("_oik_ms_copy_options", "Copy options from site", null, "button-secondary")); etag("form"); }
/** * Create a select for an array options field * * @param string $name field name * @param string $text field label * @param array $array * @param integer $index * @param array $args */ function bw_select_arr($name, $text, $array, $index, $args) { $name_index = $name . '[' . $index . ']'; $value = bw_array_get($array, $index, NULL); bw_select($name_index, $text, $value, $args); }