本文整理汇总了PHP中JoomleagueHelper::getRoundsOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomleagueHelper::getRoundsOptions方法的具体用法?PHP JoomleagueHelper::getRoundsOptions怎么用?PHP JoomleagueHelper::getRoundsOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomleagueHelper
的用法示例。
在下文中一共展示了JoomleagueHelper::getRoundsOptions方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 11.1
*/
protected function getOptions()
{
// Initialize variables.
$options = array();
$varname = (string) $this->element['varname'];
$project_id = JRequest::getVar($varname);
if (is_array($project_id)) {
$project_id = $project_id[0];
}
if ($project_id) {
$options = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true);
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
示例2: display
public function display($tpl = null)
{
// Get a refrence of the page instance in joomla
$document = JFactory::getDocument();
$version = urlencode(JoomleagueHelper::getVersion());
$css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
$document->addStyleSheet($css);
//add js file
JHTML::_('behavior.mootools');
$model = $this->getModel();
$matches = $model->getMatches();
$config = $model->getTemplateConfig($this->getName());
$project = $model->getProject();
$mdlRound = JModel::getInstance("Round", "JoomleagueModel");
$roundcode = $mdlRound->getRoundcode($model->roundid);
$rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
$this->assignRef('project', $project);
$lists = array();
if (isset($this->project)) {
$this->assignRef('overallconfig', $model->getOverallConfig());
$this->assignRef('config', array_merge($this->overallconfig, $config));
$this->assignRef('teams', $model->getTeamsIndexedByPtid());
$this->assignRef('showediticon', $model->getShowEditIcon());
$this->assignRef('division', $model->getDivision());
$this->assignRef('matches', $matches);
$this->assignRef('roundid', $model->roundid);
$this->assignRef('roundcode', $roundcode);
$this->assignRef('rounds', $model->getRounds());
$this->assignRef('favteams', $model->getFavTeams($project));
$this->assignRef('projectevents', $model->getProjectEvents());
$this->assignRef('model', $model);
$this->assignRef('isAllowed', $model->isAllowed());
$extended = $this->getExtended($this->project->extended, 'project');
$this->assignRef('extended', $extended);
if ($this->overallconfig['show_project_rss_feed'] == 1) {
$mod_name = "mod_jw_srfr";
$rssfeeditems = '';
$rssfeedlink = $this->extended->getValue('COM_JOOMLEAGUE_PROJECT_RSS_FEED_LIVE_RESULTS');
if ($rssfeedlink) {
$this->assignRef('rssfeeditems', $model->getRssFeeds($rssfeedlink, $this->overallconfig['rssitems']));
} else {
$this->assignRef('rssfeeditems', $rssfeeditems);
}
//echo 'rssfeed<br><pre>'.print_r($rssfeedlink,true).'</pre><br>';
/*
if ( $rssfeedlink )
{
$srfrFeedsArray = explode(",",$rssfeedlink);
$perFeedItems = $this->overallconfig['perFeedItems'];
$totalFeedItems = $this->overallconfig['totalFeedItems'];
$feedTimeout = $this->overallconfig['feedTimeout'];
$this->assignRef( 'feedTitle' , $this->overallconfig['feedTitle'] );
$this->assignRef( 'feedFavicon' , $this->overallconfig['feedFavicon'] );
$this->assignRef( 'feedItemTitle' , $this->overallconfig['feedItemTitle'] );
$this->assignRef( 'feedItemDate' , $this->overallconfig['feedItemDate'] );
$feedItemDateFormat = $this->overallconfig['feedItemDateFormat'];
$this->assignRef( 'feedItemDescription' , $this->overallconfig['feedItemDescription'] );
$feedItemDescriptionWordlimit = $this->overallconfig['feedItemDescriptionWordlimit'];
$feedItemImageHandling = $this->overallconfig['feedItemImageHandling'];
$feedItemImageResizeWidth = $this->overallconfig['feedItemImageResizeWidth'];
$feedItemImageResampleQuality = $this->overallconfig['feedItemImageResampleQuality'];
$this->assignRef( 'feedItemReadMore' , $this->overallconfig['feedItemReadMore'] );
$this->assignRef( 'feedsBlockPreText' , $this->overallconfig['feedsBlockPreText'] );
$this->assignRef( 'feedsBlockPostText' , $this->overallconfig['feedsBlockPostText'] );
$this->assignRef( 'feedsBlockPostLink' , $this->overallconfig['feedsBlockPostLink'] );
$feedsBlockPostLinkURL = $this->overallconfig['feedsBlockPostLinkURL'];
$feedsBlockPostLinkTitle = $this->overallconfig['feedsBlockPostLinkTitle'];
$srfrCacheTime = $this->overallconfig['srfrCacheTime'];
$cacheLocation = 'cache'.DS.$mod_name;
$this->assignRef( 'rssfeedoutput',SimpleRssFeedReaderHelper::getFeeds($srfrFeedsArray,$totalFeedItems,$perFeedItems,$feedTimeout,$feedItemDateFormat,$feedItemDescriptionWordlimit,$cacheLocation,$srfrCacheTime,$feedItemImageHandling,$feedItemImageResizeWidth,$feedItemImageResampleQuality,$this->feedFavicon) );
$css = JURI::root().'components/com_joomleague/assets/css/rssfeedstyle.css';
$document->addStyleSheet($css);
}
*/
}
$lists['rounds'] = JHTML::_('select.genericlist', $rounds, 'current_round', 'class="inputbox" size="1" onchange="joomleague_changedoc(this);', 'value', 'text', $project->current_round);
$this->assignRef('lists', $lists);
if (!isset($this->config['switch_home_guest'])) {
$this->config['switch_home_guest'] = 0;
}
if (!isset($this->config['show_dnp_teams_icons'])) {
$this->config['show_dnp_teams_icons'] = 0;
}
if (!isset($this->config['show_results_ranking'])) {
$this->config['show_results_ranking'] = 0;
}
}
$this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
// Set page title
$pageTitle = JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE');
if (isset($this->project->name)) {
$pageTitle .= ': ' . $this->project->name;
}
$document->setTitle($pageTitle);
//build feed links
$feed = 'index.php?option=com_joomleague&view=results&p=' . $this->project->id . '&format=feed';
$rss = array('type' => 'application/rss+xml', 'title' => JText::_('COM_JOOMLEAGUE_RESULTS_RSSFEED'));
// add the links
$document->addHeadLink(JRoute::_($feed . '&type=rss'), 'alternate', 'rel', $rss);
//.........这里部分代码省略.........
示例3: roundsoptions
public function roundsoptions()
{
$req = JRequest::getVar('required', false);
$required = $req == 'true' || $req == '1' ? true : false;
echo json_encode((array) JoomleagueHelper::getRoundsOptions(JRequest::getInt('p'), 'ASC', $required));
}
示例4: display
public function display($tpl = null)
{
// Get a refrence of the page instance in joomla
$document = JFactory::getDocument();
$uri = JFactory::getURI();
$version = urlencode(JoomleagueHelper::getVersion());
$css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
$document->addStyleSheet($css);
$model = $this->getModel();
$config = $model->getTemplateConfig($this->getName());
$project = $model->getProject();
$rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
$model->setProjectId($project->id);
$this->project = $project;
$this->overallconfig = $model->getOverallConfig();
$this->tableconfig = $config;
$this->config = $config;
$model->computeRanking();
$this->model = $model;
$this->round = $model->round;
$this->part = $model->part;
$this->rounds = $rounds;
$this->divisions = $model->getDivisions();
$this->type = $model->type;
$this->from = $model->from;
$this->to = $model->to;
$this->divLevel = $model->divLevel;
$this->currentRanking = $model->currentRanking;
$this->previousRanking = $model->previousRanking;
$this->homeRanking = $model->homeRank;
$this->awayRanking = $model->awayRank;
$this->current_round = $model->current_round;
$this->previousgames = $model->getPreviousGames();
//$this->teams = $model->getTeamsIndexedByPtid());
$this->action = $uri->toString();
$frommatchday[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_RANKING_FROM_MATCHDAY'));
$frommatchday = array_merge($frommatchday, $rounds);
$lists['frommatchday'] = $frommatchday;
$tomatchday[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_RANKING_TO_MATCHDAY'));
$tomatchday = array_merge($tomatchday, $rounds);
$lists['tomatchday'] = $tomatchday;
$opp_arr = array();
$opp_arr[] = JHtml::_('select.option', "0", JText::_('COM_JOOMLEAGUE_RANKING_FULL_RANKING'));
$opp_arr[] = JHtml::_('select.option', "1", JText::_('COM_JOOMLEAGUE_RANKING_HOME_RANKING'));
$opp_arr[] = JHtml::_('select.option', "2", JText::_('COM_JOOMLEAGUE_RANKING_AWAY_RANKING'));
$lists['type'] = $opp_arr;
$this->lists = $lists;
if (!isset($config['colors'])) {
$config['colors'] = "";
}
$this->colors = $model->getColors($config['colors']);
//$this->result = $model->getTeamInfo();
// $this->pageNav = $model->pagenav( "ranking", count( $rounds ), $sr->to );
// $this->pageNav2 = $model->pagenav2( "ranking", count( $rounds ), $sr->to );
// Set page title
$titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE'));
if (!empty($this->project)) {
$titleInfo->projectName = $this->project->name;
$titleInfo->leagueName = $this->project->league_name;
$titleInfo->seasonName = $this->project->season_name;
}
$division = $model->getDivision(JRequest::getInt('division', 0));
if (!empty($division) && $division->id != 0) {
$titleInfo->divisionName = $division->name;
}
$this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $this->config["page_title_format"]);
$document->setTitle($this->pagetitle);
parent::display($tpl);
}
示例5: display
function display($tpl = null)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
$uri = JFactory::getURI();
$params =& JComponentHelper::getParams($option);
$filter_state = $mainframe->getUserStateFromRequest($option . 'mc_filter_state', 'filter_state', '', 'word');
$filter_order = $mainframe->getUserStateFromRequest($option . 'mc_filter_order', 'filter_order', 'mc.match_number', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'mc_filter_order_Dir', 'filter_order_Dir', '', 'word');
$search = $mainframe->getUserStateFromRequest($option . 'mc_search', 'search', '', 'string');
$search_mode = $mainframe->getUserStateFromRequest($option . 'mc_search_mode', 'search_mode', '', 'string');
$division = $mainframe->getUserStateFromRequest($option . 'mc_division', 'division', '', 'string');
$project_id = $mainframe->getUserState($option . 'project');
$search = JString::strtolower($search);
$matches =& $this->get('Data');
$total =& $this->get('Total');
$pagination =& $this->get('Pagination');
$model = $this->getModel();
// state filter
$lists['state'] = JHTML::_('grid.state', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
$lists['search_mode'] = $search_mode;
$projectws =& $this->get('Data', 'projectws');
$roundws =& $this->get('Data', 'roundws');
//build the html options for teams
foreach ($matches as $row) {
if ($row->divhomeid == '') {
$row->divhomeid = 0;
}
if ($row->divawayid == '') {
$row->divawayid = 0;
}
$teams[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'));
$divhomeid = 0;
//apply the filter only if both teams are from the same division
//teams are not from the same division in tournament mode with divisions
if ($row->divhomeid == $row->divawayid) {
$divhomeid = $row->divhomeid;
} else {
$row->divhomeid = 0;
$row->divawayid = 0;
}
if ($projectteams =& $model->getProjectTeamsOptions($divhomeid)) {
$teams = array_merge($teams, $projectteams);
}
$lists['teams_' + $divhomeid] = $teams;
unset($teams);
}
//build the html selectlist for rounds
$model = $this->getModel('projectws');
$ress = JoomleagueHelper::getRoundsOptions($model->_id, 'ASC', true);
foreach ($ress as $res) {
$datum = JoomleagueHelper::convertDate($res->round_date_first, 1) . ' - ' . JoomleagueHelper::convertDate($res->round_date_last, 1);
$project_roundslist[] = JHTML::_('select.option', $res->id, sprintf("%s (%s)", $res->name, $datum));
}
$lists['project_rounds'] = JHTML::_('select.genericList', $project_roundslist, 'rid[]', 'class="inputbox" ' . 'onChange="document.getElementById(\'short_act\').value=\'rounds\';' . 'document.roundForm.submit();" ', 'value', 'text', $roundws->id);
$lists['project_rounds2'] = JHTML::_('select.genericList', $project_roundslist, 'rid', 'class="inputbox" ', 'value', 'text', $roundws->id);
// diddipoeler rounds for change in match
$project_change_roundslist = array();
if ($ress =& JoomleagueHelper::getRoundsOptions($model->_id, 'ASC', true)) {
$project_change_roundslist = array_merge($project_change_roundslist, $ress);
}
$lists['project_change_rounds'] = $project_change_roundslist;
unset($project_change_roundslist);
//build the html selectlist for matches
$overall_config = $model->getTemplateConfig('overall');
if (isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] || isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) {
$match_list = array();
$mdd[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_MATCH'));
foreach ($matches as $row) {
$mdd[] = JHTML::_('select.option', 'index3.php?option=com_joomleague&controller=match&task=editEvents&cid[0]=' . $row->id, $row->team1 . '-' . $row->team2);
}
$RosterEventMessage = isset($overall_config['use_jl_substitution']) && $overall_config['use_jl_substitution'] ? JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_LINEUP') : '';
if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_events']) {
if (isset($overall_config['use_jl_events']) && $overall_config['use_jl_substitution']) {
$RosterEventMessage .= ' / ';
}
$RosterEventMessage .= JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_EVENTS');
}
$RosterEventMessage .= $RosterEventMessage != '' ? ':' : '';
$lists['RosterEventMessage'] = $RosterEventMessage;
$lists['round_matches'] = JHTML::_('select.genericList', $mdd, 'mdd', 'id="mdd" class="inputbox" onchange="jl_load_new_match_events(this,\'eventscontainer\')"', 'value', 'text', '0');
}
//build the html options for extratime
$match_result_type[] = JHTMLSelect::option('0', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_RT'));
$match_result_type[] = JHTMLSelect::option('1', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_OT'));
$match_result_type[] = JHTMLSelect::option('2', JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_SO'));
$lists['match_result_type'] = $match_result_type;
unset($match_result_type);
//build the html options for massadd create type
$createTypes = array(0 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD'), 1 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_1'), 2 => JText::_('COM_JOOMLEAGUE_ADMIN_MATCHES_MASSADD_2'));
$ctOptions = array();
foreach ($createTypes as $key => $value) {
$ctOptions[] = JHTMLSelect::option($key, $value);
}
$lists['createTypes'] = JHTMLSelect::genericlist($ctOptions, 'ct[]', 'class="inputbox" onchange="javascript:displayTypeView();"', 'value', 'text', 1, 'ct');
//.........这里部分代码省略.........
示例6: display
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$uri = JFactory::getURI();
$user = JFactory::getUser();
$model = $this->getModel();
$lists = array();
$projectws = $this->get('Data', 'project');
$teamws = $this->get('Data', 'project_team');
//get the project_player data of the project_team
$project_player = $this->get('Data');
$isNew = $project_player->id < 1;
// fail if checked out not by 'me'
if ($model->isCheckedOut($user->get('id'))) {
$msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_TEAMPLAYER_THEPLAYER'), $project_player->name);
$mainframe->redirect('index.php?option=com_joomleague', $msg);
}
// Edit or Create?
if ($isNew) {
$project_player->order = 0;
}
//build the html select list for positions
#$selectedvalue = ( $project_player->position_id ) ? $project_player->position_id : $default_person->position_id;
$selectedvalue = $project_player->project_position_id;
$projectpositions = array();
$projectpositions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_POSITION'));
if ($res = $model->getProjectPositions()) {
$projectpositions = array_merge($projectpositions, $res);
}
$lists['projectpositions'] = JHtml::_('select.genericlist', $projectpositions, 'project_position_id', 'class="inputbox" size="1"', 'value', 'text', $selectedvalue);
unset($projectpositions);
$matchdays = JoomleagueHelper::getRoundsOptions($projectws->id, 'ASC', false);
// injury details
$myoptions = array();
$myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
$myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
$lists['injury'] = JHtml::_('select.radiolist', $myoptions, 'injury', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury);
unset($myoptions);
$lists['injury_date'] = JHtml::_('select.genericlist', $matchdays, 'injury_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury_date);
$lists['injury_end'] = JHtml::_('select.genericlist', $matchdays, 'injury_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->injury_end);
// suspension details
$myoptions = array();
$myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
$myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
$lists['suspension'] = JHtml::_('select.radiolist', $myoptions, 'suspension', 'class="radio" size="1"', 'value', 'text', $project_player->suspension);
unset($myoptions);
$lists['suspension_date'] = JHtml::_('select.genericlist', $matchdays, 'suspension_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->suspension_date);
$lists['suspension_end'] = JHtml::_('select.genericlist', $matchdays, 'suspension_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->suspension_end);
// away details
$myoptions = array();
$myoptions[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_NO'));
$myoptions[] = JHtml::_('select.option', '1', JText::_('COM_JOOMLEAGUE_GLOBAL_YES'));
$lists['away'] = JHtml::_('select.radiolist', $myoptions, 'away', 'class="inputbox" size="1"', 'value', 'text', $project_player->away);
unset($myoptions);
$lists['away_date'] = JHtml::_('select.genericlist', $matchdays, 'away_date', 'class="inputbox" size="1"', 'value', 'text', $project_player->away_date);
$lists['away_end'] = JHtml::_('select.genericlist', $matchdays, 'away_end', 'class="inputbox" size="1"', 'value', 'text', $project_player->away_end);
$this->form = $this->get('form');
$extended = $this->getExtended($project_player->extended, 'teamplayer');
$this->extended = $extended;
#$this->default_person = $default_person;
$this->projectws = $projectws;
$this->teamws = $teamws;
$this->lists = $lists;
$this->project_player = $project_player;
$this->addToolbar();
parent::display($tpl);
}
示例7: _displayMenu
function _displayMenu($tpl = null)
{
$option = JRequest::getCmd('option');
$mainframe = JFactory::getApplication();
JHTML::_('behavior.mootools');
$db = JFactory::getDBO();
$document = JFactory::getDocument();
$version = urlencode(JoomleagueHelper::getVersion());
$document->addScript(JURI::base() . 'components/com_joomleague/assets/js/quickmenu.js?v=' . $version);
$uri = JFactory::getURI();
$model = $this->getModel('project');
$params = JComponentHelper::getParams($option);
$stid = JRequest::getVar('stid', array(0), '', 'array');
$sports_type_id = $mainframe->getUserState($option . 'sportstypes', 0);
if ($stid[0] > 0 || $sports_type_id > 0) {
if ($stid[0] > 0) {
$mainframe->setUserState($option . 'sportstypes', $stid[0]);
}
} else {
$defsportstype = $params->get("defsportstype");
$defsportstype = empty($defsportstype) ? "1" : $params->get("defsportstype");
$mainframe->setUserState($option . 'sportstypes', $defsportstype);
}
$seasonnav = $mainframe->getUserState($option . 'seasonnav');
$pid = JRequest::getVar('pid', array(0), '', 'array');
if ($pid[0] > 0) {
$mainframe->setUserState($option . 'project', $pid[0]);
$model->setId($pid[0]);
}
$project = $this->get('Data');
$model = $this->getModel();
$use_seasons = $params->get('cfg_show_seasons_in_project_drop_down', 0);
//Use seasons in dropdown or not
//build the html select list for sports-types
$sports_type_id = $mainframe->getUserState($option . 'sportstypes', 0);
$project_id = $pid[0];
if ($sports_type_id > 0) {
$project_id = $mainframe->getUserState($option . 'project', 0);
}
$allSportstypes = JoomleagueModelSportsTypes::getSportsTypes();
$sportstypes[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SPORTSTYPE'), 'id', 'name');
$allSportstypes = array_merge($sportstypes, $allSportstypes);
$lists['sportstypes'] = JHTML::_('select.genericList', $allSportstypes, 'stid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $sports_type_id);
if ($mainframe->getUserState($option . 'sportstypes', 0)) {
// seasons
$seasons[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SEASON'), 'id', 'name');
$seasons = array_merge($seasons, $model->getSeasons());
$lists['seasons'] = JHTML::_('select.genericList', $seasons, 'seasonnav', 'class="inputbox" style="width:100%"', 'id', 'name', $seasonnav);
//build the html select list for projects
$projects[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name');
//check if the season filter is set and select the needed projects
if (!$use_seasons) {
if ($res = $model->getProjectsBySportsType($sports_type_id, $seasonnav)) {
$projects = array_merge($projects, $res);
}
} else {
if ($res = $model->getSeasonProjects($seasonnav)) {
$projects = array_merge($projects, $res);
}
}
$lists['projects'] = JHTML::_('select.genericList', $projects, 'pid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $project_id);
}
// if a project is active we create the teams and rounds select lists
if ($project_id > 0) {
$team_id = JRequest::getInt("ptid", 0);
if ($team_id == 0) {
$team_id = $mainframe->getUserState($option . 'project_team_id');
}
$projectteams[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text');
if ($res = $model->getProjectteams()) {
$projectteams = array_merge($projectteams, $res);
}
$lDummy = 'class="inputbox" ';
$lDummy .= 'style="width:100%"';
$lists['projectteams'] = JHTML::_('select.genericList', $projectteams, 'tid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $team_id);
$round_id = $mainframe->getUserState($option . 'round_id');
$projectrounds[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_ROUND'), 'value', 'text');
$mdlRound = JModel::getInstance("Round", "JoomleagueModel");
$mdlRound->setId($project->current_round);
$round = $mdlRound->getData();
$projectrounds[] = JHTML::_('select.option', $round->id, JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_CURRENT_ROUND'), 'value', 'text');
if ($ress = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true)) {
foreach ($ress as $res) {
$project_roundslist[] = JHTML::_('select.option', $res->value, $res->text);
}
$projectrounds = array_merge($projectrounds, $project_roundslist);
}
$lists['projectrounds'] = JHTML::_('select.genericList', $projectrounds, 'rid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $round_id);
}
$imagePath = 'administrator/components/com_joomleague/assets/images/';
$tabs = array();
$pane = new stdClass();
$pane->title = JText::_('COM_JOOMLEAGUE_D_MENU_GENERAL');
$pane->name = 'General data';
$pane->alert = false;
$tabs[] = $pane;
$content['General data'] = $link = array();
$label = array();
$limage = array();
$link1 = array();
//.........这里部分代码省略.........
示例8: display
function display($tpl = null)
{
JHtml::_('behavior.framework');
$mainframe = JFactory::getApplication();
$params =& $mainframe->getParams();
// get a reference of the page instance in joomla
$document = JFactory::getDocument();
$uri = JFactory::getURI();
// add the css files
$version = urlencode(JoomleagueHelper::getVersion());
$css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
$document->addStyleSheet($css);
// add some javascript
$version = urlencode(JoomleagueHelper::getVersion());
$document->addScript(JUri::base(true) . '/components/com_joomleague/assets/js/results.js?v=' . $version);
// add the ranking model
$rankingmodel = new JoomleagueModelRanking();
$project = $rankingmodel->getProject();
// add the ranking config file
$rankingconfig = $rankingmodel->getTemplateConfig('ranking');
$rankingmodel->computeRanking();
// add the results model
$resultsmodel = new JoomleagueModelResults();
// add the results config file
$mdlRound = JModelLegacy::getInstance("Round", "JoomleagueModel");
$roundcode = $mdlRound->getRoundcode($rankingmodel->round);
$rounds = JoomleagueHelper::getRoundsOptions($project->id, 'ASC', true);
$resultsconfig = $resultsmodel->getTemplateConfig('results');
if (!isset($resultsconfig['switch_home_guest'])) {
$resultsconfig['switch_home_guest'] = 0;
}
if (!isset($resultsconfig['show_dnp_teams_icons'])) {
$resultsconfig['show_dnp_teams_icons'] = 0;
}
if (!isset($resultsconfig['show_results_ranking'])) {
$resultsconfig['show_results_ranking'] = 0;
}
// merge the 2 config files
$config = array_merge($rankingconfig, $resultsconfig);
$this->model = $rankingmodel;
$this->project = $resultsmodel->getProject();
$this->overallconfig = $resultsmodel->getOverallConfig();
$this->config = array_merge($this->overallconfig, $config);
$this->tableconfig = $rankingconfig;
$this->params = $params;
$this->showediticon = $resultsmodel->getShowEditIcon();
$this->division = $resultsmodel->getDivision();
$this->divisions = $rankingmodel->getDivisions();
$this->divLevel = $rankingmodel->divLevel;
$this->matches = $resultsmodel->getMatches();
$this->round = $resultsmodel->roundid;
$this->roundid = $resultsmodel->roundid;
$this->roundcode = $roundcode;
$rounds = $resultsmodel->getRoundOptions();
$options = $this->getRoundSelectNavigation($rounds);
$this->matchdaysoptions = $options;
$this->currenturl = JoomleagueHelperRoute::getResultsRankingRoute($resultsmodel->getProject()->slug, $this->round);
$this->rounds = $resultsmodel->getRounds();
$this->favteams = $resultsmodel->getFavTeams($this->project);
$this->projectevents = $resultsmodel->getProjectEvents();
$this->model = $resultsmodel;
$this->isAllowed = $resultsmodel->isAllowed();
$this->type = $rankingmodel->type;
$this->from = $rankingmodel->from;
$this->to = $rankingmodel->to;
$this->currentRanking = $rankingmodel->currentRanking;
$this->previousRanking = $rankingmodel->previousRanking;
$this->homeRanking = $rankingmodel->homeRank;
$this->awayRanking = $rankingmodel->awayRank;
$this->current_round = $rankingmodel->current_round;
$this->teams = $rankingmodel->getTeamsIndexedByPtid($resultsmodel->getDivisionID());
$this->previousgames = $rankingmodel->getPreviousGames();
$this->action = $uri->toString();
//rankingcolors
if (!isset($this->config['colors'])) {
$this->config['colors'] = "";
}
$this->colors = $rankingmodel->getColors($this->config['colors']);
// Set page title
if ($this->params->get('what_to_show_first', 0) == 0) {
$prefix = JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE');
$pageTitleFormat = $resultsconfig["page_title_format"];
} else {
$prefix = JText::_('COM_JOOMLEAGUE_RANKING_PAGE_TITLE') . ' & ' . JText::_('COM_JOOMLEAGUE_RESULTS_PAGE_TITLE');
$pageTitleFormat = $rankingconfig["page_title_format"];
}
$titleInfo = JoomleagueHelper::createTitleInfo($prefix);
if (!empty($this->project)) {
$titleInfo->projectName = $this->project->name;
$titleInfo->leagueName = $this->project->league_name;
$titleInfo->seasonName = $this->project->season_name;
}
if (!empty($this->division) && $this->division->id != 0) {
$titleInfo->divisionName = $this->division->name;
}
$this->pagetitle = JoomleagueHelper::formatTitle($titleInfo, $pageTitleFormat);
$document->setTitle($this->pagetitle);
/*
//build feed links
$feed = 'index.php?option=com_joomleague&view=results&p='.$this->project->id.'&format=feed';
//.........这里部分代码省略.........
示例9:
?>
' />
<?php
echo JHTML::_('form.token');
?>
<table class='blog' cellpadding='0' cellspacing='0'>
<tr>
<td class='sectiontableheader'><b><?php
echo JText::_('COM_JOOMLEAGUE_PRED_ENTRY_SUBTITLE_01');
?>
</b></td>
<td class='sectiontableheader' style='text-align:right; ' width='20%' nowrap='nowrap' >
<?php
$rounds = JoomleagueHelper::getRoundsOptions($predictionProject->project_id);
// $htmlRoundsOptions = JHTML::_('select.genericlist',$rounds,'current_round','class="inputbox" size="1" onchange="document.forms[\'resultsRoundSelector\'].r.value=this.value;submit()"','value','text',$this->model->roundID);
$htmlRoundsOptions = JHTML::_('select.genericlist', $rounds, 'r', 'class="inputbox" size="1" onchange="this.form.submit();"', 'value', 'text', $this->model->roundID);
echo JText::sprintf('COM_JOOMLEAGUE_PRED_ENTRY_SUBTITLE_02', $htmlRoundsOptions, $this->model->createProjectSelector($this->model->_predictionProjectS, $predictionProject->project_id));
?>
</td>
</tr>
</table><br />
<?php
echo JHTML::_('form.token');
?>
</form>
<?php
$formName = 'predictionDoTipp' . $predictionProject->project_id;
?>
<form name='<?php
示例10: _displayMenu
function _displayMenu($tpl = null)
{
$option = $this->input->getCmd('option');
$app = JFactory::getApplication();
JHtml::_('behavior.framework');
$db = JFactory::getDbo();
$document = JFactory::getDocument();
$version = urlencode(JoomleagueHelper::getVersion());
$document->addScript(JUri::base() . 'components/com_joomleague/assets/js/quickmenu.js?v=' . $version);
$uri = JFactory::getURI();
$model = $this->getModel('project');
$params = JComponentHelper::getParams($option);
// catch variables
$pid = JRequest::getVar('pid', array(0), '', 'array');
$stid = JRequest::getVar('stid', array(0), '', 'array');
// Project variable request + Sporttype variable request = ''
if ($pid[0] > 0 && $stid[0] == '') {
$model->setId($pid[0]);
$project = $this->get('Data');
$sports_type_id = $project->sports_type_id;
} else {
// defaulting to state
$sports_type_id = $app->getUserState($option . 'sportstypes', 0);
}
// Sporttype variable request + sporttypeid
if ($stid[0] > 0 || $sports_type_id > 0) {
if ($stid[0] > 0) {
$app->setUserState($option . 'sportstypes', $stid[0]);
}
if ($sports_type_id > 0) {
$app->setUserState($option . 'sportstypes', $sports_type_id);
}
} else {
$defsportstype = $params->get("defsportstype");
$defsportstype = empty($defsportstype) ? "1" : $params->get("defsportstype");
$app->setUserState($option . 'sportstypes', $defsportstype);
}
$seasonnav = $app->getUserState($option . 'seasonnav');
$pid = JRequest::getVar('pid', array(0), '', 'array');
if ($pid[0] > 0) {
$app->setUserState($option . 'project', $pid[0]);
$model->setId($pid[0]);
}
$project = $this->get('Data');
$model = $this->getModel();
$use_seasons = $params->get('cfg_show_seasons_in_project_drop_down', 0);
//Use seasons in dropdown or not
//build the html select list for sports-types
$sports_type_id = $app->getUserState($option . 'sportstypes', 0);
$project_id = $pid[0];
if ($sports_type_id > 0) {
$project_id = $app->getUserState($option . 'project', 0);
}
$allSportstypes = JoomleagueModelSportsTypes::getSportsTypes();
$sportstypes[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SPORTSTYPE'), 'id', 'name');
$allSportstypes = array_merge($sportstypes, $allSportstypes);
$lists['sportstypes'] = JHtml::_('select.genericList', $allSportstypes, 'stid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $sports_type_id);
if ($app->getUserState($option . 'sportstypes', 0)) {
// seasons
$seasons[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_SEASON'), 'id', 'name');
$seasons = array_merge($seasons, $model->getSeasons());
$lists['seasons'] = JHtml::_('select.genericList', $seasons, 'seasonnav', 'class="inputbox" style="width:100%"', 'id', 'name', $seasonnav);
//build the html select list for projects
$projects[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name');
//check if the season filter is set and select the needed projects
if (!$use_seasons) {
if ($res = $model->getProjectsBySportsType($sports_type_id, $seasonnav)) {
$projects = array_merge($projects, $res);
}
} else {
if ($res = $model->getSeasonProjects($seasonnav)) {
$projects = array_merge($projects, $res);
}
}
$lists['projects'] = JHtml::_('select.genericList', $projects, 'pid[]', 'class="inputbox" style="width:100%"', 'id', 'name', $project_id);
}
// if a project is active we create the teams and rounds select lists
if ($project_id > 0) {
$team_id = JRequest::getInt("ptid", 0);
if ($team_id == 0) {
$team_id = $app->getUserState($option . 'project_team_id');
}
$projectteams[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text');
if ($res = $model->getProjectteams()) {
$projectteams = array_merge($projectteams, $res);
}
$lDummy = 'class="inputbox" ';
$lDummy .= 'style="width:100%"';
$lists['projectteams'] = JHtml::_('select.genericList', $projectteams, 'tid[]', 'class="inputbox" style="width:100%"', 'value', 'text', $team_id);
$round_id = $app->getUserState($option . 'round_id');
$projectrounds[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_ROUND'), 'value', 'text');
$mdlRound = JModelLegacy::getInstance("Round", "JoomleagueModel");
$mdlRound->setId($project->current_round);
$round = $mdlRound->getData();
$projectrounds[] = JHtml::_('select.option', $round->id, JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_CURRENT_ROUND'), 'value', 'text');
if ($ress = JoomleagueHelper::getRoundsOptions($project_id, 'ASC', true)) {
foreach ($ress as $res) {
$project_roundslist[] = JHtml::_('select.option', $res->value, $res->text);
}
$projectrounds = array_merge($projectrounds, $project_roundslist);
//.........这里部分代码省略.........