You are here

protected function crumbs_PluginSystem_PluginInfo::get_userWeights in Crumbs, the Breadcrumbs suite 7.2

User-defined weights

Return value

array

See also

crumbs_PluginSystem_PluginInfo::$userWeights

File

lib/PluginSystem/PluginInfo.php, line 226

Class

crumbs_PluginSystem_PluginInfo
Info about available plugins and their weights.

Code

protected function get_userWeights() {
  $user_weights = variable_get('crumbs_weights', array(
    // The user expects the crumbs.home_title plugin to be dominant.
    // @todo There must be a better way to do this.
    'crumbs.home_title' => 0,
  ));

  // '*' always needs to be set.
  if (!isset($user_weights['*'])) {

    // Put '*' last.
    $max = -1;
    foreach ($user_weights as $k => $v) {
      if ($v >= $max) {
        $max = $v;
      }
    }
    $user_weights['*'] = $max + 1;
  }
  return $user_weights;
}