<?php 
function cachesort() {
	global $DB;
	$cachesort = array();
	$sql = "SELECT c.*, cd.categories_name FROM categories c LEFT JOIN categories_description cd ON c.categories_id = cd.categories_id ORDER BY c.sort_order, c.categories_id";
	$result = $DB->query($sql);
	while ($sort = $DB->fetch_array($result)) {
		$cachesort[$sort['parent_id']][$sort['categories_id']] = $sort;
	}
	return $sort;
}


function sort_to_select()


?>