]> git.mjollnir.org Git - moodle.git/commitdiff
"DATA/MDL-18136, change to moodle coding style and fix incorrect parameter of data_ge...
authordongsheng <dongsheng>
Wed, 25 Mar 2009 01:49:52 +0000 (01:49 +0000)
committerdongsheng <dongsheng>
Wed, 25 Mar 2009 01:49:52 +0000 (01:49 +0000)
mod/data/view.php

index 50f44e272a83e9a0ad9d72143d7796c49ba97fb6..93b11b506d6be396a9c9f3f0808c1591bf444c0c 100755 (executable)
         }
         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) {
 
             if ($mode == 'single') {                  // Single template
                 $baseurl = 'view.php?d=' . $data->id . '&amp;mode=single&amp;';
-                $search && $baseurl .= 'filter=1&amp;';
+                if (!empty($search)) {
+                    $baseurl .= 'filter=1&amp;';
+                }
                 print_paging_bar($totalcount, $page, $nowperpage, $baseurl, $pagevar='page');
 
                 if (empty($data->singletemplate)){
                 $baseurl = 'view.php?d='.$data->id.'&amp;';
                 //send the advanced flag through the URL so it is remembered while paging.
                 $baseurl .= 'advanced='.$advanced.'&amp;';
-                $search && $baseurl .= 'filter=1&amp;';
+                if (!empty($search)) {
+                    $baseurl .= 'filter=1&amp;';
+                }
                 //pass variable to allow determining whether or not we are paging through results.
                 $baseurl .= 'paging='.$paging.'&amp;';