| | 242 | // Il faudrait avoir un objet pour gerer les profiles, ca permettrait |
| | 243 | // de gerer ca beaucoup plus facilement/efficacement. |
| | 244 | function filter_table_with_weight($table, $access, $weight) |
| | 245 | { |
| | 246 | foreach ($table as $key => $value) |
| | 247 | { |
| | 248 | // on a pas ca dans access? dans le doute, on laisse. |
| | 249 | if (!array_key_exists($key, $access)) |
| | 250 | continue; |
| | 251 | if (access_weight($access[$key]) < access_weight($weight)) |
| | 252 | { |
| | 253 | // on a pas le droit de l'afficher: on le planque. |
| | 254 | unset($table[$key]); |
| | 255 | } |
| | 256 | } |
| | 257 | return $table; |
| | 258 | } |
| | 259 | |
| | 260 | |