/** * Ajax Response to set match index in widget * * @param none * @return void */ function getMatchBox() { $widget = new LeagueManagerWidget(true); $current = $_POST['current']; $element = $_POST['element']; $operation = $_POST['operation']; $league_id = $_POST['league_id']; $match_limit = $_POST['match_limit'] == 'false' ? false : $_POST['match_limit']; $widget_number = $_POST['widget_number']; $season = $_POST['season']; $group = isset($_POST['group']) ? $_POST['group'] : ''; $home_only = $_POST['home_only']; $date_format = $_POST['date_format']; if ($operation == 'next') { $index = $current + 1; } elseif ($operation == 'prev') { $index = $current - 1; } $widget->setMatchIndex($index, $element); if (isset($group)) { $instance = array('league' => $league_id, 'group' => $group, 'match_limit' => $match_limit, 'season' => $season, 'home_only' => $home_only, 'date_format' => $date_format); } else { $instance = array('league' => $league_id, 'match_limit' => $match_limit, 'season' => $season, 'home_only' => $home_only, 'date_format' => $date_format); } if ($element == 'next') { $parent_id = 'next_matches_' . $widget_number; $match_box = $widget->showNextMatchBox($widget_number, $instance, false); } elseif ($element == 'prev') { $parent_id = 'prev_matches_' . $widget_number; $match_box = $widget->showPrevMatchBox($widget_number, $instance, false); } die("jQuery('div#" . $parent_id . "').fadeOut('fast', function() {\n\t\t\tjQuery('div#" . $parent_id . "').html('" . addslashes_gpc($match_box) . "').fadeIn('fast');\n\t\t});"); }
/** * display previous match box * * @param int $number * @param array $instance */ function leaguemanager_display_prev_match_box($number, $instance) { $widget = new LeagueManagerWidget(true); $widget->showPrevMatchBox($number, $instance); }