/**
  * Sets the header and adds a default expand-collapse icon.
  *
  * @param string|array|CTag $caption
  * @param string|array|CTag $icons
  */
 public function setHeader($caption = null, $icons = SPACE)
 {
     zbx_value2array($icons);
     $icon = new CIcon(_('Show') . '/' . _('Hide'), $this->open ? 'arrowup' : 'arrowdown', 'changeWidgetState(this, "' . $this->id . '");');
     $icon->setAttribute('id', $this->id . '_icon');
     array_unshift($icons, $icon);
     parent::setHeader($caption, $icons);
 }
Exemplo n.º 2
0
 public function setHeader($caption = null, $icons = SPACE)
 {
     zbx_value2array($icons);
     if (is_null($caption) && !is_null($icons)) {
         $caption = SPACE;
     }
     $this->_header = new CDiv(null, 'nowrap ui-corner-all ui-widget-header ' . $this->css_class);
     if (!is_null($this->state)) {
         $icon = new CIcon(_('Show') . '/' . _('Hide'), $this->state ? 'arrowup' : 'arrowdown', "changeHatStateUI(this,'" . $this->domid . "');");
         $icon->setAttribute('id', $this->domid . '_icon');
         $this->_header->addItem($icon);
     }
     $this->_header->addItem($icons);
     $this->_header->addItem($caption);
     return $this->_header;
 }
Exemplo n.º 3
0
function get_icon($name, $params = array())
{
    switch ($name) {
        case 'favourite':
            if (infavorites($params['fav'], $params['elid'], $params['elname'])) {
                $icon = new CIcon(_('Remove from favourites'), 'iconminus', 'rm4favorites("' . $params['elname'] . '", "' . $params['elid'] . '", 0);');
            } else {
                $icon = new CIcon(_('Add to favourites'), 'iconplus', 'add2favorites("' . $params['elname'] . '", "' . $params['elid'] . '");');
            }
            $icon->setAttribute('id', 'addrm_fav');
            break;
        case 'fullscreen':
            $url = new Curl();
            $url->setArgument('fullscreen', $params['fullscreen'] ? '0' : '1');
            $icon = new CIcon($_REQUEST['fullscreen'] ? _('Normal view') : _('Fullscreen'), 'fullscreen', "document.location = '" . $url->getUrl() . "';");
            break;
        case 'menu':
            $icon = new CIcon(_('Menu'), 'iconmenu', 'create_page_menu(event, "' . $params['menu'] . '");');
            break;
        case 'reset':
            $icon = new CIcon(_('Reset'), 'iconreset', 'timeControl.objectReset();');
            break;
    }
    return $icon;
}
Exemplo n.º 4
0
 private function createHeader()
 {
     $header = reset($this->headers);
     $columnRights = array();
     if (!is_null($header['right'])) {
         foreach ($header['right'] as $right) {
             $columnRights[] = new CDiv($right, 'floatright');
         }
     }
     if (!is_null($this->state)) {
         $icon = new CIcon(_('Show') . '/' . _('Hide'), $this->state ? 'arrowup' : 'arrowdown', "change_hat_state(this, '" . $this->bodyId . "');");
         $icon->setAttribute('id', $this->bodyId . '_icon');
         $columnRights[] = $icon;
     }
     if ($columnRights) {
         $columnRights = array_reverse($columnRights);
     }
     // header table
     $table = new CTable(null, $this->css_class . ' maxwidth');
     $table->setCellSpacing(0);
     $table->setCellPadding(1);
     $table->addRow($this->createHeaderRow($header['left'], $columnRights), 'first');
     if ($this->css_class != 'header_wide') {
         $table->addClass('ui-widget-header ui-corner-all');
     }
     foreach ($this->headers as $num => $header) {
         if ($num > 0) {
             $table->addRow($this->createHeaderRow($header['left'], $header['right']), 'next');
         }
     }
     return new CDiv($table);
 }
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
include 'include/views/js/configuration.sysmaps.js.php';
$sysmapWidget = new CWidget();
$sysmapWidget->addPageHeader(_('CONFIGURATION OF NETWORK MAPS'));
// create menu
$addIcon = new CIcon(_('Add element'), 'iconplus');
$addIcon->setAttribute('id', 'selementAdd');
$removeIcon = new CIcon(_('Remove element'), 'iconminus');
$removeIcon->setAttribute('id', 'selementRemove');
$addLinkIcon = new CIcon(_('Add link'), 'iconplus');
$addLinkIcon->setAttribute('id', 'linkAdd');
$removeLinkIcon = new CIcon(_('Remove link'), 'iconminus');
$removeLinkIcon->setAttribute('id', 'linkRemove');
$expandMacros = new CSpan($this->data['sysmap']['expand_macros'] == SYSMAP_EXPAND_MACROS_ON ? _('On') : _('Off'), 'whitelink');
$expandMacros->setAttribute('id', 'expand_macros');
$gridShow = new CSpan($this->data['sysmap']['grid_show'] == SYSMAP_GRID_SHOW_ON ? _('Shown') : _('Hidden'), 'whitelink');
$gridShow->setAttribute('id', 'gridshow');
$gridAutoAlign = new CSpan($this->data['sysmap']['grid_align'] == SYSMAP_GRID_ALIGN_ON ? _('On') : _('Off'), 'whitelink');
$gridAutoAlign->setAttribute('id', 'gridautoalign');
$gridSize = new CComboBox('gridsize', $this->data['sysmap']['grid_size']);
$gridSize->addItems(array(20 => '20x20', 40 => '40x40', 50 => '50x50', 75 => '75x75', 100 => '100x100'));
$gridAlignAll = new CSubmit('gridalignall', _('Align icons'));
$gridAlignAll->setAttribute('id', 'gridalignall');
$gridForm = new CDiv(array($gridSize, $gridAlignAll));
$gridForm->setAttribute('id', 'gridalignblock');
$saveButton = new CSubmit('update', _('Update'));
$saveButton->setAttribute('id', 'sysmap_update');
$menuTable = new CTable(null, 'textwhite');
Exemplo n.º 6
0
        access_deny();
    } else {
        $sysmap = reset($maps);
    }
}
echo SBR;
// elements
$el_add = new CIcon(_('Add element'), 'iconplus');
$el_add->setAttribute('id', 'selementAdd');
$el_rmv = new CIcon(_('Remove element'), 'iconminus');
$el_rmv->setAttribute('id', 'selementRemove');
// connectors
$cn_add = new CIcon(_('Add link'), 'iconplus');
$cn_add->setAttribute('id', 'linkAdd');
$cn_rmv = new CIcon(_('Remove link'), 'iconminus');
$cn_rmv->setAttribute('id', 'linkRemove');
$expandMacros = new CSpan($sysmap['expand_macros'] == SYSMAP_EXPAND_MACROS_ON ? _('On') : _('Off'), 'whitelink');
$expandMacros->setAttribute('id', 'expand_macros');
$gridShow = new CSpan($sysmap['grid_show'] == SYSMAP_GRID_SHOW_ON ? _('Shown') : _('Hidden'), 'whitelink');
$gridShow->setAttribute('id', 'gridshow');
$gridAutoAlign = new CSpan($sysmap['grid_align'] == SYSMAP_GRID_ALIGN_ON ? _('On') : _('Off'), 'whitelink');
$gridAutoAlign->setAttribute('id', 'gridautoalign');
$possibleGridSizes = array(20 => '20x20', 40 => '40x40', 50 => '50x50', 75 => '75x75', 100 => '100x100');
$gridSize = new CComboBox('gridsize', $sysmap['grid_size']);
$gridSize->addItems($possibleGridSizes);
$gridAlignAll = new CSubmit('gridalignall', _('Align icons'));
$gridAlignAll->setAttribute('id', 'gridalignall');
$gridForm = new CDiv(array($gridSize, $gridAlignAll));
$gridForm->setAttribute('id', 'gridalignblock');
$saveButton = new CSubmit('save', _('Save'));
$saveButton->setAttribute('id', 'sysmap_save');
Exemplo n.º 7
0
 private function createHeader()
 {
     $header = array_shift($this->headers);
     $td_l = new CCol(SPACE);
     $td_l->setAttribute('width', '100%');
     $right_row = array($td_l);
     if (!is_null($header['right'])) {
         foreach ($header['right'] as $num => $r_item) {
             $right_row[] = new CCol($r_item);
         }
     }
     if (!is_null($this->state)) {
         $icon = new CIcon(S_SHOW . '/' . S_HIDE, $this->state ? 'arrowup' : 'arrowdown', "change_hat_state(this,'" . $this->domid . "');");
         $icon->setAttribute('id', $this->domid . '_icon');
         $right_row[] = new CCol($icon);
     }
     $right_tab = new CTable(null, 'nowrap');
     $right_tab->setAttribute('width', '100%');
     $right_tab->addRow($right_row, 'textblackwhite');
     $header['right'] = $right_tab;
     $header_tab = new CTable(null, $this->css_class);
     $header_tab->setCellSpacing(0);
     $header_tab->setCellPadding(1);
     if (!empty($this->flicker)) {
         //			$header_tab->setAttribute('style','border-bottom: 0px;');
     }
     $header_tab->addRow($this->createHeaderRow($header['left'], $right_tab), 'first');
     foreach ($this->headers as $num => $header) {
         $header_tab->addRow($this->createHeaderRow($header['left'], $header['right']), 'next');
     }
     return $header_tab;
 }
Exemplo n.º 8
0
function get_icon($name, $params = array())
{
    switch ($name) {
        case 'favourite':
            if (infavorites($params['fav'], $params['elid'], $params['elname'])) {
                $icon = new CIcon(S_REMOVE_FROM . ' ' . S_FAVOURITES, 'iconminus', 'rm4favorites("' . $params['elname'] . '","' . $params['elid'] . '", 0);');
            } else {
                $icon = new CIcon(S_ADD_TO . ' ' . S_FAVOURITES, 'iconplus', 'add2favorites("' . $params['elname'] . '","' . $params['elid'] . '");');
            }
            $icon->setAttribute('id', 'addrm_fav');
            break;
        case 'fullscreen':
            $url = new Curl();
            $url->setArgument('fullscreen', $params['fullscreen'] ? '0' : '1');
            $icon = new CIcon($_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN, 'fullscreen', "document.location = '" . $url->getUrl() . "';");
            break;
        case 'menu':
            $icon = new CIcon(S_MENU, 'iconmenu', 'create_page_menu(event, "' . $params['menu'] . '");');
            break;
        case 'reset':
            $icon = new CIcon(S_RESET, 'iconreset', 'timeControl.objectReset("' . $params['id'] . '");');
            break;
    }
    return $icon;
}
Exemplo n.º 9
0
$row = CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_GRAPHS . '.row', 0);
$dashboardGrid[$col][$row] = $favouriteGraphs;
// favourite maps
$icon = new CIcon(_('Menu'), 'iconmenu');
$icon->setAttribute('id', 'favouriteMaps');
$icon->setMenuPopup(CMenuPopupHelper::getFavouriteMaps());
$favouriteMaps = new CCollapsibleUiWidget(WIDGET_FAVOURITE_MAPS, getFavouriteMaps());
$favouriteMaps->open = (bool) CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_MAPS . '.state', true);
$favouriteMaps->setHeader(_('Favourite maps'), $icon);
$favouriteMaps->setFooter(new CLink(_('Maps') . ' »', 'maps.php', 'highlight'), true);
$col = CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_MAPS . '.col', 0);
$row = CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_MAPS . '.row', 2);
$dashboardGrid[$col][$row] = $favouriteMaps;
// favourite screens
$icon = new CIcon(_('Menu'), 'iconmenu');
$icon->setAttribute('id', 'favouriteScreens');
$icon->setMenuPopup(CMenuPopupHelper::getFavouriteScreens());
$favouriteScreens = new CCollapsibleUiWidget(WIDGET_FAVOURITE_SCREENS, getFavouriteScreens());
$favouriteScreens->open = (bool) CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_SCREENS . '.state', true);
$favouriteScreens->setHeader(_('Favourite screens'), $icon);
$favouriteScreens->setFooter(array(new CLink(_('Screens') . ' »', 'screens.php', 'highlight'), SPACE, SPACE, SPACE, new CLink(_('Slide shows') . ' »', 'slides.php', 'highlight')), true);
$col = CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_SCREENS . '.col', 0);
$row = CProfile::get('web.dashboard.widget.' . WIDGET_FAVOURITE_SCREENS . '.row', 1);
$dashboardGrid[$col][$row] = $favouriteScreens;
// status of Zabbix
if (CWebUser::$data['type'] == USER_TYPE_SUPER_ADMIN) {
    $rate = CProfile::get('web.dashboard.widget.' . WIDGET_ZABBIX_STATUS . '.rf_rate', 60);
    $icon = new CIcon(_('Menu'), 'iconmenu');
    $icon->setMenuPopup(CMenuPopupHelper::getRefresh(WIDGET_ZABBIX_STATUS, $rate));
    $zabbixStatus = new CCollapsibleUiWidget(WIDGET_ZABBIX_STATUS, new CSpan(_('Loading...'), 'textcolorstyles'));
    $zabbixStatus->open = (bool) CProfile::get('web.dashboard.widget.' . WIDGET_ZABBIX_STATUS . '.state', true);
Exemplo n.º 10
0
function get_icon($type, $params = array())
{
    switch ($type) {
        case 'favourite':
            if (CFavorite::exists($params['fav'], $params['elid'], $params['elname'])) {
                $icon = new CIcon(_('Remove from favourites'), 'iconminus', 'rm4favorites("' . $params['elname'] . '", "' . $params['elid'] . '");');
            } else {
                $icon = new CIcon(_('Add to favourites'), 'iconplus', 'add2favorites("' . $params['elname'] . '", "' . $params['elid'] . '");');
            }
            $icon->setAttribute('id', 'addrm_fav');
            return $icon;
        case 'fullscreen':
            $url = new CUrl();
            $url->setArgument('fullscreen', $params['fullscreen'] ? '0' : '1');
            return new CIcon($params['fullscreen'] ? _('Normal view') : _('Fullscreen'), 'fullscreen', "document.location = '" . $url->getUrl() . "';");
        case 'reset':
            return new CIcon(_('Reset'), 'iconreset', 'timeControl.objectReset();');
    }
    return null;
}
Exemplo n.º 11
0
    } else {
        $sysmap = reset($maps);
    }
}
echo SBR;
// ELEMENTS
$el_add = new CIcon(S_ADD_ELEMENT, 'iconplus');
$el_add->setAttribute('id', 'selement_add');
$el_rmv = new CIcon(S_REMOVE_ELEMENT, 'iconminus');
$el_rmv->setAttribute('id', 'selement_rmv');
//-----------------
// CONNECTORS
$cn_add = new CIcon(S_ADD_LINK, 'iconplus');
$cn_add->setAttribute('id', 'link_add');
$cn_rmv = new CIcon(S_REMOVE_LINK, 'iconminus');
$cn_rmv->setAttribute('id', 'link_rmv');
//------------------------
// Side Menu
$elcn_tab = new CTable();
$elcn_tab->addRow(array(bold('E'), bold('L')));
$elcn_tab->addRow(array($el_add, $cn_add));
$elcn_tab->addRow(array($el_rmv, $cn_rmv));
$td = new CCol($elcn_tab);
$td->setAttribute('valign', 'top');
//----
$save_btn = new CButton('save', S_SAVE);
$save_btn->setAttribute('id', 'sysmap_save');
$elcn_tab = new CTable(null, 'textwhite');
$menuRow = array();
$gridShow = new CSpan(S_SHOWN, 'whitelink');
$gridShow->setAttribute('id', 'gridshow');