/
router.php
1190 lines (1026 loc) · 31.7 KB
/
router.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* @package EasySocial
* @copyright Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined( '_JEXEC' ) or die( 'Unauthorized Access' );
FD::import( 'admin:/includes/router/router' );
/**
* Routing library for EasySocial
*
* @since 3.0
* @author Mark Lee <mark@stackideas.com>
*/
class FRoute
{
static $base = 'index.php?option=com_easysocial';
static $views = array(
'account',
'activities',
'albums',
'apps',
'badges',
'conversations',
'events',
'groups',
'dashboard',
'fields',
'friends',
'followers',
'profile',
'profiles',
'unity',
'users',
'stream',
'notifications',
'leaderboard',
'points',
'photos',
'registration',
'search',
'login',
'unity'
);
/**
* Translates URL to SEF friendly
*
* External true SEF true
* http://solo.dev/joomla321/dashboard/registration/oauthDialog/facebook
* External true SEF false
* http://solo.dev/joomla321/index.php?option=com_easysocial&view=registration&layout=oauthDialog&client=facebook&Itemid=135
* External false SEF true
* /joomla321/dashboard/registration/oauthDialog/facebook
* External false SEF false
* index.php?option=com_easysocial&view=registration&layout=oauthDialog&client=facebook&Itemid=135
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function _( $url , $xhtml = false , $view = array() , $ssl = null , $tokenize = false , $external = false , $tmpl = '' , $controller = '', $sef = true )
{
if( $tokenize )
{
$url .= '&' . FD::token() . '=1';
}
if( !empty( $controller ) )
{
$url = $url . '&controller=' . $controller;
}
// If this is an external URL, we want to fetch the full URL.
if( $external )
{
return FRoute::external( $url , $xhtml , $ssl , $tmpl, $sef );
}
if( !empty( $controller ) && $sef )
{
$url = JRoute::_( $url , $xhtml );
return $url;
}
// We don't want to do any sef routing here.
// Only external = false and sef = false will come here
// IMPORTANT: handler needs to FRoute::_() the link
if( $tmpl == 'component' || $sef === false )
{
return $url;
}
return JRoute::_( $url , $xhtml , $ssl );
}
/**
* Returns the raw url without going through any sef urls.
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function raw( $url )
{
$uri = rtrim( JURI::root() , '/' ) . '/' . $url;
return $uri;
}
/**
* Builds an external URL that may be used in an email or other external apps
*
* @since 1.0
* @access public
* @return
*/
public static function external( $url , $xhtml = false , $ssl = null , $tmpl = false, $sef = true )
{
$uri = JURI::getInstance();
// If this is an external URL, we will not want to xhtml it.
$xhtml = false;
// Determine if the current browser is from the back end.
$app = JFactory::getApplication();
// if( $app->isAdmin() )
// {
// jimport( 'joomla.libraries.cms.router' );
// // Reset the application
// JFactory::$application = JApplication::getInstance('site');
// }
// Send the URL for processing only if tmpl != component
if( $tmpl !== 'component' && $sef !== false )
{
$url = FRoute::_( $url , $xhtml , array(), $ssl, false, false, '', '', $sef );
}
// Remove the /administrator/ part from the URL.
$url = str_ireplace( '/administrator/' , '/' , $url );
$url = ltrim( $url , '/' );
if ($sef === false || $tmpl === 'component') {
// If we do not want sef, then we need to manually append the front part taking into account that this is not JRouted, hence we use JURI::root() to ensure subfolders
$url = rtrim(JURI::root(), '/') . '/' . $url;
} else {
// We need to use $uri->toString() because JURI::root() may contain a subfolder which will be duplicated
// since $url already has the subfolder.
$url = $uri->toString( array( 'scheme' , 'host' , 'port' ) ) . '/' . $url;
}
return $url;
}
public static function tokenize( $url , $xhtml = false , $ssl = null )
{
$url .= '&' . FD::token() . '=1';
return FRoute::_( $url , $xhtml , $ssl );
}
/**
* Retrieves the current url that is being accessed.
*
* @since 1.0
* @access public
* @param bool Determines if we should append this as a callback url.
* @return string The current url.
*/
public static function current( $isCallback = false )
{
$uri = JRequest::getURI();
if( $isCallback )
{
return '&callback=' . base64_encode( $uri );
}
return $uri;
}
/**
* Retrieves the referer url that is being accessed.
*
* @since 1.3
* @access public
* @param bool Determines if we should append this as a callback url.
* @return string The current url.
*/
public static function referer($isCallback = false)
{
$uri = $_SERVER['HTTP_REFERER'];
if($isCallback)
{
return '&callback=' . base64_encode($uri);
}
return $uri;
}
/**
* Retrieves the default menu id
*
* @since 1.2
* @access public
* @param string
* @return
*/
public static function getDefaultItemId( $view )
{
$db = FD::db();
$sql = $db->sql();
// Get the first public page available if there's any
$sql->select( '#__menu' );
$sql->where( 'link' , 'index.php?option=com_easysocial&view=dashboard%' , 'LIKE' );
$sql->where( 'published' , SOCIAL_STATE_PUBLISHED );
$db->setQuery( $sql );
$id = $db->loadResult();
// Check for more specificity
if( !$id )
{
$sql->clear();
$sql->select( '#__menu' );
$sql->where( 'link' , 'index.php?option=com_easysocial&view=' . $view , '=' );
$sql->where( 'published' , SOCIAL_STATE_PUBLISHED );
$db->setQuery( $sql );
$id = $db->loadResult();
}
// If the url doesn't exist, we use "LIKE" to search instead.
if( !$id )
{
$sql->clear();
$sql->select( '#__menu' );
$sql->where( 'link' , 'index.php?option=com_easysocial%' , 'LIKE' );
$sql->where( 'published' , SOCIAL_STATE_PUBLISHED );
$db->setQuery( $sql );
$id = $db->loadResult();
}
if( !$id )
{
// Try to get from the current Itemid in query string
$id = JRequest::getInt( 'Itemid' , 0 );
}
if( !$id )
{
// Try to get
$id = false;
}
return $id;
}
/**
* Given a menu item id, try to get the link
*
* @since 1.3
* @access public
* @param string
* @return
*/
public static function getMenuLink($menuId)
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menuItem = $menu->getItem($menuId);
$link = false;
if (!$menuItem) {
return $link;
}
// For menus linked within EasySocial, use our own router
if ($menuItem->component == 'com_easysocial') {
$view = isset($menuItem->query['view']) ? $menuItem->query['view'] : '';
if ($view) {
$queries = $menuItem->query;
unset($queries['option']);
unset($queries['view']);
$options = array($queries, false);
$link = call_user_func_array(array('FRoute', $view), $options);
}
}
// For menus not linked to EasySocial
if ($menuItem->component != 'com_easysocial') {
if (strpos($menuItem->link, '?') > 0) {
$link = JRoute::_($menuItem->link . '&Itemid=' . $menuItem->id, false);
} else {
$link = JRoute::_($menuItem->link . '?Itemid=' . $menuItem->id, false);
}
// If this menu is a home menu item, the link should just be the site url.
if (!$link || (isset($menuItem->home) && $menuItem->home)) {
$link = JURI::root();
}
}
return $link;
}
/**
* Retrieves the item id based on the view and the layout.
*
* @since 1.2
* @access public
* @param string
* @return Array An array of menu items
*/
public static function getMenus( $view , $layout = null, $id = null )
{
static $menus = null;
static $selection = array();
// Always ensure that layout is lowercased
$layout = strtolower($layout);
// We want to cache the selection user made.
$key = $view . $layout . $id;
$language = false;
// If language filter is enabled, we need to get the language tag
if (!JFactory::getApplication()->isAdmin()) {
$language = JFactory::getApplication()->getLanguageFilter();
$languageTag = JFactory::getLanguage()->getTag();
}
// Preload the list of menus first.
if (is_null($menus)) {
$db = FD::db();
$sql = $db->sql();
$sql->select( '#__menu' );
$sql->where( 'published' , SOCIAL_STATE_PUBLISHED );
$sql->where( 'link' , 'index.php?option=com_easysocial%' , 'LIKE' );
if ($language) {
$sql->where('(', '', '', 'AND');
$sql->where('language', $languageTag, '=', 'OR');
$sql->where('language', '*', '=', 'OR');
$sql->where(')');
}
$db->setQuery($sql);
$result = $db->loadObjectList();
$menus = array();
// We need to format them accordingly.
if (!$result) {
return array();
}
foreach ($result as $row) {
// Remove the index.php?option=com_easysocial from the link
$tmp = str_ireplace('index.php?option=com_easysocial', '', $row->link);
// Parse the URL
parse_str($tmp, $segments);
// Convert the segments to std class
$segments = (object) $segments;
// if there is no view, most likely this menu item is a external link type. lets skip this item.
if(!isset($segments->view)) {
continue;
}
$obj = new stdClass();
$obj->segments = $segments;
$obj->link = $row->link;
$obj->view = $segments->view;
$obj->layout = isset($segments->layout) ? $segments->layout : 0;
$obj->id = $row->id;
$menus[$obj->view][$obj->layout][] = $obj;
}
}
// Get the current selection of menus from the cache
if (!isset($selection[ $key ])) {
if (isset($menus[$view]) && isset($menus[$view]) && !is_null($layout) && isset($menus[$view][$layout]) && !is_null($id) && !empty($id)) {
$tmpMenus = $menus[ $view ][ $layout ];
foreach ($tmpMenus as $tMenus) {
if (isset($tMenus->segments->id) && (int)$tMenus->segments->id == (int)$id) {
$selection[ $key ] = array($tMenus);
break;
}
}
// there is no menu item created for this view/item/id
// let just use the view.
if (!isset($selection[ $key ]) && isset($menus[$view]) && isset($menus[$view][0])) {
// var_dump($key, $menus[$view][0]);exit;
$selection[$key] = $menus[$view][0];
}
}
if (isset($menus[$view]) && isset($menus[$view]) && !is_null($layout) && isset($menus[$view][$layout]) && (is_null($id) || empty($id)) ) {
$selection[ $key ] = $menus[ $view ][ $layout ];
}
// If the user is searching for $views only.
if (isset($menus[ $view ]) && isset($menus[ $view ]) && (is_null($layout) || empty($layout))) {
// $selection[ $key ] = $menus[$view][0];
$selection[ $key ] = isset( $menus[$view][0] ) ? $menus[$view][0] : false;
}
// If we still can't find any menu, lets check if the view exits or not. if yes, used it.
if (!isset($selection[ $key ]) && isset($menus[$view]) && isset($menus[$view][0])) {
$selection[$key] = $menus[$view][0];
}
// var_dump($key);
// if we are trying to get the dashboard view menu item and the result was not found,
// this mean the site do not have any menu item created for dashbaord. If that is the case,
// we need to take whatever menu item created for EasySocial or else, the sef link will become
// site.com/component/easysocial/?Itemid=
if (!isset($selection[ $key ]) && $key == 'dashboard' && $menus ) {
// get menu keys
$menuKey = array_keys($menus);
$tmpMenu = $menus[$menuKey[0]];
//get layout keys
$layoutKeys = array_keys($tmpMenu);
$theOneMenu = false;
if ($layoutKeys && isset($tmpMenu[$layoutKeys[0]])) {
$theOneMenu = $tmpMenu[$layoutKeys[0]];
}
else if( isset($menus[$menuKey[0]][0]) )
{
$theOneMenu = $menus[$menuKey[0]][0];
}
if($theOneMenu) {
$selection[ $key ] = $theOneMenu;
}
}
// If we still can't find any menu, skip this altogether.
if (!isset($selection[ $key ])) {
$selection[$key] = false;
}
}
return $selection[$key];
}
/**
* Retrieves the item id of the current view.
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function getItemId( $view , $layout = '', $id = '')
{
static $views = array();
// Cache the result
$key = $view . $layout . $id;
if (!isset($views[$key])) {
// Retrieve the list of default menu
$defaultMenu = FRoute::getMenus('dashboard','');
// Initial menu should be false
$menuId = false;
if (!empty($layout)) {
// Try to locate menu with just the view if we still can't find a menu id.
$menus = FRoute::getMenus($view, $layout, $id);
if (!$menuId && $menus) {
// If this menu contains data about "id", we shouldn't simply use it.
// if (!isset($menus[0]->segments->id)) {
// $menuId = $menus[0]->id;
// }
// var_dump($menus[0]);exit;
$menuId = $menus[0]->id;
}
}
// Try to locate menu with just the view if we still can't find a menu id.
$menus = FRoute::getMenus($view, '', '');
// If menu id for view + layout doesn't exists, use the one from the view
if (!$menuId && $menus) {
$menuId = $menus[0]->id;
}
// If we still don't have a menu id, we use the default dashboard view.
if (!$menuId && $defaultMenu) {
$menuId = $defaultMenu[0]->id;
}
$views[ $key ] = $menuId;
}
return $views[ $key ];
}
/**
* Builds the controller url
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function controller( $name , $params = array() , $xhtml = true , $ssl = null )
{
// For controller urls, we shouldn't pass it to the router.
$url = 'index.php?option=com_easysocial&controller=' . $name;
// Determines if this url is an external url.
$external = isset( $params[ 'external' ] ) ? $params[ 'external' ] : false;
$tokenize = isset( $params[ 'tokenize' ] ) ? $params[ 'tokenize' ] : false;
unset( $params[ 'external' ] );
unset( $params[ 'tokenize' ] );
if( $params )
{
foreach( $params as $key => $value )
{
$url .= '&' . $key . '=' . $value;
}
}
$url = FRoute::_( $url , $xhtml , '' , $ssl , $tokenize , $external );
return $url;
}
/**
* Returns the sef url for registration links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::registration();
* ?>
* </code>
*
* @since 1.0
* @access public
*/
public static function account()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for registration links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::registration();
* ?>
* </code>
*
* @since 1.0
* @access public
*/
public static function registration()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for apps
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function apps()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for following links
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function points()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for following links
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function followers()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for profile links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function profile()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for profile links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function groups()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function profiles()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function login()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function friends()
{
$args = func_get_args();
return self::callStatic(__FUNCTION__, $args);
}
/**
* Calls the adapter file
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function callStatic($view, $args)
{
$router = FD::router($view);
return call_user_func_array(array($router, 'route'), $args);
}
/**
* Returns the sef url for activity logs
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function activities()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for activity logs
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function leaderboard()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function conversations()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function stream()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for badge links.
*
* Example:
* <code>
* <?php
* // Returns routed url to badges page
* echo FRoute::badges();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function badges()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to users
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function users()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to albums
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function albums()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to albums
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function photos()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to search
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function search()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to unity
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function unity()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to dashboard
*
* @since 1.0
* @access public
* @param string
* @return
*/
public static function dashboard()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for login links.
*
* Example:
* <code>
* <?php
* // Returns routed url to registration page.
* echo FRoute::profile();
* ?>
* </code>
*
* @since 1.0
* @access public
* @param int (Optional) User's id.
*/
public static function notifications()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the URL to fields
*
* @since 1.0
* @access public
* @param array
* @return
*/
public static function fields()
{
$args = func_get_args();
return self::callStatic( __FUNCTION__ , $args );
}
/**
* Returns the sef url for events links.
*