-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
64 lines (57 loc) · 1.79 KB
/
index.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
<?php
/**
* EGroupware digital ROCK Rankings
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package ranking
* @link http://www.egroupware.org
* @link http://www.digitalROCK.de
* @author Ralf Becker <[email protected]>
* @copyright 2006-19 by Ralf Becker <[email protected]>
*/
use EGroupware\Api;
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'ranking',
'noheader' => True,
'nonavbar' => True
));
include('../header.inc.php');
// do NOT allow anonymous access
if ($GLOBALS['egw']->session->session_flags === 'A')
{
throw new Api\Exception\Redirect(Api\Egw::link('/logout.php'));
}
if (!($view = Api\Cache::getSession('ranking', 'menuaction')) &&
!($view = $GLOBALS['egw_info']['user']['preferences']['ranking']['default_view']))
{
$view = 'ranking.uiranking.index';
}
// fix old class-names stored in user prefs
if (substr($view, 0, 10) === 'ranking.ui' && $view !== 'ranking.uiranking.index')
{
list($app, $class, $method) = explode('.', $view);
$view = 'ranking.ranking_'.substr($class, 2, substr($class, -1) === 's' ? -1 : 99).'_ui.'.$method;
}
// fix PSR1 to PSR4 class-names
list(, $class, $method) = explode('.', $view);
if (!class_exists($class) && (list(, $type) = explode('_', $view)) &&
class_exists($class='EGroupware\\Ranking\\'.ucfirst($type === 'cats' ? 'category' : $type).'\\Ui'))
{
$view = "ranking.$class.$method";
}
// urls which still need to run in iframe (NOT top-level)
if (in_array($view, array(
'ranking.uiranking.index',
'ranking.ranking_accounting.index',
)))
{
ExecMethod($view);
echo $GLOBALS['egw']->framework->footer();
exit;
}
// redirect to currently active view incl. ajax=true
Api\Egw::redirect_link('/index.php', array(
'menuaction' => $view,
'ajax' => 'true',
), 'ranking');