Changeset - 7ce16688498d
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-13 17:57:42
ohnobinki@ohnopublishing.net
Sort the college profiles listed on the ``School Selection'' page.
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
admin/rehash.php
Show inline comments
 
@@ -89,12 +89,23 @@ function school_list()
 

	
 
  return $school_id_list;
 
}
 

	
 
/**
 
 * \brief
 
 *   Compare the two schools by their names.
 
 *
 
 * \see strcmp()
 
 */
 
function school_cmp($school_a, $school_b)
 
{
 
  return strcmp($school_a['name'], $school_b['name']);
 
}
 

	
 
/**
 
 * \brief
 
 *   Write out the cache file which remembers the list of available
 
 *   schools.
 
 *
 
 * \todo
 
 *   If the list of displayed schools is to be sorted, this is the
 
 *   place to do it.
 
@@ -130,12 +141,13 @@ function school_cache($schools)
 
	   * school combined with the previous parts
 
	   */
 
	  $domain_part = array_shift($domain_parts);
 
	  $domain_cache_ptr[$domain_part] = $school['id'];
 
	}
 
    }
 
  uasort($list_cache, 'school_cmp');
 

	
 
  $cache = array('list' => $list_cache, 'domains' => $domain_cache);
 

	
 

	
 
  $cache_file_name = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
 
    . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'schools';
0 comments (0 inline, 0 general)