r1143 + welcome first working code of the help functions
[racktables] / inc / help.php
1 <?
2 /*
3 *
4 * This file contains help rendering functions for RackTables.
5 *
6 */
7
8 // Generate a link to the help tab.
9 function genHelpLink ($tabno)
10 {
11 global $root;
12 return "${root}?page=help&tab=${tabno}";
13 }
14
15 // Checks if a topic is present for page and tab and render a hinting element;
16 // do nothing otherwise.
17 function lookupHelpTopic ($pageno, $tabno)
18 {
19 global $helptab;
20 if (!isset ($helptab[$pageno][$tabno]))
21 return;
22 echo "<td><a href='" . genHelpLink ($helptab[$pageno][$tabno]);
23 echo "' alt='Help' title='Help is available for this page'>";
24 printImageHREF ('helphint');
25 echo '</a></td>';
26 return;
27 }
28
29 // Prints the help page content.
30 function renderHelpTab ($tabno)
31 {
32 switch ($tabno)
33 {
34 //------------------------------------------------------------------------
35 case 'default':
36 startPortlet ('Hello there!');
37 echo '
38 This is the help system of a working RackTables installation. Select one of the
39 tabs above to find information on specific topics. If you are new to this
40 software, just follow to the next tab.
41 ';
42 finishPortlet();
43 break;
44 //------------------------------------------------------------------------
45 case 'quickstart':
46 echo
47 '
48 The datacenter world is built up from resources. The first resource to start
49 with is rackspace, which in turn is built up from racks. To create yur first
50 rack, open Configuration->Dictionary page and go to "Edit words" tab.
51 <p>
52 Here you see a bunch of portlets, each holding some odd data. The one you need
53 right now is called "RackRow (3)". The only thing you need to do now is to think
54 about the name you want to assign to the first group of your racks and to type
55 it into the form and press OK. This can be changed later, so a simple "server
56 room" is Ok.
57 <p>
58 Now get back to the main page and head into Rackspace page. You will see you
59 rack row with zero racks. Click it and go to "Add new rack" tab. This is the
60 moment where you create the rack itself, supplying its name and height.
61 <p>
62 To populate the rack, you need some stuff called objects. See the next page.
63 ';
64 break;
65 //------------------------------------------------------------------------
66 case 'rackspace':
67 startPortlet ('Rack design');
68 echo
69 "Rack design defines the physical layout of a rack cabinet. " .
70 "Most common reason to use the tab is absence of back rails, although " .
71 "any other design can be defined.<p>" .
72 "In this tab you can change mounting atoms' state between 'free' and 'absent'.<br>" .
73 "A selected checkbox means atom presence.";
74 finishPortlet();
75 startPortlet ('Rackspace problems');
76 echo
77 "Rack problems prevent free rackspace from being used for mounting. Such rackspace is considered " .
78 "unusable. After the problem is gone, the atom can become free again. " .
79 "In this tab you can change atoms' state from free to unusable and back.<br>" .
80 "A selected checkbox means a problem.";
81 finishPortlet();
82 break;
83 //------------------------------------------------------------------------
84 default:
85 startPortlet ('Oops!');
86 echo "There was no help text found for help tab '${tabno}' in renderHelpTab().";
87 finishPortlet();
88 break;
89 //------------------------------------------------------------------------
90 }
91 }
92
93 ?>