コード例 #1
0
ファイル: sysmaps.php プロジェクト: phedders/zabbix
            }
            $result = DBend($result);
            if ($result) {
                unset($_REQUEST["form"]);
            }
            show_messages($result, S_MAP_DELETED, S_CANNOT_DELETE_MAP);
        }
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MAP));
show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
    insert_map_form();
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
    $header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP));
    $result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid'));
    while ($row = DBfetch($result)) {
        if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) {
            continue;
        }
        $table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"])));
コード例 #2
0
ファイル: sysmaps.php プロジェクト: songyuanjie/zabbix-stats
if ($_REQUEST['go'] != 'none' && isset($go_result) && $go_result) {
    $url = new CUrl();
    $path = $url->getPath();
    insert_js('cookie.eraseArray("' . $path . '")');
}
$form = new CForm(null, 'get');
$form->addItem(new CButton('form', S_CREATE_MAP));
$form->addItem(new CButton('form', S_IMPORT_MAP));
$map_wdgt = new CWidget();
$map_wdgt->addPageHeader(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
if (isset($_REQUEST['form'])) {
    if ($_REQUEST['form'] == S_IMPORT_MAP) {
        $map_wdgt->addItem(import_map_form($rules));
    } else {
        if ($_REQUEST['form'] == S_CREATE_MAP || $_REQUEST['form'] == 'update') {
            $map_wdgt->addItem(insert_map_form());
        }
    }
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CDiv();
    $numrows->setAttribute('name', 'numrows');
    $map_wdgt->addHeader(S_MAPS_BIG);
    $map_wdgt->addHeader($numrows);
    $table = new CTableInfo(S_NO_MAPS_DEFINED);
    $table->setHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_header(S_NAME, 'name'), make_sorting_header(S_WIDTH, 'width'), make_sorting_header(S_HEIGHT, 'height'), S_EDIT));
    $sortfield = getPageSortField('name');
    $sortorder = getPageSortOrder();
    $options = array('editable' => 1, 'extendoutput' => 1, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1);
    $maps = CMap::get($options);