Changeset:
2a917c0224d4
https://sourceforge.net/p/mrbs/hg-code/ci/2a917c0224d428b96e3fd2e1841053d66e454205
Author:
Campbell Morrison <[email protected]>
Date:
Wed Dec 16 18:05:16 2015 +0000
Log message:
Renamed get_areas() to get_area_names() for consistency with get_rooms()
diffstat:
web/edit_area_room.php | 2 +-
web/functions.inc | 2 +-
web/mrbs_sql.inc | 67 +++++++++++++++++++++++++------------------------
3 files changed, 36 insertions(+), 35 deletions(-)
diffs (108 lines):
diff -r e1d4817162ba -r 2a917c0224d4 web/edit_area_room.php
--- a/web/edit_area_room.php Tue Dec 15 19:00:06 2015 +0000
+++ b/web/edit_area_room.php Wed Dec 16 18:05:16 2015 +0000
@@ -890,7 +890,7 @@
<input type="hidden" name="room" value="<?php echo $row["id"]?>">
<?php
- $areas = get_areas($all=TRUE);
+ $areas = get_area_names($all=TRUE);
if (empty($areas))
{
fatal_error(FALSE, get_vocab('noareas')); // should not happen
diff -r e1d4817162ba -r 2a917c0224d4 web/functions.inc
--- a/web/functions.inc Tue Dec 15 19:00:06 2015 +0000
+++ b/web/functions.inc Wed Dec 16 18:05:16 2015 +0000
@@ -2156,7 +2156,7 @@
$out_html = '';
- $areas = get_areas();
+ $areas = get_area_names();
// Only show the areas if there are more than one of them, otherwise
// there's no point
diff -r e1d4817162ba -r 2a917c0224d4 web/mrbs_sql.inc
--- a/web/mrbs_sql.inc Tue Dec 15 19:00:06 2015 +0000
+++ b/web/mrbs_sql.inc Wed Dec 16 18:05:16 2015 +0000
@@ -1374,6 +1374,40 @@
}
+// Gets an array of area names indexed by area id.
+// If $all=TRUE then all areas are returned, otherwise just the ones that
+// are not disabled
+function get_area_names($all=FALSE)
+{
+ global $tbl_area;
+
+ $areas = array();
+
+ $sql = "SELECT id, area_name FROM $tbl_area";
+ if (empty($all))
+ {
+ $sql .= " WHERE disabled=0";
+ }
+ $sql .= " ORDER BY area_name";
+
+ $res = sql_query($sql);
+
+ if ($res === FALSE)
+ {
+ trigger_error(sql_error(), E_USER_WARNING);
+ }
+ else
+ {
+ for ($i=0; $row = sql_row_keyed($res, $i); $i++)
+ {
+ $areas[$row['id']] = $row['area_name'];
+ }
+ }
+
+ return $areas;
+}
+
+
// Get the name of the room with id $id. If $all is set to TRUE then all
rooms
// are searched, otherwise just those which have not been disabled
// Returns FALSE if there is an error, NULL if the id does not exist
@@ -1439,39 +1473,6 @@
}
-// Gets an array of area names indexed by area id.
-// If $all=TRUE then all areas are returned, otherwise just the ones that
-// are not disabled
-function get_areas($all=FALSE)
-{
- global $tbl_area;
-
- $areas = array();
-
- $sql = "SELECT id, area_name FROM $tbl_area";
- if (empty($all))
- {
- $sql .= " WHERE disabled=0";
- }
- $sql .= " ORDER BY area_name";
-
- $res = sql_query($sql);
-
- if ($res === FALSE)
- {
- trigger_error(sql_error(), E_USER_WARNING);
- }
- else
- {
- for ($i=0; $row = sql_row_keyed($res, $i); $i++)
- {
- $areas[$row['id']] = $row['area_name'];
- }
- }
-
- return $areas;
-}
-
function mrbsGetRoomArea($id)
{
global $tbl_room;
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits