Exemplo n.º 1
0
            $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);
    $towns_found = !empty($location_options);
}
// ------------------------------------------------------------- editing area
?>
</pre></div>

<div id="IIRS_0">
  <?php 
if ($IIRS_error) {
    // IIRS_0_set_translated_error_message( ... ) uses IIRS_0_set_message( ... )
    IIRS_0_set_translated_error_message($IIRS_error);
} else {
    ?>
  <div class="IIRS_0_h1"><?php 
    IIRS_0_print_translated_HTML_text('setup editor');
         IIRS_0_debug_print("no registrant city found, lets look in the domain name for a city name");
         $city = preg_replace('/\..*|transition|town|transicao/i', '', $domain);
         if ($city) $town_name = $city;
         else {
           IIRS_0_debug_print("no registrant city found in the domain name either, try to get the city name from the IP");
           //TODO: try to get the town from the IP address
           //...
         }
       }
     }
     */
 }
 // ------------------------------------------------------------------------- process as town name
 // user input appears to not be a domain, so treat it as a town name
 IIRS_0_debug_print("treating as a town name");
 $location_options = IIRS_0_location_search_options($town_name);
 if (IIRS_is_error($location_options)) {
     $IIRS_error = $location_options;
 } else {
     $towns_found = !empty($location_options);
 }
 if (!$towns_found) {
     $no_towns_found_disabled = 'disabled="1"';
     $no_towns_found_disabled_class = 'IIRS_0_disabled';
     IIRS_0_debug_print("sending extra geocode fail message");
     $non_fatal_error_email = "No towns found for [{$town_name}]";
     //prevent the error appearing in the translations system
     new IIRS_Error(IIRS_GEOCODE_RESULTS_EMPTY, $non_fatal_error_email, "Geocode [{$mapping_provider}] returned zero results for [{$town_name}]", IIRS_MESSAGE_EXTERNAL_SYSTEM_ERROR, NULL);
 }
 // ------------------------------------------------------------------------- check for already registered initiative_name
 $TI_same_name = IIRS_0_TI_same_name($town_name);