Changeset - 1d32948ffcdb
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-16 13:44:00
ohnobinki@ohnopublishing.net
Fix department auto-complete.
1 file changed with 5 insertions and 7 deletions:
0 comments (0 inline, 0 general)
auto.php
Show inline comments
 
@@ -74,14 +74,12 @@ if (!$getsections && count($term_parts) 
 
    if (!file_exists($dept_file))
 
      clean_empty_exit();
 
    $departments = unserialize(file_get_contents($dept_file));
 
    $json_depts = array();
 
    foreach ($departments as $key => $department)
 
      {
 
	if (!strncmp($department, $dept, $dept_strlen))
 
	  $departments[$key] = $department;
 
	else
 
	  unset($departments[$key]);
 
      }
 
    echo json_encode($departments);
 
      if (!strncmp($department, $dept, $dept_strlen))
 
	$json_depts[] = $department;
 

	
 
    echo json_encode($json_depts);
 
    exit(0);
 
  }
 

	
0 comments (0 inline, 0 general)