From: Iain Patterson Date: Mon, 13 May 2013 09:53:36 +0000 (-0400) Subject: Renamed get_order_state_uri() and get_order_state_string(). X-Git-Tag: 2013-05-13~8 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=17e8e8193bda63754dc60113cba5a2cbaed0f11f;p=readifood.git Renamed get_order_state_uri() and get_order_state_string(). The functions are now get_order_state_query_uri() and get_order_state_query_string() respectively. The original name get_order_state_string() should be used to return a string representation of a given order's state. --- diff --git a/lib/order.php b/lib/order.php index 7872f94..4b1c42e 100644 --- a/lib/order.php +++ b/lib/order.php @@ -28,13 +28,13 @@ else if ($_POST['show_in_area']) { $q = new AreaQuery; $area = $q->findOneById($_POST['area_id']); - header(sprintf("Location: http%s://%s/%s/in/area/%s/%d%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, urlencode($area->getName()), $_POST['area_id'], get_order_state_uri(get_order_state_mask()))); + header(sprintf("Location: http%s://%s/%s/in/area/%s/%d%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, urlencode($area->getName()), $_POST['area_id'], get_order_state_query_uri(get_order_state_mask()))); exit; } else if ($_POST['show_in_city']) { $q = new CityQuery; $city = $q->findOneById($_POST['city_id']); - header(sprintf("Location: http%s://%s/%s/in/city/%s/%d%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, urlencode($city->getName()), $_POST['city_id'], get_order_state_uri(get_order_state_mask()))); + header(sprintf("Location: http%s://%s/%s/in/city/%s/%d%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, urlencode($city->getName()), $_POST['city_id'], get_order_state_query_uri(get_order_state_mask()))); exit; } @@ -139,7 +139,7 @@ return $mask; } - function get_order_state_string($mask) { + function get_order_state_query_string($mask) { global $states; $selected = array(); @@ -151,13 +151,13 @@ return implode("+", $selected); } - function get_order_state_uri($mask) { + function get_order_state_query_uri($mask) { global $all_states; if (is_null($mask)) return ""; if ($mask == $all_states) return ""; - return "/state/" . get_order_state_string($mask); + return "/state/" . get_order_state_query_string($mask); } function show_order_areas_form($city_id = null) {