LeagueManager Hook Reference

On this page you find a list of Filters and Actions used in LeagueManager. For examples on usage see sports files in the sports subdirectory or lib/stats.php.

Filter

  • leaguemanager_sports
    • lib/core.php: function getLeagueTypes()
    • manipulate available sport types
  • rank_teams_$sport
    • lib/core.php: function rankTeams()
    • rank teams with sport specific settings
  • leaguemanager_cards
    • lib/core.php: function getCards()
    • manipulate card types (yellow, red, yellow-red)
  • league_menu_$sport & league_menu_$mode
    • admin/admin.php: function getMenu()
    • manipulate league menu based on current sport type and mode
  • leaguemanager_modes
    • admin/admin.php: function getModes()
    • manipulate available modes
  • leaguemanager_point_rule_list
    • admin/admin.php: function getPointRules()
    • manipulate List of available point rules
  • leaguemanager_point_rules
    • admin/admin.php: function getPointRule()
    • manipulate point rules
  • leaguemanager_point_formats
    • admin/admin.php: function getPointFormats()
    • manipulate available point formats
  • team_points2_$sport
    • admin/admin.php: function saveStandings()
    • calculate secondary points for based on current sport type
    • secondary points are goals in soccer and apparatus points in gymnastics
    • input naming structure name=”custom[$team_id][points2][plus]” and name=”custom[$team_id][points2][minus] for manual saving of standing table
  • team_points_$sport
    • admin/admin.php: function calculatePoints()
    • manipulate team points based on current sport rules
    • parameters:
      • array $points: assoziative array of points
      • int $team_id: current team ID
      • array $rule:  assoziative array of rules forwin, draw, lost etc.
  • leaguemanager_import_teams_$sport
    • admin/admin.php: function importTeams()
    • filter custom data for team
    • parameters
      • array $custom: assoziative array of custom variables array( $key => $value )
      • array $line: numbered array of columns, first index is 8
  • leaguemanager_import_matches_$sport
    • admin/admin.php: function importMatches()
    • filter custom data for match
    • parameters
      • array $custom: assoziative array of custom variables array( $key => $value )
      • array $line: numbered array of columns, first index is 8
      • int $match_id: ID of match
  • leaguemanager_export_teams_header_$sport
    • admin/admin.php: function exportTeams()
    • append custom header data for team export
    • parameter: string $contents current content; data is separated by TAB (\t)
  • leaguemanager_export_teams_data_$sport
    • admin/admin.php: function exportTeams()
    • append custom data for team export
    • parameters
      • string $contents current content; data is separated by TAB (\t)
      • object $team: current team  object
  • leaguemanager_export_matches_header_$sport
    • admin/admin.php: function exportMatches()
    • append custom header data for match export
    • parameter: string $contents current content; data is separated by TAB (\t)
  • leaguemanager_export_matches_data_$sport
    • admin/admin.php: function exportMatches()
    • append custom data for match export
    • parameters
      • string $contents current content; data is separated by TAB (\t)
      • object $match: current match object

Actions

  • leaguemanager_save_standings_$sport
    • admin/admin.php: function saveStandings()
    • called when standings are saved for each team in automatic mode
    • parameter: int $team_id ID of current team
  • leaguemanager_update_results_$sport
    • admin/admin.php function updateResults()
    • called when results for each match are saved
    • parameter: int $match_id ID of current match
  • leaguemanager_standings_header_$sport
    • admin/show-league.php, view/standings-extend.php
    • add additional columns to standings table header
  • leaguemanager_standings_columns_$sport
    • admin/show-league.php, view/standings-extend.php
    • add additional columns to standings table
    • input naming structure name=”custom[$team_id][points2][plus]” and name=”custom[$team_id][points2][minus] for secondary points. Otherwise name=”custom[$name]“. Access via $team->$name.
    • parameters
      • object $team: current team object
      • string $point_rule: current point rule, required for manual saving of standings to  add input fields
  • matchtable_header_$sport
    • admin/show-league.php
    • add additional columns to match table header
  • matchtable_columns_$sport
    • admin/show-league.php
    • add additional columns to match table table
    • input naming structure name=”custom[$match_id][$name]“. Access via $match->$name
    • parameters
      • object $match: current match object
  • leaguemanager_edit_match_$sport
    • admin/match.php
    • substitute match edit form with custom form
    • parameters
      • object $league:  current league object
      • array $teams: assoziative array of teams array( $team_id => $data )
      • array $season: current season array( “name”, “num_match_days”)
      • int $max_matches: number of matches to edit or add
      • array $matches: all matches
      • string $submit_title: title for submit button
      • string $mode: current mode ‘add’ or ‘edit’
  • league_settings, league_settings_$sport, league_settings_$mode
    • admin/settings.php
    • add custom settings for league
    • name structure of input fields is name=”settings[$name]“
    • access of values is $league->$name
  • team_edit_form, team_edit_form_$sport
    • admin/team.php
    • add custom fields for team; used to add hidden input fields based on sport type
    • input name structure is name=”custom[$name]“
    • access of values is $team->$name
  • leaguemanager_doc_sports
    • admin/documentation.php
    • add documentation on specific sport type
  • leaguemanager_doc_point_rules
    • admin/documentation.php
    • add documentation on point rules
  • leaguemanager_widget_next_match, leaguemanager_widget_prev_match
    • lib/widget.php
    • call next or previous match respectiveley
    • remove action before hooking own function by remove_all_actions(‘leaguemanager_widget_next_match’) or remove_all_action(‘leaguemanager_widget_prev_match’)
    • parameters
      • int $widget_number: number of widget
      • int $league_id: ID of current league
      • string $season: current season
      • int $match_limit: maximum number of matches to display
    • leaguemanager_team_page
      • view/teams.php
      • display infopage of single team
      • parameter: array( ‘id’ => id of team, ‘echo’ => 1 )