forked from atkphpframework/achievo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.php
111 lines (100 loc) · 3.71 KB
/
app.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
<?php
/**
* This file is part of the Achievo ATK distribution.
* Detailed copyright and licensing information can be found
* in the doc/COPYRIGHT and doc/LICENSE files which should be
* included in the distribution.
*
* This file is the skeleton main frameset file, which you can copy
* to your application dir and modify if necessary. By default, it checks
* the settings $config_top_frame to determine how many frames to show,
* and reads the menu config to display the proper menu.
*
* @package atk
* @subpackage skel
*
* @author Ivo Jansch <[email protected]>
*
* @copyright (c)2000-2004 Ibuildings.nl BV
* @license http://www.achievo.org/atk/licensing ATK Open Source License
*
* @version $Revision$
* $Id$
*/
/**
* @internal includes..
*/
$config_atkroot = "./";
include_once("atk.inc");
atksession();
atksecure();
include "theme.inc";
$output='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
$output.="\n<html>\n <head>\n";
$output.=' <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset='.atktext("charset","","atk").'">';
$output.="\n <title>".getAchievoTitle()."</title>\n";
$favico = atkconfig("defaultfavico");
if ($favico!="")
{
$output.= ' <link rel="icon" href="'.$favico.'" type="image/x-icon" />'."\n";
$output.= ' <link rel="shortcut icon" href="'.$favico.'" type="image/x-icon" />'."\n";
}
$output.="\n</head>\n";
atkimport("atk.menu.atkmenu");
atkimport("atk.utils.atkframeset");
$menu = &atkMenu::getMenu();
$theme = &atkinstance('atk.ui.atktheme');
$position = $menu->getPosition();
$scrolling = ($menu->getScrollable()==MENU_SCROLLABLE?FRAME_SCROLL_AUTO:FRAME_SCROLL_NO);
if(isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"]))
{
$destination = "dispatch.php?atknodetype=".$ATK_VARS["atknodetype"]."&atkaction=".$ATK_VARS["atkaction"];
if (isset($ATK_VARS["atkselector"])) $destination.="&atkselector=".$ATK_VARS["atkselector"];
if (isset($ATK_VARS["searchstring"])) $destination.="&searchstring=".$ATK_VARS["searchstring"];
}
else
{
if (atkArrayNvl(atkGetUser(), "name") == "administrator")
{
$destination = session_url(dispatch_url("pim.pim", "adminpim"),SESSION_NEW);
}
else
{
$destination = session_url(dispatch_url("pim.pim", "pim"),SESSION_NEW);
}
}
$frame_top_height = $theme->getAttribute('frame_top_height');
$frame_menu_width = $theme->getAttribute('frame_menu_width');
$topframe = &new atkFrame($frame_top_height?$frame_top_height:"75", "top", "top.php", FRAME_SCROLL_NO, true);
$mainframe = &new atkFrame("*", "main", $destination, FRAME_SCROLL_AUTO, true);
$menuframe = &new atkFrame(($position==MENU_LEFT||$position==MENU_RIGHT?($frame_menu_width?$frame_menu_width:190):$menu->getHeight()), "menu", "menu.php", $scrolling);
$noframes = '<p>Your browser doesnt support frames, but this is required to run '.atktext('app_title')."</p>\n";
$root = &new atkRootFrameset();
if (atkconfig("top_frame"))
{
$outer = &new atkFrameSet("*", FRAMESET_VERTICAL, 0, $noframes);
$outer->addChild($topframe);
$root->addChild($outer);
}
else
{
$outer = &$root;
$outer->m_noframes = $noframes;
}
$orientation = ($position==MENU_TOP||$position==MENU_BOTTOM?FRAMESET_VERTICAL:FRAMESET_HORIZONTAL);
$wrapper = &new atkFrameSet("*", $orientation);
if($position==MENU_TOP||$position==MENU_LEFT)
{
$wrapper->addChild($menuframe);
$wrapper->addChild($mainframe);
}
else
{
$wrapper->addChild($mainframe);
$wrapper->addChild($menuframe);
}
$outer->addChild($wrapper);
$output.= $root->render();
$output.= "</html>";
echo $output;
?>