function IIRS_0_standard_location_output($location_arrays, &$location_uniques = array()) { // return null on null input (indicates error) // HTML output // IIRS_0_debug_var_dump( $location_arrays ); $option = 1; $location_output = ''; // return null on null input (indicates error) if (is_null($location_arrays) || IIRS_is_error($location_arrays)) { $location_output = $location_arrays; } else { foreach ($location_arrays as $location_array) { // HTML assemble $location_output .= IIRS_0_location_to_HTML($location_array, $location_uniques, 1 == $option); $option++; } } return $location_output; }
IIRS_0_debug_print("loading TI [" . IIRS_0_CONTENT_TYPE . "] details..."); $TI = IIRS_0_details_TI_user(); if (is_array($TI)) { $is_user_with_one_TI = true; $initiative_name = $TI['name']; $summary = $TI['summary']; $domain = $TI['domain']; // values fo the desciption LI $location_array['description'] = $TI['location_description']; $location_array['latitude'] = $TI['location_latitude']; $location_array['longitude'] = $TI['location_longitude']; $location_array['country'] = $TI['location_country']; $location_array['full_address'] = $TI['location_full_address']; $location_array['granuality'] = $TI['location_granuality']; $location_array['bounds'] = $TI['location_bounds']; $location_options = IIRS_0_location_to_HTML($location_array, $location_uniques, true); // true = selected } else { $IIRS_error = new IIRS_Error(IIRS_USER_NO_ASSOCIATED_TI, 'There is no Initiative associated with this user', 'TI not linked to this user', IIRS_MESSAGE_USER_ERROR, IIRS_MESSAGE_NO_USER_ACTION, $user); IIRS_0_debug_print($IIRS_error); } } else { IIRS_0_debug_print("could not load user: show login screen"); } } // ------------------------------------------------------------- location control if ($towns_searched_for) { // append to the original option // still select the first option in this new list though // which will effectively anull the first selection above $location_options .= IIRS_0_location_search_options($town_name, $location_uniques);