A complete description of the menu bar is available in
Chapter 8.
This example shows how we add the button. We use two parameters to define the
name of the component and the height of the preferences box. Adding buttons to the
administration toolbar is explained in detail in Chapter 8.
JMenuBar::preferences('com_myextension', '200');
When an administrator uses this button, they will be presented with a preferences
box. The first parameter determines which component's parameters we want to
modify. The second parameter determines the height of this box. This screenshot
depicts the preferences box displayed for com_myextension using the XML file we
described earlier:
Now that we can define and edit parameters for a component, we need to know how
to access these parameters from within the frontend of our component. To achieve
this we use the application getPageParameters() method:
$params =& $mainframe->getPageParameters('com_myextension');
The great thing about this method is that it will automatically override any of the
component's default configuration with the menu item's configuration.
Pages:
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141