forked from atkphpframework/achievo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
59 lines (52 loc) · 2.08 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
<?php
/**
* @internal includes
*/
$config_atkroot = "./";
include_once("atk.inc");
include_once("atk/atkbrowsertools.inc");
include_once("achievotools.inc");
atksession();
atksecure();
include "theme.inc";
$theme = &atkinstance('atk.ui.atktheme');
if (atkconfig("fullscreen")) {
// Fullscreen mode. Use index.php as launcher, and launch app.php fullscreen.
$page = &atkinstance("atk.ui.atkpage");
$ui = &atkinstance("atk.ui.atkui");
$theme = &atkinstance("atk.ui.atktheme");
$output = &atkinstance("atk.ui.atkoutput");
$page->register_style($theme->stylePath("style.css"));
$page->register_script(atkconfig("atkroot") . "atk/javascript/launcher.js");
$content = '<script language="javascript">atkLaunchApp(); </script>';
$content.= '<br><br><a href="#" onClick="atkLaunchApp()">' . atktext('app_reopen', "atk") . '</a> ' .
'<a href="#" onClick="window.close()">' . atktext('app_close', "atk") . '</a><br><br>';
$box = $ui->renderBox(array("title" => atktext("app_launcher"),
"content" => $content));
$page->addContent($box);
$output->output($page->render(atktext('app_launcher'), true));
$output->outputFlush();
} else {
if ($theme->getAttribute('useframes', true)) {
// Regular mode. app.php can be included directly.
include "app.php";
} else {
$user = &atkGetUser();
$indexpage = &atknew('atk.ui.atkindexpage');
$indexpage->setUsername(getFullUsername());
$indexpage->setTitle(getAchievoTitle());
$indexpage->setTopSearchPiece(getSearchPiece());
$centerpiece = "";
$centerpiecelinks = array();
getCenterPiece($centerpiece, $centerpiecelinks);
$indexpage->setTopCenterPieceLinks($centerpiecelinks);
if ($user["name"] == "administrator") {
$destination = array("atknodetype" => "pim.pim", "atkaction" => "adminpim");
} else {
$destination = array("atknodetype" => "pim.pim", "atkaction" => "pim");
}
$indexpage->setDefaultDestination($destination);
$indexpage->generate();
}
}
?>