PageRenderTime 43ms CodeModel.GetById 12ms app.highlight 26ms RepoModel.GetById 1ms app.codeStats 0ms

/com_joomleague/components/com_joomleague/helpers/route.php

https://gitlab.com/volleyuisp/joomleague
PHP | 802 lines | 608 code | 136 blank | 58 comment | 76 complexity | 4ab3754d3c2503e585c1ccf0bc537e59 MD5 | raw file
  1<?php
  2/**
  3 * @copyright	Copyright (C) 2006-2014 joomleague.at. All rights reserved.
  4 * @license		GNU/GPL,see LICENSE.php
  5 * Joomla! is free software. This version may have been modified pursuant
  6 * to the GNU General Public License,and as distributed it includes or
  7 * is derivative of works licensed under the GNU General Public License or
  8 * other free or open source software licenses.
  9 * See COPYRIGHT.php for copyright notices and details.
 10 */
 11
 12// Check to ensure this file is included in Joomla!
 13defined('_JEXEC') or die('Restricted access');
 14
 15// Component Helper
 16jimport('joomla.application.component.helper');
 17
 18/**
 19 *
 20 */
 21class JoomleagueHelperRoute
 22{
 23	public static function getTeamInfoRoute( $projectid, $teamid )
 24	{
 25		$params = array(	"option" => "com_joomleague",
 26				"view" => "teaminfo",
 27				"p" => $projectid,
 28				"tid" => $teamid );
 29	
 30		$query = JoomleagueHelperRoute::buildQuery( $params );
 31		$link = JRoute::_( 'index.php?' . $query, false );
 32	
 33		return $link;
 34	}
 35	
 36	public static function getProjectTeamInfoRoute( $projectid, $projectteamid, $task=null )
 37	{
 38		$params = array(	"option" => "com_joomleague",
 39					"view" => "teaminfo",
 40					"p" => $projectid,
 41					"ptid" => $projectteamid );
 42		if ( ! is_null( $task ) ) {
 43			unset($params["p"]);
 44			unset($params["ptid"]);
 45			$params["pid[]"] 	= $projectid;
 46			$params["cid[]"] 	= $projectteamid;
 47			$params["task"]		= $task;
 48			$params["view"] 	= 'projectteam';
 49			$params["hidemainmenu"] = '1';
 50			$query = JoomleagueHelperRoute::buildQuery( $params );
 51			$link = JRoute::_( "administrator/index.php?" . $query, false );
 52		} else {
 53			$query = JoomleagueHelperRoute::buildQuery( $params );
 54			$link = JRoute::_( "index.php?" . $query, false );
 55		}
 56		return $link;
 57	}
 58	
 59	public static function getRivalsRoute( $projectid, $teamid )
 60	{
 61		$params = array(	"option" => "com_joomleague",
 62					"view" => "rivals",
 63					"p" => $projectid,
 64					"tid" => $teamid );
 65
 66		$query = JoomleagueHelperRoute::buildQuery( $params );
 67		$link = JRoute::_( 'index.php?' . $query, false );
 68
 69		return $link;
 70	}	
 71
 72	public static function getClubInfoRoute( $projectid, $clubid, $task=null )
 73	{
 74		$params = array(	"option" => "com_joomleague",
 75					"view" => "clubinfo",
 76					"p" => $projectid,
 77					"cid" => $clubid );
 78
 79		if ( ! is_null( $task ) ) { 
 80			unset($params["p"]);
 81			unset($params["cid"]);
 82			unset($params["view"]);
 83			$params["pid[]"] 		= $projectid;
 84			$params["cid[]"]	 	= $clubid;
 85			$params["task"] 		= $task;
 86			$params["hidemainmenu"]	= '1';
 87			$query = JoomleagueHelperRoute::buildQuery( $params );
 88			$link = JRoute::_( "administrator/index.php?" . $query, false );
 89		} else {
 90			$query = JoomleagueHelperRoute::buildQuery( $params );
 91			$link = JRoute::_( "index.php?" . $query, false );
 92		}
 93		return $link;
 94	}
 95
 96	public static function getClubPlanRoute( $projectid, $clubid, $task=null )
 97	{
 98		$params = array(	"option" => "com_joomleague",
 99					"view" => "clubplan",
100					"p" => $projectid,
101					"cid" => $clubid );
102
103		if ( ! is_null( $task ) ) { $params["task"] = $task; }
104
105		$query = JoomleagueHelperRoute::buildQuery( $params );
106		$link = JRoute::_( "index.php?" . $query, false );
107
108		return $link;
109	}
110
111	public static function getPlaygroundRoute( $projectid, $playgroundid )
112	{
113		$params = array(	"option" => "com_joomleague",
114					"view" => "playground",
115					"p" => $projectid,
116					"pgid" => $playgroundid );
117
118		$query = JoomleagueHelperRoute::buildQuery( $params );
119		$link = JRoute::_( 'index.php?' . $query, false );
120
121		return $link;
122	}
123
124	/**
125	 * 
126	 * @param int $projectid
127	 * @param int $round
128	 * @param int $from
129	 * @param int $to
130	 * @param int $type
131	 */
132	public static function getRankingRoute( $projectid, $round=0, $from=0, $to=0, $type=0, $division=0 )
133	{
134		$params = array(	"option" => "com_joomleague",
135					"view" => "ranking",
136					"p" => $projectid );
137
138		$params["type"] = $type;
139		$params["r"] = $round;
140		$params["from"] = $from;
141		$params["to"] = $to;
142		$params["division"] = $division;
143		$query = JoomleagueHelperRoute::buildQuery( $params );
144		$link = JRoute::_( 'index.php?' . $query, false );
145
146		return $link;
147	}
148
149	public static function getResultsRoute($projectid, $roundid=0, $divisionid=0, $mode=0, $order=0, $task=null)
150	{
151		$params = array(	'option' => 'com_joomleague',
152							'view' => 'results',
153							'p' => $projectid );
154				
155		if ( ! is_null( $task ) ) {
156			unset($params["p"]);
157			$params["view"] 	= 'matches';
158			$params["pid[]"] 	= $projectid;
159			$params["rid[]"] 	= $roundid;
160			$params["task"] 	= $task;
161			$params['division'] = $divisionid;
162			$params["hidemainmenu"] = '1';
163			$query = JoomleagueHelperRoute::buildQuery( $params );
164			$link = JRoute::_( "administrator/index.php?" . $query, false );
165		} else {
166			$params['r'] 		= $roundid; 
167			$params['division'] = $divisionid;
168			$params['mode'] 	= $mode;
169			$params['order'] 	= $order;
170			$query = JoomleagueHelperRoute::buildQuery( $params );
171			$link = JRoute::_( "index.php?" . $query, false );
172		}
173		
174		return $link;
175	}
176
177	public static function getMatrixRoute( $projectid, $division=0, $round=0 )
178	{
179		$params = array(	"option" => "com_joomleague",
180					"view" => "matrix",
181					"p" => $projectid );
182
183		$params["division"] = $division;
184		$params["r"] = $round;
185		
186		$query = JoomleagueHelperRoute::buildQuery( $params );
187		$link = JRoute::_( 'index.php?' . $query, false );
188
189		return $link;
190	}
191
192	public static function getResultsRankingRoute( $projectid, $round=null, $division=0 )
193	{
194		$params = array(	"option" => "com_joomleague",
195					"view" => "resultsranking",
196					"p" => $projectid );
197
198		if ( ! is_null( $round ) ) { $params["r"] = $round; }
199		$params["division"] = $division;
200		
201		$query = JoomleagueHelperRoute::buildQuery( $params );
202		$link = JRoute::_( 'index.php?' . $query, false );
203
204		return $link;
205	}
206
207	public static function getResultsMatrixRoute( $projectid, $round=null, $division=0 )
208	{
209		$params = array(	"option" => "com_joomleague",
210					"view" => "resultsmatrix",
211					"p" => $projectid );
212
213		if ( ! is_null( $round ) ) { $params["r"] = $round; }
214		$params["division"] = $division;
215		
216		$query = JoomleagueHelperRoute::buildQuery( $params );
217		$link = JRoute::_( 'index.php?' . $query, false );
218
219		return $link;
220	}
221
222	public static function getRankingMatrixRoute( $projectid, $round=null, $division=0 )
223	{
224		$params = array(	"option" => "com_joomleague",
225					"view" => "rankingmatrix",
226					"p" => $projectid );
227
228		if ( ! is_null( $round ) ) { $params["r"] = $round; }
229		$params["division"] = $division;
230		
231		$query = JoomleagueHelperRoute::buildQuery( $params );
232		$link = JRoute::_( 'index.php?' . $query, false );
233
234		return $link;
235	}
236
237	public static function getResultsRankingMatrixRoute( $projectid, $round=null, $division=0 )
238	{
239		$params = array(	"option" => "com_joomleague",
240					"view" => "resultsrankingmatrix",
241					"p" => $projectid );
242
243		if ( ! is_null( $round ) ) { $params["r"] = $round; }
244		$params["division"] = $division;
245		
246		$query = JoomleagueHelperRoute::buildQuery( $params );
247		$link = JRoute::_( 'index.php?' . $query, false );
248
249		return $link;
250	}
251
252	public static function getTeamPlanRoute( $projectid, $teamid, $division=0, $mode=null )
253	{
254		$params = array(	"option" => "com_joomleague",
255					"view" => "teamplan",
256					"p" => $projectid,
257					"tid" => $teamid,
258					"division" => $division );
259
260		if ( ! is_null( $mode ) ) { $params["mode"] = $mode; }
261
262		$query = JoomleagueHelperRoute::buildQuery( $params );
263		$link = JRoute::_( "index.php?" . $query, false );
264
265		return $link;
266	}
267
268	public static function getMatchReportRoute( $projectid, $matchid = null )
269	{
270		$params = array(	"option" => "com_joomleague",
271					"view" => "matchreport",
272					"p" => $projectid );
273
274		if ( ! is_null( $matchid ) ) { $params["mid"] = $matchid; }
275
276		$query = JoomleagueHelperRoute::buildQuery( $params );
277		$link = JRoute::_( 'index.php?' . $query, false );
278
279		return $link;
280	}
281
282	/**
283	 * return links to a team player
284	 * @param int projectid
285	 * @param int teamid
286	 * @param int personid
287	 * @param string task
288	 * @return url
289	 */
290	public static function getPlayerRoute($projectid, $teamid, $personid, $task=null)
291	{
292		$params = array(	"option" => "com_joomleague",
293					"view" => "player",
294					"p" => $projectid,
295					"tid" => $teamid,
296					"pid" => $personid );
297
298		if(!is_null($task)) {
299			unset($params["p"]);
300			unset($params["tid"]);
301			$params["pid[]"]		= $projectid;
302			$params["cid[]"]		= $personid;
303			$params["view"]			= 'person';
304			$params["task"]			= $task;
305			$params["hidemainmenu"]	= 1;
306			$query = JoomleagueHelperRoute::buildQuery( $params );
307			$link = JRoute::_( "administrator/index.php?" . $query, false );
308		} else {
309			$query = JoomleagueHelperRoute::buildQuery( $params );
310			$link = JRoute::_( "index.php?" . $query, false );
311		}
312		
313		return $link;
314	}
315
316	/**
317	 * return links to a team staff
318	 * @param int projectid
319	 * @param int teamid
320	 * @param int personid
321	 * @return url
322	 */
323	public static function getStaffRoute( $projectid, $teamid, $personid, $task=null )
324	{
325		$params = array(	"option" => "com_joomleague",
326					"view" => "staff",
327					"p" => $projectid,
328					"tid" => $teamid,
329					"pid" => $personid );
330
331		if(!is_null($task)) {
332			unset($params["p"]);
333			unset($params["tid"]);
334			unset($params["pid"]);
335			$params["pid[]"] 		= $projectid;
336			$params["team"] 		= $teamid;
337			$params["cid[]"] 		= $personid;
338			$params["view"] 		= 'teamstaff';
339			$params["task"] 		= $task;
340			$params["hidemainmenu"] = 1;
341			$query = JoomleagueHelperRoute::buildQuery( $params );
342			$link = JRoute::_( "administrator/index.php?" . $query, false );
343		} else {
344			$query = JoomleagueHelperRoute::buildQuery( $params );
345			$link = JRoute::_( "index.php?" . $query, false );
346		}
347		
348		return $link;
349	}
350
351	/**
352	 * returns url to a person
353	 * @param int project id
354	 * @param int person id
355	 * @param int Type: 1 for player, 2 for staff, 3 for referee
356	 * @deprecated since 1.5
357	 * @return url
358	 */
359	public static function getPersonRoute( $projectid, $personid, $showType )
360	{
361		$params = array(	"option" => "com_joomleague",
362					"view" => "person",
363					"p" => $projectid,
364					"pid" => $personid,
365					"pt" => $showType );
366
367		$query = JoomleagueHelperRoute::buildQuery( $params );
368		$link = JRoute::_( 'index.php?' . $query, false );
369
370		return $link;
371	}
372
373	public static function getPlayersRoute( $projectid, $teamid, $task=null, $divisionid=0, $project_team_id='')
374	{
375		$params = array(	"option" => "com_joomleague",
376					"view" => "roster",
377					"p" => $projectid,
378					"tid" => $teamid,
379					"division" => $divisionid,
380					 );
381
382		if(!is_null($task)) {
383			unset($params["p"]);
384			unset($params["tid"]);
385			unset($params["division"]);
386			$params["pid[]"] 			= $projectid;
387			$params["team_id"] 			= $teamid;
388			$params["project_team_id"] 	= $project_team_id;
389			$params["view"] 			= 'projectteams';
390			$params["task"] 			= $task;
391			$params["hidemainmenu"] 	= 1;
392			$query = JoomleagueHelperRoute::buildQuery( $params );
393			$link = JRoute::_( "administrator/index.php?" . $query, false );
394		} else {
395			$query = JoomleagueHelperRoute::buildQuery( $params );
396			$link = JRoute::_( "index.php?" . $query, false );
397		}
398
399		return $link;
400	}
401
402	public static function getDivisionsRoute( $projectid, $divisionid, $task=null )
403	{
404		$params = array(	"option" => "com_joomleague",
405					"view" => "treeone",
406					"p" => $projectid,
407					"division" => $divisionid );
408
409		$query = JoomleagueHelperRoute::buildQuery( $params );
410		$link = JRoute::_( 'index.php?' . $query, false );
411
412		return $link;
413	}
414
415	public static function getFavPlayersRoute( $projectid )
416	{
417		$params = array(	"option" => "com_joomleague",
418					"view" => "players",
419					"task" => "favplayers",
420					"p" => $projectid );
421
422		$query = JoomleagueHelperRoute::buildQuery( $params );
423		$link = JRoute::_( 'index.php?' . $query, false );
424
425		return $link;
426	}
427
428	public static function getRefereeRoute( $projectid, $personid, $task=null )
429	{
430		$params = array(	"option" => "com_joomleague",
431					"view" => "referee",
432					"p" => $projectid,
433					"pid" => $personid );
434		if ( ! is_null( $task ) ) {
435			unset($params['pid']);
436			unset($params['p']);
437			$params["pid[]"]		= $projectid;
438			$params["cid[]"]		= $personid;
439			$params["task"]			= $task;
440			$params["view"] 		= 'projectreferee';
441			$params["hidemainmenu"]	= 1;
442			$query = JoomleagueHelperRoute::buildQuery( $params );
443			$link = JRoute::_( "administrator/index.php?" . $query, false );
444		} else {
445			$query = JoomleagueHelperRoute::buildQuery( $params );
446			$link = JRoute::_( "index.php?" . $query, false );
447		}
448		return $link;
449	}
450
451	public static function getRefereesRoute( $projectid )
452	{
453		$params = array(	"option" => "com_joomleague",
454					"view" => "referees",
455					"p" => $projectid );
456
457		$query = JoomleagueHelperRoute::buildQuery( $params );
458		$link = JRoute::_( 'index.php?' . $query, false );
459
460		return $link;
461	}
462
463	public static function getEventsRankingRoute( $projectid, $divisionid=0, $teamid=0, $eventid=0, $matchid=0)
464	{
465		$params = array(	"option" => "com_joomleague",
466					"view" => "eventsranking",
467					"p" => $projectid );
468
469		$params["division"] = $divisionid;
470		$params["tid"] = $teamid;
471		$params["evid"] = $eventid;
472		$params["mid"] = $matchid;
473		
474		$query = JoomleagueHelperRoute::buildQuery( $params );
475		$link = JRoute::_( 'index.php?' . $query, false );
476
477		return $link;
478	}
479
480	public static function getCurveRoute($projectid, $teamid1=0, $teamid2=0, $division=0)
481	{
482		$params = array(	"option" => "com_joomleague",
483					"view" => "curve",
484					"p" => $projectid );
485
486		$params["tid1"] = $teamid1;
487		$params["tid2"] = $teamid2;
488		$params["division"] = $division;
489
490		$query = JoomleagueHelperRoute::buildQuery( $params );
491		$link = JRoute::_( 'index.php?' . $query, false );
492
493		return $link;
494	}
495
496	public static function getStatsChartDataRoute( $projectid, $division=0 )
497	{
498		$params = array(	"option" => "com_joomleague",
499					"view" => "stats",
500					"layout" => "chartdata",
501					"p" => $projectid );
502
503		$params["division"] = $division; 
504
505		$query = JoomleagueHelperRoute::buildQuery( $params );
506		$link = JRoute::_( 'index.php?' . $query, false );
507
508		return $link;
509	}
510
511	public static function getTeamStatsChartDataRoute( $projectid, $teamid )
512	{
513		$params = array(	"option" => "com_joomleague",
514					"view" => "teamstats",
515					"layout" => "chartdata",
516					"p" => $projectid,
517					"tid" => $teamid );
518
519		$query = JoomleagueHelperRoute::buildQuery( $params );
520		$link = JRoute::_( 'index.php?' . $query, false );
521
522		return $link;
523	}
524
525	public static function getStatsRoute( $projectid, $division = 0 )
526	{
527		$params = array(	"option" => "com_joomleague",
528					"view" => "stats",
529					"p" => $projectid );
530
531		$params["division"] = $division;
532
533		$query = JoomleagueHelperRoute::buildQuery( $params );
534		$link = JRoute::_( 'index.php?' . $query, false );
535
536		return $link;
537	}
538
539	public static function getBracketsRoute( $projectid )
540	{
541		$params = array(	"option" => "com_joomleague",
542					"view" => "treetonode",
543					"p" => $projectid );
544
545		$query = JoomleagueHelperRoute::buildQuery( $params );
546		$link = JRoute::_( 'index.php?' . $query, false );
547
548		return $link;
549	}
550
551	public static function getStatsRankingRoute( $projectid, $divisionid = null, $teamid = null, $statid = 0, $order = null )
552	{
553		$params = array(	"option" => "com_joomleague",
554					"view" => "statsranking",
555					"p" => $projectid );
556
557		if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
558		if ( isset( $teamid ) ) { $params["tid"] = $teamid; }
559		if ($statid) { $params['sid'] = $statid; }
560		if (strcasecmp($order, 'asc') === 0 || strcasecmp($order, 'desc') === 0) { $params['order'] = strtolower($order); }
561
562		$query = JoomleagueHelperRoute::buildQuery( $params );
563		$link = JRoute::_( 'index.php?' . $query, false );
564
565		return $link;
566	}
567
568	public static function getClubsRoute( $projectid, $divisionid = null )
569	{
570		$params = array(	"option" => "com_joomleague",
571					"view" => "clubs",
572					"p" => $projectid );
573
574		if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
575
576		$query = JoomleagueHelperRoute::buildQuery( $params );
577		$link = JRoute::_( 'index.php?' . $query, false );
578
579		return $link;
580	}
581
582	public static function getTeamsRoute( $projectid, $divisionid = null )
583	{
584		$params = array(	"option" => "com_joomleague",
585					"view" => "teams",
586					"p" => $projectid );
587
588		if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
589
590		$query = JoomleagueHelperRoute::buildQuery( $params );
591		$link = JRoute::_( 'index.php?' . $query, false );
592
593		return $link;
594	}
595
596	public static function getTeamStatsRoute( $projectid, $teamid )
597	{
598		$params = array(	"option" => "com_joomleague",
599					"view" => "teamstats",
600					"p" => $projectid,
601					"tid" => $teamid );
602
603		$query = JoomleagueHelperRoute::buildQuery( $params );
604		$link = JRoute::_( "index.php?" . $query, false );
605
606		return $link;
607	}
608
609	public static function getTeamStaffRoute( $projectid, $playerid, $showType )
610	{
611		$params = array(	"option" => "com_joomleague",
612					"view" => "person",
613					"p" => $projectid,
614					"pid" => $playerid,
615					"pt" => $showType );
616
617		$query = JoomleagueHelperRoute::buildQuery( $params );
618		$link = JRoute::_( 'index.php?' . $query, false );
619
620		return $link;
621	}
622
623	public static function getNextMatchRoute( $projectid, $matchid )
624	{
625		$params = array(	"option" => "com_joomleague",
626					"view" => "nextmatch",
627					"p" => $projectid,
628					"mid" => $matchid );
629
630		$query = JoomleagueHelperRoute::buildQuery( $params );
631		$link = JRoute::_( 'index.php?' . $query, false );
632
633		return $link;
634	}
635
636	public static function getContactRoute( $contactid )
637	{
638		$params = array(	"option" => "com_contact",
639					"view" => "contact",
640					"id" => $contactid );
641
642		$query = JoomleagueHelperRoute::buildQuery( $params );
643		$link = JRoute::_( 'index.php?' . $query, false );
644
645		return $link;
646	}
647
648	public static function getUserProfileRouteCBE( $u_id, $p_id, $pl_id )
649	{
650		// Old Route to Community Builder User Page with support for CBE-JoomLeague Tab
651		// index.php?option=com_cbe&view=userProfile&user=JOOMLA_USER_ID&jlp=PROJECT_ID&jlpid=JOOMLEAGUE_PLAYER_ID
652		$params = array(	"option" => "com_cbe",
653					"view" => "userProfile",
654					"user" => $u_id,
655					"jlp" => $p_id,
656					"jlpid" => $pl_id );
657
658		$query = JoomleagueHelperRoute::buildQuery( $params );
659		$link = JRoute::_( 'index.php?' . $query, false );
660
661		return $link;
662	}
663
664	public static function getUserProfileRoute( $userid )
665	{
666		$params = array(	"option" => "com_comprofiler",
667					"task" => "userProfile",
668					"user" => $userid );
669
670		$query = JoomleagueHelperRoute::buildQuery( $params );
671		$link = JRoute::_( 'index.php?' . $query, false );
672
673		return $link;
674	}
675
676	public static function getIcalRoute( $projectid, $teamid=null, $pgid=null )
677	{
678		$params = array(	"option" => "com_joomleague",
679					"view" => "ical",
680					"p" => $projectid );
681
682		if ( !is_null( $pgid ) ) { $params["pgid"] = $pgid; }
683		if ( !is_null( $teamid ) ) { $params["teamid"] = $teamid; }
684
685		$query = JoomleagueHelperRoute::buildQuery( $params );
686		$link = JRoute::_( "index.php?" . $query, false );
687
688		return $link;
689	}
690	
691	public static function buildQuery($parts)
692	{
693		if ($item = JoomleagueHelperRoute::_findItem($parts))
694		{
695			$parts['Itemid'] = $item->id;
696		}
697		else {
698			$params = JComponentHelper::getParams('com_joomleague');
699			if ($params->get('default_itemid')) {
700				$parts['Itemid'] = intval($params->get('default_itemid'));				
701			}
702		}
703
704		return JUri::buildQuery( $parts );
705	}
706
707	/**
708	 * Determines the Itemid
709	 *
710	 * searches if a menuitem for this item exists
711	 * if not the first match will be returned
712	 *
713	 * @param array The id and view
714	 * @since 0.9
715	 *
716	 * @return int Itemid
717	 */
718	public static function _findItem($query)
719	{
720		$component = JComponentHelper::getComponent('com_joomleague');
721		$site = new JSite();
722		$menus	= $site->getMenu();
723		$items	= $menus->getItems('component', $component->id);
724		$user 	=  JFactory::getUser();
725		$access = (int)$user->get('aid');
726
727		if ($items) {
728			foreach($items as $item)
729			{
730				if ((@$item->query['view'] == $query['view']) && ($item->published == 1) && ($item->access <= $access)) {
731
732					switch ($query['view'])
733					{
734						case 'teaminfo':
735						case 'roster':
736						case 'teamplan':
737						case 'teamstats':
738							if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['tid'] == (int) $query['tid']) {
739								return $item;
740							}
741							break;
742						case 'clubinfo':
743						case 'clubplan':
744							if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['cid'] == (int) $query['cid']) {
745								return $item;
746							}
747							break;
748						case 'nextmatch':
749							if ((int)@$item->query['p'] == (int) $query['p']
750							&& (int)@$item->query['tid'] == (int) $query['tid']
751							&& (int)@$item->query['mid'] == (int) $query['mid']) {
752								return $item;
753							}
754							break;
755						case 'playground':
756							if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['pgid'] == (int) $query['pgid']) {
757								return $item;
758							}
759							break;
760						case 'ranking':
761						case 'results':
762						case 'resultsranking':
763						case 'matrix':
764						case 'resultsmatrix':
765						case 'stats':
766							if ((int)@$item->query['p'] == (int) $query['p']) {
767								return $item;
768							}
769							break;
770						case 'statsranking':
771							if ((int)@$item->query['p'] == (int) $query['p']) {
772								return $item;
773							}
774							break;
775						case 'player':
776						case 'staff':
777							if (    (int)@$item->query['p'] == (int) $query['p']
778							&& (int)@$item->query['tid'] == (int) $query['tid']
779							&& (int)@$item->query['pid'] == (int) $query['pid']) {
780								return $item;
781							}
782							break;
783						case 'referee':
784							if (    (int)@$item->query['p'] == (int) $query['p']
785							&& (int)@$item->query['pid'] == (int) $query['pid']) {
786								return $item;
787							}
788							break;
789						case 'tree':
790							if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['division'] == (int) $query['division']) {
791								return $item;
792							}
793							break;
794					}
795				}
796			}
797		}
798
799		return false;
800	}
801}
802?>