From: dongsheng Date: Wed, 25 Mar 2009 01:49:52 +0000 (+0000) Subject: "DATA/MDL-18136, change to moodle coding style and fix incorrect parameter of data_ge... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2d9b3ef2d7e040542a1aaa1a43a0135701cc4e1f;p=moodle.git "DATA/MDL-18136, change to moodle coding style and fix incorrect parameter of data_get_field_from_id" --- diff --git a/mod/data/view.php b/mod/data/view.php index 50f44e272a..93b11b506d 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -154,7 +154,7 @@ } if (!empty($fields)) { foreach($fields as $field) { - $searchfield = data_get_field_from_id($field, $data); + $searchfield = data_get_field_from_id($field->id, $data); //Get field data to build search sql with. If paging is false, get from user. //If paging is true, get data from $search_array which is obtained from the $SESSION (see line 116). if(!$paging) { @@ -613,7 +613,9 @@ if ($mode == 'single') { // Single template $baseurl = 'view.php?d=' . $data->id . '&mode=single&'; - $search && $baseurl .= 'filter=1&'; + if (!empty($search)) { + $baseurl .= 'filter=1&'; + } print_paging_bar($totalcount, $page, $nowperpage, $baseurl, $pagevar='page'); if (empty($data->singletemplate)){ @@ -629,7 +631,9 @@ $baseurl = 'view.php?d='.$data->id.'&'; //send the advanced flag through the URL so it is remembered while paging. $baseurl .= 'advanced='.$advanced.'&'; - $search && $baseurl .= 'filter=1&'; + if (!empty($search)) { + $baseurl .= 'filter=1&'; + } //pass variable to allow determining whether or not we are paging through results. $baseurl .= 'paging='.$paging.'&';