コード例 #1
0
 function _displayModal($tpl)
 {
     $mainframe = JFactory::getApplication();
     // Do not allow cache
     JResponse::allowCache(false);
     $document = JFactory::getDocument();
     $prjid = array();
     $prjid = JRequest::getVar('prjid', array(0), 'post', 'array');
     $proj_id = (int) $prjid[0];
     //build the html select list for projects
     $projects[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PROJECT'), 'id', 'name');
     if ($res = JoomleagueHelper::getProjects()) {
         $projects = array_merge($projects, $res);
     }
     $lists['projects'] = JHTMLSelect::genericlist($projects, 'prjid[]', 'class="inputbox" onChange="this.form.submit();" style="width:170px"', 'id', 'name', $proj_id);
     unset($projects);
     $projectteams[] = JHTMLSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_TEAM'), 'value', 'text');
     // if a project is active we show the teams select list
     if ($proj_id > 0) {
         if ($res = JoomleagueHelper::getProjectteams($proj_id)) {
             $projectteams = array_merge($projectteams, $res);
         }
         $lists['projectteams'] = JHTMLSelect::genericlist($projectteams, 'xtid[]', 'class="inputbox" style="width:170px"', 'value', 'text');
         unset($projectteams);
     }
     $this->assignRef('lists', $lists);
     $this->assignRef('project_id', $proj_id);
     parent::display($tpl);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $jinput = $app->input;
     $option = $jinput->getCmd('option');
     $uri = JFactory::getURI();
     $lists = array();
     $filter_order = $app->getUserStateFromRequest($this->get('context') . '.filter_order', 'filter_order', 's.ordering', 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest($this->get('context') . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $filter_state = $app->getUserStateFromRequest($this->get('context') . '.filter_state', 'filter_state', 'P', 'word');
     $search = $app->getUserStateFromRequest($this->get('context') . '.search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     // state filter
     $lists['state'] = JoomleagueHelper::stateOptions($filter_state);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     $this->items = $items;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     $this->addToolbar();
     parent::display($tpl);
 }
コード例 #3
0
 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);
     // Joomleague model
     $model = $this->getModel();
     $user = JFactory::getUser();
     $rankingconfig = $model->getTemplateConfig("ranking");
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getTemplateConfig('overall'));
     $this->assignRef('rankingconfig', $rankingconfig);
     $this->assignRef('playgrounds', $model->getPlaygrounds());
     $this->assignRef('match', $model->getMatch());
     $this->assignRef('team1', $model->getTeaminfo($this->match->projectteam1_id));
     $this->assignRef('team2', $model->getTeaminfo($this->match->projectteam2_id));
     $isAllowed = $model->isAllowed() || $model->isMatchAdmin($this->match->id, $user->id);
     $this->assignRef('showediticon', $isAllowed);
     //echo '<br /><pre>~' . print_r( $this->match, true ) . '~</pre><br />';
     // extended match data
     $xmlfile = JLG_PATH_ADMIN . DS . 'assets' . DS . 'extended' . DS . 'match.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($this->match->extended, 'ini');
     $extended =& JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $lists = array();
     // build the html select booleanlist for cancel
     $lists['cancel'] = JHTML::_('select.booleanlist', 'cancel', 'class="inputbox"', $this->match->cancel);
     $playgrounds[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_PLAYGROUND'));
     if (!empty($this->playgrounds)) {
         $playgrounds = array_merge($playgrounds, $this->playgrounds);
     }
     $lists['playgrounds'] = JHTML::_('select.genericlist', $playgrounds, 'playground_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->playground_id);
     //match relation lists
     //$mdlMatch = $model->getMatch();
     $oldmatches[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_EDITMATCH_SELECT_PREV_MATCH'));
     $res = array();
     $new_match_id = $this->match->new_match_id ? $this->match->new_match_id : 0;
     if ($res =& $model->getMatchRelationsOptions($this->project->id, $this->match->id . "," . $new_match_id)) {
         $oldmatches = array_merge($oldmatches, $res);
     }
     unset($res);
     $lists['old_match'] = JHTML::_('select.genericlist', $oldmatches, 'old_match_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->old_match_id);
     $newmatches[] = JHTML::_('select.option', '0', JText::_('COM_JOOMLEAGUE_EDITMATCH_SELECT_NEW_MATCH'));
     $res = array();
     $old_match_id = $this->match->old_match_id ? $this->match->old_match_id : 0;
     if ($res =& $model->getMatchRelationsOptions($this->project->id, $this->match->id . "," . $old_match_id)) {
         $newmatches = array_merge($newmatches, $res);
     }
     unset($res);
     $lists['new_match'] = JHTML::_('select.genericlist', $newmatches, 'new_match_id', 'class="inputbox" size="1"', 'value', 'text', $this->match->new_match_id);
     $this->assignRef('form', $this->get('form'));
     $this->assignRef('extended', $extended);
     $this->assignRef('lists', $lists);
     $pageTitle = JText::_('COM_JOOMLEAGUE_EDITMATCH_MATCHDETAILS');
     $document->setTitle($pageTitle);
     parent::display($tpl);
 }
コード例 #4
0
 public function getExtensions()
 {
     if (!$this->extensions) {
         $this->extensions = JoomleagueHelper::getExtensions($this->input->getInt('p', 0));
     }
     return $this->extensions;
 }
コード例 #5
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     if (!$config) {
         $config = $model->getTemplateConfig('players');
     }
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->rows = $model->getReferees();
     //		$this->positioneventtypes = $model->getPositionEventTypes( ) );
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_REFEREES_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);
 }
コード例 #6
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $document = JFactory::getDocument();
     $version = urlencode(JoomleagueHelper::getVersion());
     $css = 'components/com_joomleague/assets/css/tabs.css?v=' . $version;
     $document->addStyleSheet($css);
     $model = $this->getModel();
     $this->assignRef('club', $model->getClub());
     $lists = array();
     $this->club->merge_teams = explode(",", $this->club->merge_teams);
     $this->assignRef('form', $this->get('Form'));
     // extended club data
     $xmlfile = JLG_PATH_ADMIN . DS . 'assets' . DS . 'extended' . DS . 'club.xml';
     $jRegistry = new JRegistry();
     $jRegistry->loadString($this->club->extended, 'ini');
     $extended =& JForm::getInstance('extended', $xmlfile, array('control' => 'extended'), false, '/config');
     $extended->bind($jRegistry);
     $this->assignRef('extended', $extended);
     $this->assignRef('lists', $lists);
     $this->assign('cfg_which_media_tool', JComponentHelper::getParams('com_joomleague')->get('cfg_which_media_tool', 0));
     $this->assign('cfg_be_show_merge_teams', JComponentHelper::getParams('com_joomleague')->get('cfg_be_show_merge_teams', 0));
     parent::display($tpl);
 }
コード例 #7
0
ファイル: jlgcontroller.php プロジェクト: hfmprs/JoomLeague
 /**
  * Overrides method to first lookup into potential extension for the view.
  */
 protected function createView($name, $prefix = '', $type = '', $config = array())
 {
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $result = null;
         // Clean the view name
         $viewName = preg_replace('/[^A-Z0-9_]/i', '', $name);
         $classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
         $viewType = preg_replace('/[^A-Z0-9_]/i', '', $type);
         // Build the view class name
         $viewClassExtension = $classPrefix . $viewName . ucfirst($extension);
         if (!class_exists($viewClassExtension)) {
             jimport('joomla.filesystem.path');
             $path = JPath::find($this->paths['view'], $this->createFileName('view', array('name' => $viewName, 'type' => $viewType)));
             if ($path) {
                 require_once $path;
                 if (class_exists($viewClassExtension)) {
                     $result = new $viewClassExtension($config);
                     return $result;
                 }
             }
         } else {
             $result = new $viewClassExtension($config);
             return $result;
         }
     }
     // Still here ? Then the extension doesn't override this, use regular view
     return parent::createView($name, $prefix, $type, $config);
 }
コード例 #8
0
ファイル: view.html.php プロジェクト: Heart1010/JoomLeague
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $project = $model->getProject();
     //no treeko !!!
     $config = $model->getTemplateConfig('tree');
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->node = $model->getTreetonode();
     $this->roundname = $model->getRoundName();
     $this->model = $model;
     // Set page title
     ///TODO: treeto name, no project name
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TREETO_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);
 }
コード例 #9
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('person', $person);
     $ref =& $model->getReferee();
     if ($ref) {
         $titleStr = JText::sprintf('COM_JOOMLEAGUE_REFEREE_ABOUT_AS_A_REFEREE', JoomleagueHelper::formatName(null, $ref->firstname, $ref->nickname, $ref->lastname, $this->config["name_format"]));
     } else {
         $titleStr = JText::_('Unknown referee within project');
     }
     $this->assignRef('referee', $ref);
     $this->assignRef('history', $model->getHistory('ASC'));
     $this->assign('title', $titleStr);
     if ($config['show_gameshistory']) {
         $this->assignRef('games', $model->getGames());
         $this->assignRef('teams', $model->getTeamsIndexedByPtid());
     }
     if ($person) {
         $extended = $this->getExtended($person->extended, 'referee');
         $this->assignRef('extended', $extended);
     }
     $document->setTitle($titleStr);
     $this->assign('show_debug_info', JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0));
     parent::display($tpl);
 }
コード例 #10
0
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $person = $model->getPerson();
     $this->assignRef('project', $model->getProject());
     $this->assignRef('overallconfig', $model->getOverallConfig());
     $this->assignRef('config', $config);
     $this->assignRef('person', $person);
     $this->assignRef('showediticon', $model->getAllowed($config['edit_own_player']));
     $staff =& $model->getTeamStaff();
     $titleStr = JText::sprintf('COM_JOOMLEAGUE_STAFF_ABOUT_AS_A_STAFF', JoomleagueHelper::formatName(null, $this->person->firstname, $this->person->nickname, $this->person->lastname, $this->config["name_format"]));
     $this->assignRef('inprojectinfo', $staff);
     $this->assignRef('history', $model->getStaffHistory('ASC'));
     $this->assignRef('stats', $model->getStats());
     $this->assignRef('staffstats', $model->getStaffStats());
     $this->assignRef('historystats', $model->getHistoryStaffStats());
     $this->assign('title', $titleStr);
     $extended = $this->getExtended($person->extended, 'staff');
     $this->assignRef('extended', $extended);
     $document->setTitle($titleStr);
     parent::display($tpl);
 }
コード例 #11
0
ファイル: view.feed.php プロジェクト: Heart1010/JoomLeague
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->link = JRoute::_('index.php?option=com_joomleague');
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->config = $config;
     $this->overallconfig = $model->getOverallConfig();
     $this->homematches = $model->getHomeMatches($config['HomeMatchesOrderBy']);
     $this->awaymatches = $model->getAwayMatches($config['AwayMatchesOrderBy']);
     $this->project = $model->getProject();
     $this->matches = array_merge($this->homematches, $this->awaymatches);
     foreach ($this->matches as $game) {
         $item = new JFeedItem();
         $team1 = $game->tname1;
         $team2 = $game->tname2;
         $date = $game->match_date ? JoomleagueHelper::getMatchDate($game, 'r') : '';
         $result = $game->cancel > 0 ? $game->cancel_reason : $game->team1_result . "-" . $game->team2_result;
         if (!empty($game->team1_result)) {
             $link = 'index.php?option=com_joomleague&view=matchreport&p=';
         } else {
             $link = 'index.php?option=com_joomleague&view=nextmatch&p=';
         }
         $item->title = $team1 . " - " . $team2 . " : " . $result;
         $item->link = JRoute::_($link . $game->project_id . '&mid=' . $game->id);
         $item->description = $game->summary;
         $item->date = $date;
         $item->category = "clubplan";
         // loads item info into rss array
         $document->addItem($item);
     }
 }
コード例 #12
0
 /**
  * Overrides method to try to load model from extension if it exists
  */
 public static function &getInstance($type, $prefix = '', $config = array())
 {
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $modelType = preg_replace('/[^A-Z0-9_\\.-]/i', '', $type);
         $modelClass = $prefix . ucfirst($modelType) . ucfirst($extension);
         $result = false;
         if (!class_exists($modelClass)) {
             jimport('joomla.filesystem.path');
             $path = JPath::find(JModel::addIncludePath(), JModel::_createFileName('model', array('name' => $modelType)));
             if ($path) {
                 require_once $path;
                 if (class_exists($modelClass)) {
                     $result = new $modelClass($config);
                     return $result;
                 }
             }
         } else {
             $result = new $modelClass($config);
             return $result;
         }
     }
     $instance = parent::getInstance($type, $prefix, $config);
     return $instance;
 }
コード例 #13
0
ファイル: jlgmodel.php プロジェクト: hfmprs/JoomLeague
 /**
  * Overrides method to try to load model from extension if it exists
  */
 public static function getInstance($type, $prefix = '', $config = array())
 {
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $modelType = preg_replace('/[^A-Z0-9_\\.-]/i', '', $type);
         $modelClass = $prefix . ucfirst($modelType) . ucfirst($extension);
         $result = false;
         if (!class_exists($modelClass)) {
             jimport('joomla.filesystem.path');
             $path = JPath::find(parent::addIncludePath(null, $prefix), self::_createFileName('model', array('name' => $type)));
             if (!$path) {
                 $path = JPath::find(parent::addIncludePath(null, ''), self::_createFileName('model', array('name' => $type)));
             }
             if ($path) {
                 require_once $path;
                 if (class_exists($modelClass)) {
                     $result = new $modelClass($config);
                     return $result;
                 }
             }
         } else {
             $result = new $modelClass($config);
             return $result;
         }
     }
     // Still here ? Then the extension doesn't override this, use regular way
     return parent::getInstance($type, $prefix, $config);
 }
コード例 #14
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig("player");
     // Get the type of persondata to be shown from the query string
     // pt==1 ==> as player // pt==2 ==> as staffmember  // pt==3 ==> as referee // pt==4 ==> as club-staffmember
     $showType = JRequest::getVar('pt', '1', 'default', 'int');
     if ($showType > 3) {
         $showType = 1;
     }
     $person = $model->getPerson();
     $this->showType = $showType;
     $this->project = $model->getProject();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->person = $person;
     //$extended = $this->getExtended($person->extended, 'person');
     //$this->extended = $extended;
     switch ($showType) {
         case '4':
             $titleStr = 'About %1$s %2$s as a Club staff';
             $this->historyClubStaff = $model->getPersonHistory('ASC');
             break;
         case '3':
             $titleStr = 'About %1$s %2$s as a Referee';
             $this->inprojectinfo = $model->getReferee();
             $this->historyReferee = $model->getRefereeHistory('ASC');
             break;
         case '2':
             $titleStr = 'About %1$s %2$s as a Staff member';
             $this->inprojectinfo = $model->getTeamStaff();
             $this->historyStaff = $model->getStaffHistory('ASC');
             break;
         case '1':
             $titleStr = 'About %1$s %2$s as a Player';
             $this->inprojectinfo = $model->getTeamPlayer();
             $this->historyPlayer = $model->getPlayerHistory('ASC');
             //$this->historyStaff = $model->getStaffHistory('ASC');
             $this->AllEvents = $model->getAllEvents();
             break;
         default:
             break;
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::sprintf($titleStr, $this->person->firstname, $this->person->lastname));
     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);
 }
コード例 #15
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->teams = $model->getTeams();
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMS_TITLE'));
     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, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
コード例 #16
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $app = JFactory::getApplication();
     $uri = JFactory::getURI();
     $lists = array();
     $filter_league = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_league', 'filter_league', '', 'int');
     $filter_sports_type = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_sports_type', 'filter_sports_type', '', 'int');
     $filter_season = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_season', 'filter_season', '', 'int');
     $filter_state = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_state', 'filter_state', 'P', 'word');
     $filter_order = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_order', 'filter_order', 'p.ordering', 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $app->getUserStateFromRequest($option . '.' . $this->get('identifier') . '.search', 'search', '', 'string');
     $search = JString::strtolower($search);
     // Get data from the model
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $javascript = "onchange=\"\$('adminForm').submit();\"";
     // state filter
     // @todo check // 24-07-2015
     // Replaced grid.state by the code below so it's possible to add a class to it.
     $lists['state'] = JoomleagueHelper::stateOptions($filter_state);
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     //build the html select list for leagues
     $leagues[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_PROJECTS_LEAGUES_FILTER'), 'id', 'name');
     $mdlLeagues = JModelLegacy::getInstance('Leagues', 'JoomleagueModel');
     $allLeagues = $mdlLeagues->getLeagues();
     $leagues = array_merge($leagues, $allLeagues);
     $lists['leagues'] = JHtml::_('select.genericList', $leagues, 'filter_league', 'class="input-medium" onChange="this.form.submit();"', 'id', 'name', $filter_league);
     unset($leagues);
     //build the html select list for sportstypes
     $sportstypes[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_PROJECTS_SPORTSTYPE_FILTER'), 'id', 'name');
     $mdlSportsTypes = JModelLegacy::getInstance('SportsTypes', 'JoomleagueModel');
     $allSportstypes = $mdlSportsTypes->getSportsTypes();
     $sportstypes = array_merge($sportstypes, $allSportstypes);
     $lists['sportstypes'] = JHtml::_('select.genericList', $sportstypes, 'filter_sports_type', 'class="input-medium" onChange="this.form.submit();"', 'id', 'name', $filter_sports_type);
     unset($sportstypes);
     //build the html select list for seasons
     $seasons[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_ADMIN_PROJECTS_SEASON_FILTER'), 'id', 'name');
     if ($res = $this->get('Seasons')) {
         $seasons = array_merge($seasons, $res);
     }
     $lists['seasons'] = JHtml::_('select.genericList', $seasons, 'filter_season', 'class="input-medium" onChange="this.form.submit();"', 'id', 'name', $filter_season);
     unset($seasons);
     $user = JFactory::getUser();
     $this->user = $user;
     $this->lists = $lists;
     $this->items = $items;
     $this->pagination = $pagination;
     $url = $uri->toString();
     $this->request_url = $url;
     $this->addToolbar();
     parent::display($tpl);
 }
コード例 #17
0
ファイル: view.html.php プロジェクト: Heart1010/JoomLeague
 function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $eventsconfig = $model->getTemplateConfig("eventsranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $this->project = $model->getProject();
     if (isset($this->project)) {
         $highest_home = $model->getHighestHome();
         $highest_away = $model->getHighestAway();
         $this->division = $model->getDivision();
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->tableconfig = $tableconfig;
         $this->eventsconfig = $eventsconfig;
         $this->actualround = $model->getCurrentRoundNumber();
         $this->highest_home = $highest_home;
         $this->highest_away = $highest_away;
         $this->totals = $model->getSeasonTotals();
         $this->totalrounds = $model->getTotalRounds();
         $this->attendanceranking = $model->getAttendanceRanking();
         $this->bestavg = $model->getBestAvg();
         $this->bestavgteam = $model->getBestAvgTeam();
         $this->worstavg = $model->getWorstAvg();
         $this->worstavgteam = $model->getWorstAvgTeam();
         //hightest home
         $hhHomeTeaminfo = $model->getTeaminfo($highest_home->project_hometeam_id);
         $this->hhHomeTeaminfo = $hhHomeTeaminfo;
         $hhAwayTeaminfo = $model->getTeaminfo($highest_home->project_awayteam_id);
         $this->hhAwayTeaminfo = $hhAwayTeaminfo;
         //highest_away
         $haHomeTeaminfo = $model->getTeaminfo($highest_away->project_hometeam_id);
         $this->haHomeTeaminfo = $haHomeTeaminfo;
         $haAwayTeaminfo = $model->getTeaminfo($highest_away->project_awayteam_id);
         $this->haAwayTeaminfo = $haAwayTeaminfo;
         $limit = 3;
         $this->limit = $limit;
         $this->_setChartdata(array_merge($flashconfig, $config));
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_STATS_PAGE_TITLE'));
     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, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
コード例 #18
0
ファイル: view.feed.php プロジェクト: Heart1010/JoomLeague
 /**
  * return an array of matches indexed by date
  *
  * @return array
  */
 public function sortByDate()
 {
     $dates = array();
     foreach ((array) $this->matches as $m) {
         $matchDate = JoomleagueHelper::getMatchDate($m);
         $dates[$matchDate][] = $m;
     }
     return $dates;
 }
コード例 #19
0
 /**
  * Method to export one or more events
  *
  * @access	public
  * @return	boolean	True on success
  * @since	1.5.0a
  */
 function export($cid = array(), $table, $record_name)
 {
     $result = false;
     if (count($cid)) {
         $mdlJLXExports = JModel::getInstance("jlxmlexports", 'JoomleagueModel');
         JArrayHelper::toInteger($cid);
         $cids = implode(',', $cid);
         $query = "SELECT * FROM #__joomleague_eventtype WHERE id IN ({$cids})";
         $this->_db->setQuery($query);
         $exportData = $this->_db->loadObjectList();
         $SportsTypeArray = array();
         $x = 0;
         foreach ($exportData as $event) {
             $SportsTypeArray[$x] = $event->sports_type_id;
         }
         $st_cids = implode(',', $SportsTypeArray);
         $query = "SELECT * FROM #__joomleague_sports_type WHERE id IN ({$st_cids})";
         $this->_db->setQuery($query);
         $exportDataSportsType = $this->_db->loadObjectList();
         $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
         // open the events
         $output .= "<events>\n";
         $output .= $mdlJLXExports->_addToXml($mdlJLXExports->_getJoomLeagueVersion());
         $record_name = 'SportsType';
         //$tabVar='	';
         $tabVar = '  ';
         foreach ($exportDataSportsType as $name => $value) {
             $output .= "<record object=\"" . JoomleagueHelper::stripInvalidXml($record_name) . "\">\n";
             foreach ($value as $name2 => $value2) {
                 if ($name2 != 'checked_out' && $name2 != 'checked_out_time') {
                     $output .= $tabVar . '<' . $name2 . '><![CDATA[' . JoomleagueHelper::stripInvalidXml(trim($value2)) . ']]></' . $name2 . ">\n";
                 }
             }
             $output .= "</record>\n";
         }
         unset($name, $value);
         $record_name = 'EventType';
         foreach ($exportData as $name => $value) {
             $output .= "<record object=\"" . JoomleagueHelper::stripInvalidXml($record_name) . "\">\n";
             foreach ($value as $name2 => $value2) {
                 if ($name2 != 'checked_out' && $name2 != 'checked_out_time') {
                     $output .= $tabVar . '<' . $name2 . '><![CDATA[' . JoomleagueHelper::stripInvalidXml(trim($value2)) . ']]></' . $name2 . ">\n";
                 }
             }
             $output .= "</record>\n";
         }
         unset($name, $value);
         // close events
         $output .= '</events>';
         $mdlJLXExports = JModel::getInstance("jlxmlexports", 'JoomleagueModel');
         $mdlJLXExports->downloadXml($output, $table);
         // close the application
         $app = JFactory::getApplication();
         $app->close();
     }
     return true;
 }
コード例 #20
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $tableconfig = $model->getTemplateConfig("ranking");
     $eventsconfig = $model->getTemplateConfig("eventsranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $this->project = $model->getProject();
     if (isset($this->project)) {
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->tableconfig = $tableconfig;
         $this->eventsconfig = $eventsconfig;
         $this->actualround = $model->getCurrentRound();
         $this->team = $model->getTeam();
         $this->highest_home = $model->getHighestHome();
         $this->highest_away = $model->getHighestAway();
         $this->highestdef_home = $model->getHighestDefHome();
         $this->highestdef_away = $model->getHighestDefAway();
         $this->totalshome = $model->getSeasonTotalsHome();
         $this->totalsaway = $model->getSeasonTotalsAway();
         $this->matchdaytotals = $model->getMatchDayTotals();
         $this->totalrounds = $model->getTotalRounds();
         $this->totalattendance = $model->getTotalAttendance();
         $this->bestattendance = $model->getBestAttendance();
         $this->worstattendance = $model->getWorstAttendance();
         $this->averageattendance = $model->getAverageAttendance();
         $this->chart_url = $model->getChartURL();
         $this->nogoals_against = $model->getNoGoalsAgainst();
         $this->logo = $model->getLogo();
         $this->results = $model->getResults();
         $this->_setChartdata(array_merge($flashconfig, $config));
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_TEAMSTATS_PAGE_TITLE'));
     if (!empty($this->team)) {
         $titleInfo->team1Name = $this->team->name;
     }
     if (!empty($this->project)) {
         $titleInfo->projectName = $this->project->name;
         $titleInfo->leagueName = $this->project->league_name;
         $titleInfo->seasonName = $this->project->season_name;
     }
     // @todo check! (undefined function)
     $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);
 }
コード例 #21
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     if ($this->getLayout() == 'assignplayers') {
         $this->_displayAssignPlayers($tpl);
         return;
     }
     JHtml::_('behavior.calendar');
     $app = JFactory::getApplication();
     $jinput = $app->input;
     $option = $jinput->getCmd('option');
     $params = JComponentHelper::getParams($option);
     $model = $this->getModel();
     $filter_state = $app->getUserStateFromRequest($this->get('context') . '.filter_state', 'filter_state', '', 'word');
     $filter_order = $app->getUserStateFromRequest($this->get('context') . '.filter_order', 'filter_order', 'pl.ordering', 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest($this->get('context') . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $app->getUserStateFromRequest($this->get('context') . '.search', 'search', '', 'string');
     $search_mode = $app->getUserStateFromRequest($this->get('context') . '.search_mode', 'search_mode', '', 'string');
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $app->setUserState($option . 'task', '');
     // 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;
     //build the html select list for positions
     $positionsList[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_POSITION'));
     $positions = JModelLegacy::getInstance('person', 'joomleaguemodel')->getPositions();
     if ($positions) {
         $positions = array_merge($positionsList, $positions);
     }
     $lists['positions'] = $positions;
     unset($positionsList);
     //build the html options for nation
     $nation[] = JHtml::_('select.option', '0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_NATION'));
     if ($res = Countries::getCountryOptions()) {
         $nation = array_merge($nation, $res);
     }
     $lists['nation'] = $nation;
     unset($nation);
     $this->user = JFactory::getUser();
     $this->config = JFactory::getConfig();
     $this->lists = $lists;
     $this->items = $items;
     $this->pagination = $pagination;
     $this->request_url = JFactory::getURI()->toString();
     $this->component_params = $params;
     $sideMenu = JoomleagueHelper::sideMenu();
     $this->sidebar = $sideMenu;
     $this->addToolbar();
     parent::display($tpl);
 }
コード例 #22
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $app = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $mainframe =& JFactory::getApplication();
     $model = $this->getModel();
     $lists = array();
     //get template data
     $template =& $this->get('data');
     $isNew = $template->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_THETEMPLATE'), $template->name);
         $app->redirect('index.php?option=' . $option, $msg);
     }
     $projectws =& $this->get('Data', 'projectws');
     $templatepath = JPATH_COMPONENT_SITE . DS . 'settings';
     $xmlfile = $templatepath . DS . 'default' . DS . $template->template . '.xml';
     $mainframe->setUserState($option . 'template_help', $template->template);
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $extensiontpath = JPATH_COMPONENT_SITE . DS . 'extensions' . DS . $extension;
         if (is_dir($extensiontpath . DS . 'settings' . DS . 'default')) {
             if (file_exists($extensiontpath . DS . 'settings' . DS . 'default' . DS . $template->template . '.xml')) {
                 $xmlfile = $extensiontpath . DS . 'settings' . DS . 'default' . DS . $template->template . '.xml';
             }
         }
     }
     $jRegistry = new JRegistry();
     $jRegistry->loadString($template->params, 'ini');
     $form =& JForm::getInstance($template->template, $xmlfile, array('control' => 'params'));
     $form->bind($jRegistry);
     $form_value = $form->getValue('person_events');
     if ($form_value) {
         $form->setValue('person_events', null, explode(",", $form_value));
     }
     $master_id = $projectws->master_template ? $projectws->master_template : '-1';
     $templates = array();
     //$templates[]=JHTML::_('select.option','0',JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_OTHER_TEMPLATE' ),'value','text');
     if ($res = $model->getAllTemplatesList($projectws->id, $master_id)) {
         $templates = array_merge($templates, $res);
     }
     $lists['templates'] = JHTMLSelect::genericlist($templates, 'select_id', 'class="inputbox" size="1" onchange="javascript: Joomla.submitbutton(\'template.apply\');"', 'value', 'text', $template->id);
     unset($res);
     unset($templates);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('template', $template);
     $this->assignRef('form', $form);
     $this->assignRef('project', $projectws);
     $this->assignRef('lists', $lists);
     $this->assignRef('user', $user);
     $this->addToolbar();
     parent::display($tpl);
 }
コード例 #23
0
ファイル: matches.php プロジェクト: Heart1010/JoomLeague
 public function getData()
 {
     $data = parent::getData();
     if ($data) {
         foreach ($data as $match) {
             JoomleagueHelper::convertMatchDateToTimezone($match);
         }
     }
     return $data;
 }
コード例 #24
0
 function getAbout()
 {
     $about = new stdClass();
     //Translations Hosted by
     $about->translations = '<a href="https://opentranslators.transifex.com/projects/p/joomleague/">https://opentranslators.transifex.com/projects/p/joomleague/</a>';
     //Repository Hosted by
     $about->repository = '<a href="http://gitorious.org/joomleague">http://gitorious.org/joomleague</a>';
     //version
     $version = JoomleagueHelper::getVersion();
     $revision = explode('.', $version);
     $about->version = '<a href="http://gitorious.org/joomleague/joomleague/commits/' . $revision[0] . '.' . $revision[1] . '.0/">' . $version . '</a>';
     //author
     $about->author = '<a href="http://stats.joomleague.net/authors.html">Joomleague-Team</a>';
     //page
     $about->page = 'http://www.joomleague.net';
     //e-mail
     $about->email = 'http://www.JoomLeague.net/forum/index.php?action=contact';
     //forum
     $about->forum = 'http://forum.joomleague.net';
     //bugtracker
     $about->bugs = 'http://bugtracker.joomleague.net';
     //wiki
     $about->wiki = 'http://wiki.joomleague.net';
     //date
     $about->date = '2013-01-07';
     //developer
     $about->developer = '<a href="http://stats.joomleague.net/authors.html" target="_blank">JoomLeague-Team</a>';
     /*
     		//designer
     		$about->designer = 'Kasi';
     		$about->designer .= ', <a href="http://www.cg-design.net" target="_blank">cg design</a>&nbsp;(Carsten Grob) ';
     */
     //designer
     $about->designer = 'DonClumsy';
     $about->designer .= ', (Tim Keller) ';
     //icons
     $about->icons = '<a href="http://www.hollandsevelden.nl/iconset/" target="_blank">Jersey Icons</a> (Hollandsevelden.nl)';
     $about->icons .= ', <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">Silk / Flags Icons</a> (Mark James)';
     $about->icons .= ', Panel images (Kasi)';
     //flash
     $about->flash = '<a href="http://teethgrinder.co.uk/open-flash-chart-2/" target="_blank">Open Flash Chart 2.x</a>';
     //graphoc library
     $about->graphic_library = '<a href="http://www.walterzorn.com" target="_blank">www.walterzorn.com</a>';
     //phpthumb class
     $about->phpthumb = '<a href="http://phpthumb.gxdlabs.com/" target="_blank">phpthumb.gxdlabs.com</a>';
     //page
     $about->github = 'https://github.com/diddipoeler/joomleague-2-komplettpaket';
     $about->diddipoelerpage = 'http://www.fussballineuropa.de';
     //e-mail
     $about->diddipoeleremail = '*****@*****.**';
     //forum
     $about->diddipoelerforum = 'http://www.fussballineuropa.de/index.php?option=com_kunena&view=category&catid=247&Itemid=530';
     $this->_about = $about;
     return $this->_about;
 }
コード例 #25
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     // read the config-data from template file
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->teamid = $model->getTeamId();
     $teams = $model->getTeamsIndexedById();
     if ($this->teamid != 0) {
         foreach ($teams as $k => $v) {
             if ($k != $this->teamid) {
                 unset($teams[$k]);
             }
         }
     }
     $this->teams = $teams;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->favteams = $model->getFavTeams();
     $this->stats = $model->getProjectUniqueStats();
     $this->playersstats = $model->getPlayersStats();
     $this->limit = $model->getLimit();
     $this->limitstart = $model->getLimitStart();
     $this->multiple_stats = count($this->stats) > 1;
     $prefix = JText::_('COM_JOOMLEAGUE_STATSRANKING_PAGE_TITLE');
     if ($this->multiple_stats) {
         $prefix .= " - " . JText::_('COM_JOOMLEAGUE_STATSRANKING_TITLE');
     } else {
         if ($this->stats) {
             // Next query will result in an array with exactly 1 statistic id
             $sid = array_keys($this->stats);
             // Take the first result then.
             $prefix .= " - " . $this->stats[$sid[0]]->name;
         }
     }
     // Set page title
     $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, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
コード例 #26
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     // read the config-data from template file
     $model = $this->getModel();
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     $this->division = $model->getDivision();
     $this->matchid = $model->matchid;
     $this->overallconfig = $model->getOverallConfig();
     $this->config = $config;
     $this->teamid = $model->getTeamId();
     $this->teams = $model->getTeamsIndexedById();
     $this->favteams = $model->getFavTeams();
     $this->eventtypes = $model->getEventTypes();
     $this->limit = $model->getLimit();
     $this->limitstart = $model->getLimitStart();
     $this->pagination = $this->get('Pagination');
     $this->eventranking = $model->getEventRankings($this->limit);
     // @todo: check!
     $this->multiple_events = count($this->eventtypes) > 1;
     $prefix = JText::_('COM_JOOMLEAGUE_EVENTSRANKING_PAGE_TITLE');
     if ($this->multiple_events) {
         $prefix .= " - " . JText::_('COM_JOOMLEAGUE_EVENTSRANKING_TITLE');
     } else {
         // Next query will result in an array with exactly 1 statistic id
         $evid = array_keys($this->eventtypes);
         // @todo check! // 23-07-2015
         // Added if statement as it can happen that no eventtype was selected
         if ($evid) {
             // Selected one valid eventtype, so show its name
             $prefix .= " - " . JText::_($this->eventtypes[$evid[0]]->name);
         }
     }
     // Set page title
     $titleInfo = JoomleagueHelper::createTitleInfo($prefix);
     if (!empty($this->teamid) && array_key_exists($this->teamid, $this->teams)) {
         $titleInfo->team1Name = $this->teams[$this->teamid]->name;
     }
     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, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
コード例 #27
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     // Get a refrence of the page instance in joomla
     $document = JFactory::getDocument();
     $model = $this->getModel();
     $club = $model->getClub();
     $config = $model->getTemplateConfig($this->getName());
     $project = $model->getProject();
     $overallconfig = $model->getOverallConfig();
     $teams = $model->getTeamsByClubId();
     $stadiums = $model->getStadiums();
     $playgrounds = $model->getPlaygrounds();
     $isEditor = $model->hasEditPermission('club.edit');
     $address_string = $model->getAddressString();
     $map_config = $model->getMapConfig();
     $this->project = $project;
     $this->overallconfig = $overallconfig;
     $this->config = $config;
     /* $this->showclubconfig = $showclubconfig; */
     $this->club = $club;
     // Do we have a club?
     if ($club) {
         $extended = $this->getExtended($club->extended, 'club');
         $this->extended = $extended;
     } else {
         $this->extended = false;
     }
     $this->teams = $teams;
     $this->stadiums = $stadiums;
     $this->playgrounds = $playgrounds;
     $this->showediticon = $isEditor;
     $this->address_string = $address_string;
     $this->mapconfig = $map_config;
     // Loads the project-template -settings for the GoogleMap
     $titleInfo = JoomleagueHelper::createTitleInfo(JText::_('COM_JOOMLEAGUE_CLUBINFO_PAGE_TITLE'));
     if (!empty($this->club)) {
         $titleInfo->clubName = $this->club->name;
     }
     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, $this->config["page_title_format"]);
     $document->setTitle($this->pagetitle);
     parent::display($tpl);
 }
コード例 #28
0
ファイル: helper.php プロジェクト: hfmprs/JoomLeague
 public static function getStaffLink($item, $params)
 {
     $flag = "";
     if ($params->get('show_flag')) {
         $flag = Countries::getCountryFlag($item->country) . "&nbsp;";
     }
     $text = "<i>" . JoomleagueHelper::formatName(null, $item->firstname, $item->nickname, $item->lastname, $params->get("name_format")) . "</i>";
     if ($params->get('show_staff_link')) {
         $link = JoomleagueHelperRoute::getStaffRoute($params->get('p'), $params->get('team'), $item->slug);
         echo $flag . JHtml::link($link, $text);
     } else {
         echo '<i>' . JText::sprintf('%1$s', $flag . $text) . '</i>';
     }
 }
コード例 #29
0
ファイル: view.html.php プロジェクト: hfmprs/JoomLeague
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $jinput = $app->input;
     $option = $jinput->getCmd('option');
     $app = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $model = $this->getModel();
     $lists = array();
     //get template data
     $template = $this->get('data');
     $isNew = $template->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_THETEMPLATE'), $template->name);
         $app->redirect('index.php?option=' . $option, $msg);
     }
     $projectws = $this->get('Data', 'project');
     $templatepath = JPATH_COMPONENT_SITE . '/settings';
     $xmlfile = $templatepath . '/default/' . $template->template . '.xml';
     $extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
     foreach ($extensions as $e => $extension) {
         $extensiontpath = JPATH_COMPONENT_SITE . '/extensions/' . $extension;
         if (is_dir($extensiontpath . '/settings/default')) {
             if (file_exists($extensiontpath . '/settings/default/' . $template->template . '.xml')) {
                 $xmlfile = $extensiontpath . '/settings/default/' . $template->template . '.xml';
             }
         }
     }
     $form = JForm::getInstance($template->template, $xmlfile, array('control' => 'params'));
     $form->bind($template->params);
     $master_id = $projectws->master_template ? $projectws->master_template : '-1';
     $templates = array();
     //$templates[]=JHtml::_('select.option','0',JText::_('COM_JOOMLEAGUE_ADMIN_TEMPLATE_OTHER_TEMPLATE' ),'value','text');
     if ($res = $model->getAllTemplatesList($projectws->id, $master_id)) {
         $templates = array_merge($templates, $res);
     }
     $lists['templates'] = JHtmlSelect::genericlist($templates, 'select_id', 'class="inputbox" size="1" onchange="javascript: Joomla.submitbutton(\'template.apply\');"', 'value', 'text', $template->id);
     unset($res);
     unset($templates);
     $this->request_url = $uri->toString();
     $this->template = $template;
     $this->form = $form;
     $this->project = $projectws;
     $this->lists = $lists;
     $this->user = $user;
     $this->addToolbar();
     parent::display($tpl);
 }
コード例 #30
-1
 function _displayPopulate($tpl)
 {
     $app = JFactory::getApplication();
     $document = Jfactory::getDocument();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $projectws =& $this->get('Data', 'projectws');
     $document->setTitle(JText::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TITLE'));
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript('components/com_joomleague/assets/js/populate.js?v=' . $version);
     $lists = array();
     $options = array(JHTML::_('select.option', 0, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_SINGLE_ROUND_ROBIN')), JHTML::_('select.option', 1, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_DOUBLE_ROUND_ROBIN')), JHTML::_('select.option', 2, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_TOURNAMENT_ROUND_ROBIN')));
     $lists['scheduling'] = JHTML::_('select.genericlist', $options, 'scheduling', '', 'value', 'text');
     //TODO-add error message - what if there are no teams assigned to the project
     $teams = $this->get('projectteams');
     $options = array();
     foreach ($teams as $t) {
         $options[] = JHTML::_('select.option', $t->projectteam_id, $t->text);
     }
     $lists['teamsorder'] = JHTML::_('select.genericlist', $options, 'teamsorder[]', 'multiple="multiple" size="20"');
     $this->assignRef('projectws', $projectws);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('lists', $lists);
     $this->addToolbar_Populate();
     parent::display($tpl);
 }