As I am level 80 on all uploaded chars, I can't check level requirements, but cant you throw in a conditional statement?
$weaponlist = Array(Staff, Dagger, 1h Sword, 2h Sword, 1h Axe);
if ($class = DK) { $weaponlist(3,4,5,6,7) }
else if ( etc
not sure what language you are using, but something similar to that should be quick(ish)
http://www.worldofwarcraft.com/info/classes/
this page shows what weapons are available to which classes