// create header form
$slideHeaderForm = new CForm('get');
$slideHeaderForm->setName('slideHeaderForm');
$configComboBox = new CComboBox('config', 'slides.php', 'javascript: redirect(this.options[this.selectedIndex].value);');
$configComboBox->addItem('screens.php', _('Screens'));
$configComboBox->addItem('slides.php', _('Slide shows'));
$slideHeaderForm->addItem($configComboBox);
if (empty($this->data['slideshows'])) {
    $slideWidget->addPageHeader(_('SLIDE SHOWS'), $slideHeaderForm);
    $slideWidget->addItem(BR());
    $slideWidget->addItem(new CTableInfo(_('No slide shows defined.')));
} else {
    $favouriteIcon = $this->data['screen'] ? get_icon('favourite', array('fav' => 'web.favorite.screenids', 'elname' => 'slideshowid', 'elid' => $this->data['elementid'])) : new CIcon(_('Favourites'), 'iconplus');
    $refreshIcon = new CIcon(_('Menu'), 'iconmenu');
    if (!empty($this->data['screen'])) {
        $refreshIcon->addAction('onclick', 'javascript: create_page_menu(event, "hat_slides");');
    }
    $slideWidget->addPageHeader(_('SLIDE SHOWS'), array($slideHeaderForm, SPACE, $favouriteIcon, $refreshIcon, get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen']))));
    $slideForm = new CForm('get');
    $slideForm->setName('slideForm');
    $slideForm->addVar('fullscreen', $this->data['fullscreen']);
    $elementsComboBox = new CComboBox('elementid', $this->data['elementid'], 'submit()');
    foreach ($this->data['slideshows'] as $slideshow) {
        $elementsComboBox->addItem($slideshow['slideshowid'], get_node_name_by_elid($slideshow['slideshowid'], null, ': ') . $slideshow['name']);
    }
    $slideForm->addItem(array(_('Slide show') . SPACE, $elementsComboBox));
    $slideWidget->addHeader($this->data['slideshows'][$this->data['elementid']]['name'], $slideForm);
    if (!empty($this->data['screen'])) {
        // append groups to form
        if (!empty($this->data['page_groups'])) {
            $groupsComboBox = new CComboBox('groupid', $this->data['page_groups']['selected'], 'javascript: submit();');