r1144 Redesigned help button
[racktables] / inc / help.php
CommitLineData
fe339610
DO
1<?
2/*
3*
4* This file contains help rendering functions for RackTables.
5*
6*/
7
8// Generate a link to the help tab.
9function 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.
17function lookupHelpTopic ($pageno, $tabno)
18{
19 global $helptab;
20 if (!isset ($helptab[$pageno][$tabno]))
21 return;
ae9a3784 22 echo "<li style='position: absolute; top: 80px; right: 0px;'><a style='background-color: #f0f0f0; border: 0;' href='" . genHelpLink ($helptab[$pageno][$tabno]);
fe339610
DO
23 echo "' alt='Help' title='Help is available for this page'>";
24 printImageHREF ('helphint');
ae9a3784 25 echo '</a>';
fe339610
DO
26 return;
27}
28
29// Prints the help page content.
30function renderHelpTab ($tabno)
31{
32 switch ($tabno)
33 {
34//------------------------------------------------------------------------
35 case 'default':
36 startPortlet ('Hello there!');
37 echo '
38This is the help system of a working RackTables installation. Select one of the
39tabs above to find information on specific topics. If you are new to this
40software, just follow to the next tab.
41';
42 finishPortlet();
43 break;
44//------------------------------------------------------------------------
45 case 'quickstart':
46 echo
47'
48The datacenter world is built up from resources. The first resource to start
49with is rackspace, which in turn is built up from racks. To create yur first
50rack, open Configuration->Dictionary page and go to "Edit words" tab.
51<p>
52Here you see a bunch of portlets, each holding some odd data. The one you need
53right now is called "RackRow (3)". The only thing you need to do now is to think
54about the name you want to assign to the first group of your racks and to type
55it into the form and press OK. This can be changed later, so a simple "server
56room" is Ok.
57<p>
58Now get back to the main page and head into Rackspace page. You will see you
59rack row with zero racks. Click it and go to "Add new rack" tab. This is the
60moment where you create the rack itself, supplying its name and height.
61<p>
62To 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?>