The default task is unpublish.
Parameters [task] Task
[alt] Name
unpublishList( task : string='unpublish', alt : string='Unpublish' ) : void
Adds an 'unpublish' button to the menu bar. The default task is unpublish.
Requires that at least one list item is selected, cid[].
Parameters [task] Task
[alt] Name
Sub-Menu
The sub-menu appears directly beneath the toolbar. It is automatically populated
with the component sub-menu items defined in the component XML manifest file.
If we modify sub-menu items, the automatically generated items will not be
included. We can modify entries using the static JSubMenuHelper class. This
example adds two options to the sub-menu:
// get the current task
$task = JRequest::getCmd('task');
if ($task == 'item1' || $task == 'item2')
{
// determine selected task
$selected = ($task == 'item1');
// prepare links
$item1 = 'index.php?option=com_myextension&task=item1';
$item2 = 'index.php?option=com_myextension&task=item2';
// add sub menu items
JSubMenuHelper::addEntry(JText::_('Item 1'), $item1,
$selected);
JSubMenuHelper::addEntry(JText::_('Item 2'), $item2,
$selected);
}
Chapter 8
[ 223 ]
The addEntry() method adds a new item to the sub-menu.
Pages:
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308