provide installation instructions
[extjs.git] / examples / remoteload / sampleApp.php
1 <?php
2         session_start();
3         $subitems = array();
4         $subitems[] = array(
5                 "xtype"=>"panel",
6                 "region"=>"north",
7                 "border"=>false,
8                 "bodyStyle"=>"padding: 5px; background-color: #cfcfcf; font-family: Arial; font-weight: bold;",
9                 "html"=>"Employee Database",
10                 "height"=>32
11         );
12         
13         $subitems[] = array(
14                 "xtype"=>"panel",
15                 "region"=>"south",
16                 "height"=>200,
17                 "collapsed"=>true,
18                 "collapsible"=>true,
19                 "title"=>"Purpose",
20                 "bodyStyle"=>"padding: 5px;",
21                 "html"=>"This example demonstrates how to remotely load component configurations with a sample extension <a href='ComponentLoader.js'>Ext.ux.ComponentLoader</a>. By changing the session isAdmin flag you can see how different component configurations can be sent over the wire to improve security. "
22         );      
23
24         $subitems[] = array(
25                 "id"=>"employeeDetailsCt",
26         "region"=>"east",
27         "title"=>"Employee Details",
28         "collapsible"=>true,
29         "split"=>true,
30         "width"=>275,
31         "minSize"=>175,
32         "maxSize"=>400,
33         "layout"=>"fit",
34         "margins"=>"0 5 0 0"            
35         );
36
37         $subitems[] = array(
38                 "region"=>"center",
39                 "id"=>"employeeGrid",
40                 "xtype"=>"employeegrid",
41                 "store"=>"employeeStore"
42         );      
43
44         
45         $components = array();
46         $components[] = array(
47                 "layout"=>"border",
48                 "xtype"=>"viewport",
49                 "items"=>$subitems
50         );
51         $tabs = array();
52         $tabs[] = array(
53                 "xtype"=>"employeedetails",
54                 "title"=>"Information",
55                 "url"=>"loadEmployeeInfo.php"
56         );
57         if (true == $_SESSION['isAdmin']) {
58                  $tabs[] = array(
59                         "title"=>"Edit",
60                         "xtype"=>"employeepropertygrid",
61                         "url"=>"loadEmployeePropGrid.php"
62                 );              
63         }       
64         
65         $components[] = array(
66                 "xtype"=>"employeedetailstab",  
67                 "id"=>"employeeDetails",
68                 "container"=>"employeeDetailsCt",
69                 "border"=>false,
70                 "activeTab"=>0,
71                 "tabPosition"=>"bottom",
72                 "items"=>$tabs
73         );
74                 
75         $jsonPacket = array("components"=>$components, "success"=>true);
76         echo json_encode($jsonPacket);  
77 ?>
78
79
80