You are here

function _simplemeta_meta_calculate_fit in Simple Meta 7

Same name and namespace in other branches
  1. 6.2 simplemeta.module \_simplemeta_meta_calculate_fit()
  2. 7.2 simplemeta.module \_simplemeta_meta_calculate_fit()

Calculate fit of the path i.e. how specific path is.

Parameters

string $path: path to calculate fit

Return value

int fit

See also

_menu_router_build()

1 call to _simplemeta_meta_calculate_fit()
simplemeta_meta_save in ./simplemeta.module
Save meta data.

File

./simplemeta.module, line 729
SimpleMeta module.

Code

function _simplemeta_meta_calculate_fit($path) {
  $fit = 0;
  $parts = explode('/', $path, MENU_MAX_PARTS);
  $number_parts = count($parts);
  $slashes = $number_parts - 1;
  foreach ($parts as $k => $part) {
    if ($part != '%') {
      $fit |= 1 << $slashes - $k;
    }
  }
  return $fit;
}