当前位置: 首页>>代码示例>>PHP>>正文


PHP CFormTable::Show方法代码示例

本文整理汇总了PHP中CFormTable::Show方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormTable::Show方法的具体用法?PHP CFormTable::Show怎么用?PHP CFormTable::Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFormTable的用法示例。


在下文中一共展示了CFormTable::Show方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBfetch

            $frmCnct->AddVar("linkid", $_REQUEST["linkid"]);
            $db_link = DBfetch(DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST["linkid"] . ' AND triggerid=' . $_REQUEST['triggerid']));
            $triggerid = $_REQUEST['triggerid'];
            $drawtype = $db_link["drawtype"];
            $color = $db_link["color"];
        } else {
            $triggerid = get_request("triggerid", 0);
            $drawtype = get_request("drawtype", 0);
            $color = get_request("color", 0);
        }
        $frmCnct->AddVar("triggerid", $triggerid);
        /* START comboboxes preparations */
        $cmbType = new CComboBox("drawtype", $drawtype);
        foreach (map_link_drawtypes() as $i) {
            $value = map_link_drawtype2str($i);
            $cmbType->AddItem($i, $value);
        }
        $btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmCnct->GetName() . "&dstfld1=triggerid&dstfld2=trigger&srctbl=triggers&srcfld1=triggerid&srcfld2=description');", 'T');
        $btnSelect->SetType('button');
        /* END preparation */
        $description = $triggerid > 0 ? expand_trigger_description($triggerid) : '';
        $frmCnct->AddRow(S_TRIGGER, array(new CTextBox('trigger', $description, 70, 'yes'), SPACE, $btnSelect));
        $frmCnct->AddRow(S_TYPE . ' (' . S_PROBLEM_BIG . ')', $cmbType);
        $frmCnct->AddRow(S_COLOR . ' (' . S_PROBLEM_BIG . ')', new CColor('color', $color));
        $frmCnct->AddItemToBottomRow(new CButton("save", isset($_REQUEST['triggerid']) ? S_SAVE : S_ADD));
        $frmCnct->AddItemToBottomRow(SPACE);
        $frmCnct->AddItemToBottomRow(new CButton("cancel", S_CANCEL, 'javascript: window.close();'));
        $frmCnct->Show();
    }
}
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_link_tr.php

示例2: CVisibilityBox

    $frmGItem->addVar('gid', $gid);
    $frmGItem->addVar('config', $config);
    $frmGItem->addVar('list_name', $list_name);
    $frmGItem->addVar('itemid', $itemid);
    $frmGItem->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 32));
    //		$frmGItem->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
    $txtCondVal = new CTextBox('description', $description, 50, 'yes');
    $btnSelect = new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmGItem->GetName() . '&dstfld1=itemid&dstfld2=description&srctbl=items' . "&srcfld1=itemid&srcfld2=description&monitored_hosts=1');", 'T');
    $frmGItem->addRow(S_PARAMETER, array($txtCondVal, $btnSelect));
    $cmbFnc = new CComboBox('calc_fnc', $calc_fnc);
    $cmbFnc->addItem(CALC_FNC_MIN, S_MIN_SMALL);
    $cmbFnc->addItem(CALC_FNC_AVG, S_AVG_SMALL);
    $cmbFnc->addItem(CALC_FNC_MAX, S_MAX_SMALL);
    $cmbFnc->addItem(0, S_COUNT);
    $frmGItem->addRow(S_FUNCTION, $cmbFnc);
    if ($config == 1) {
        $cmbAxis = new CComboBox('axisside', $axisside);
        $cmbAxis->addItem(GRAPH_YAXIS_SIDE_LEFT, S_LEFT);
        $cmbAxis->addItem(GRAPH_YAXIS_SIDE_RIGHT, S_RIGHT);
        $frmGItem->addRow(S_AXIS_SIDE, $cmbAxis);
    }
    if ($config == 1) {
        $frmGItem->addRow(S_COLOR, new CColor('color', $color));
    } else {
        $frmGItem->addVar('color', $color);
    }
    $frmGItem->addItemToBottomRow(new CButton('save', isset($gid) ? S_SAVE : S_ADD));
    $frmGItem->addItemToBottomRow(new CButtonCancel(null, 'close_window();'));
    $frmGItem->Show();
}
include_once 'include/page_footer.php';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:popup_bitem.php

示例3: CFormTable

$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp("web.media.php");
$frmMedia->AddVar("media", $media);
$frmMedia->AddVar("dstfrm", $_REQUEST["dstfrm"]);
$cmbType = new CComboBox("mediatypeid", $mediatypeid);
$types = DBselect('SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type');
while ($type = DBfetch($types)) {
    $cmbType->AddItem($type["mediatypeid"], get_node_name_by_elid($type["mediatypeid"]) . $type["description"]);
}
$frmMedia->AddRow(S_TYPE, $cmbType);
$frmMedia->AddRow(S_SEND_TO, new CTextBox("sendto", $sendto, 20));
$frmMedia->AddRow(S_WHEN_ACTIVE, new CTextBox("period", $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
    array_push($frm_row, array(new CCheckBox("severity[{$i}]", str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
$frmMedia->AddRow(S_USE_IF_SEVERITY, $frm_row);
$cmbStat = new CComboBox("active", $active);
$cmbStat->AddItem(0, S_ENABLED);
$cmbStat->AddItem(1, S_DISABLED);
$frmMedia->AddRow("Status", $cmbStat);
$frmMedia->AddItemToBottomRow(new CButton("add", $media > -1 ? S_SAVE : S_ADD));
$frmMedia->AddItemToBottomRow(SPACE);
$frmMedia->AddItemToBottomRow(new CButtonCancel(null, 'close_window();'));
$frmMedia->Show();
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_media.php

示例4: foreach

if (isset($functions[$function]['params'])) {
    foreach ($functions[$function]['params'] as $pid => $pf) {
        $pv = isset($param[$pid]) ? $param[$pid] : null;
        if ($pf['T'] == T_ZBX_INT) {
            if (0 == $pid) {
                if (isset($pf['M']) && is_array($pf['M'])) {
                    $cmbParamType = new CComboBox('paramtype', $paramtype);
                    foreach ($pf['M'] as $mid => $caption) {
                        $cmbParamType->AddItem($mid, $caption);
                    }
                } else {
                    $form->AddVar('paramtype', PARAM_TYPE_SECONDS);
                    $cmbParamType = S_SECONDS;
                }
            } else {
                $cmbParamType = null;
            }
            $form->AddRow(S_LAST_OF . ' ', array(new CNumericBox('param[' . $pid . ']', $pv, 10), $cmbParamType));
        } else {
            $form->AddRow($pf['C'], new CTextBox('param[' . $pid . ']', $pv, 30));
            $form->AddVar('paramtype', PARAM_TYPE_SECONDS);
        }
    }
} else {
    $form->AddVar('paramtype', PARAM_TYPE_SECONDS);
    $form->AddVar('param', 0);
}
$form->AddRow('N', new CTextBox('value', $value, 10));
$form->AddItemToBottomRow(new CButton('insert', S_INSERT));
$form->Show();
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_trexpr.php

示例5: CVisibilityBox

    $frmPd->addVar('report_timesince', $report_timesince);
    $frmPd->addVar('report_timetill', $report_timetill);
    if (isset($_REQUEST['period_id'])) {
        $frmPd->addVar('period_id', $_REQUEST['period_id']);
    }
    $frmPd->addRow(array(new CVisibilityBox('caption_visible', !zbx_empty($caption), 'caption', S_DEFAULT), S_CAPTION), new CTextBox('caption', $caption, 10));
    //		$frmPd->addRow(S_CAPTION, new CTextBox('caption',$caption,10));
    //*
    $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab = new CTable(null, 'calendar');
    $reporttimetab->setAttribute('width', '10%');
    $reporttimetab->setCellPadding(0);
    $reporttimetab->setCellSpacing(0);
    $reporttimetab->addRow(array(S_FROM, new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month', $report_timesince > 0 ? date('m', $report_timesince) : '', 2), '/', new CNumericBox('report_since_year', $report_timesince > 0 ? date('Y', $report_timesince) : '', 4), SPACE, new CNumericBox('report_since_hour', $report_timesince > 0 ? date('H', $report_timesince) : '', 2), ':', new CNumericBox('report_since_minute', $report_timesince > 0 ? date('i', $report_timesince) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_since_day","report_since_month","report_since_year","report_since_hour","report_since_minute"],' . '"avail_report_since",' . '"report_timesince");');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab->addRow(array(S_TILL, new CNumericBox('report_till_day', $report_timetill > 0 ? date('d', $report_timetill) : '', 2), '/', new CNumericBox('report_till_month', $report_timetill > 0 ? date('m', $report_timetill) : '', 2), '/', new CNumericBox('report_till_year', $report_timetill > 0 ? date('Y', $report_timetill) : '', 4), SPACE, new CNumericBox('report_till_hour', $report_timetill > 0 ? date('H', $report_timetill) : '', 2), ':', new CNumericBox('report_till_minute', $report_timetill > 0 ? date('i', $report_timetill) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_till_day","report_till_month","report_till_year","report_till_hour","report_till_minute"],' . '"avail_report_till",' . '"report_timetill");');
    $frmPd->addRow(S_PERIOD, $reporttimetab);
    //*/
    if ($config != 1) {
        $frmPd->addRow(S_COLOR, new CColor('color', $color));
    } else {
        $frmPd->addVar('color', $color);
    }
    $frmPd->addItemToBottomRow(new CButton('save', isset($_REQUEST['period_id']) ? S_UPDATE : S_ADD));
    $frmPd->addItemToBottomRow(new CButtonCancel(null, 'close_window();'));
    $frmPd->Show();
}
include_once 'include/page_footer.php';
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_period.php

示例6: CTextBox

                    $usr_test->addItem($db_user['alias'], $db_user['alias']);
                }
            }
        } else {
            $usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
        }
        $frmAuth->addRow(S_LOGIN, $usr_test);
        $frmAuth->addRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
        $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
        $frmAuth->addItemToBottomRow(new CButton('test', S_TEST));
        $frmAuth->Show();
    } else {
        if (ZBX_AUTH_HTTP == $_REQUEST['config']) {
            $form_refresh_http = get_request('form_refresh_http', 0);
            $form_refresh_http++;
            $frmAuth = new CFormTable(S_HTTP_AUTH, 'authentication.php');
            $frmAuth->SetHelp('web.authentication.php');
            $frmAuth->addVar('form_refresh_http', $form_refresh_http);
            $cmbConfig = new CCombobox('config', ZBX_AUTH_HTTP, 'submit()');
            $cmbConfig->addItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
            $cmbConfig->addItem(ZBX_AUTH_LDAP, S_LDAP);
            $cmbConfig->addItem(ZBX_AUTH_HTTP, S_HTTP);
            $frmAuth->addRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
            $action = "javascript: if(confirm('" . S_SWITCHING_HTTP . "')) return true; else return false;";
            $frmAuth->addRow(S_HTTP_AUTH . SPACE . S_ENABLED, new CCheckBox('authentication_type', ZBX_AUTH_HTTP == $config['authentication_type'], $action, ZBX_AUTH_HTTP));
            $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
            $frmAuth->Show();
        }
    }
}
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:authentication.php

示例7: CCombobox

        $host_groups->addItem($group['groupid'], $group['name']);
    }
    $frmScr->addRow(S_HOST_GROUPS, $host_groups);
    $select_acc = new CCombobox('access', $access);
    $select_acc->addItem(PERM_READ_ONLY, S_READ);
    $select_acc->addItem(PERM_READ_WRITE, S_WRITE);
    $frmScr->addRow(S_REQUIRED_HOST . SPACE . S_PERMISSIONS_SMALL, $select_acc);
    $frmScr->addItemToBottomRow(new CButton('save', S_SAVE, "javascript: document.getElementById('scripts').action+='?action=1'; "));
    $frmScr->addItemToBottomRow(SPACE);
    if (isset($_REQUEST['scriptid'])) {
        $deleteButton = new CButtonDelete(S_DELETE_SCRIPTS_Q, '&action=1&scriptid=' . $_REQUEST['scriptid']);
        $frmScr->addItemToBottomRow($deleteButton);
        $frmScr->addItemToBottomRow(SPACE);
    }
    $frmScr->addItemToBottomRow(new CButtonCancel());
    $frmScr->Show();
} else {
    validate_sort_and_sortorder('s.name', ZBX_SORT_UP);
    $form = new CForm();
    $form->setName('scripts');
    $form->setAttribute('id', 'scripts');
    $form->addVar('action', '1');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
    $header = get_table_header(array(S_SCRIPTS, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
    show_table_header($header);
    $table = new CTableInfo(S_NO_SCRIPTS_DEFINED);
    $table->setHeader(array(new CCheckBox('all_scripts', null, "checkAll('" . $form->getName() . "','all_scripts','scripts');"), make_sorting_link(S_NAME, 's.name'), make_sorting_link(S_COMMAND, 's.command'), S_USER_GROUP, S_HOST_GROUP, S_HOST_ACCESS));
    $sql = 'SELECT s.* ' . ' FROM scripts s ' . ' WHERE ' . DBin_node('s.scriptid') . order_by('s.name,s.command');
    $scripts = DBselect($sql);
    while ($script = DBfetch($scripts)) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:scripts.php

示例8: insert_command_result_form

function insert_command_result_form($scriptid, $hostid)
{
    $result = execute_script($scriptid, $hostid);
    $script_info = DBfetch(DBselect("SELECT name FROM scripts WHERE scriptid={$scriptid}"));
    $frmResult = new CFormTable($script_info["name"] . ': ' . script_make_command($scriptid, $hostid));
    $message = $result["message"];
    if ($result["flag"] != 0) {
        error($message);
        $message = "";
    }
    $frmResult->addRow(S_RESULT, new CTextArea("message", $message, 100, 25, 'yes'));
    $frmResult->addItemToBottomRow(new CButton('close', S_CLOSE, 'window.close();'));
    $frmResult->Show();
}
开发者ID:rennhak,项目名称:zabbix,代码行数:14,代码来源:forms.inc.php

示例9: array

    $frmService->AddRow(S_NEW_SERVICE_TIME, array($cmbTimeType, BR(), $time_param, new CButton('add_service_time', 'add', 'javascript: document.forms[0].action += \'?sform=1\'; submit();')));
    //trigger
    $frmService->AddRow(S_LINK_TO_TRIGGER_Q, new CCheckBox("linktrigger", $linktrigger, "javascript: display_element('trigger_name');", 1));
    if ($triggerid > 0) {
        $trigger = expand_trigger_description($triggerid);
    } else {
        $trigger = "";
    }
    $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 64, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $frmService->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
    $row->setAttribute('id', 'trigger_name');
    $row->setAttribute('style', $linktrigger == 1 ? '' : 'display: none;');
    $frmService->AddRow($row);
    $frmService->AddVar("triggerid", $triggerid);
    //---------
    //sortorder
    $frmService->AddRow(S_SORT_ORDER_0_999, new CTextBox("sortorder", $sortorder, 3));
    //---------
    $frmService->AddItemToBottomRow(new CButton("save_service", S_SAVE, 'javascript: document.forms[0].action += \'?saction=1\';'));
    if (isset($service["serviceid"])) {
        $frmService->AddItemToBottomRow(SPACE);
        $frmService->AddItemToBottomRow(new CButtonDelete("Delete selected service?", url_param("form") . url_param("serviceid") . '&saction=1'));
    }
    $frmService->AddItemToBottomRow(SPACE);
    $cb = new CButton('cancel', S_CANCEL);
    $cb->SetType('button');
    $cb->SetAction('javascript: self.close();');
    $frmService->AddItemToBottomRow($cb);
    $frmService->Show();
}
//---------------------------------------------  </FORM>  --------------------------------------------
include_once "include/page_footer.php";
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:services_form.php

示例10: CComboBox

    $cmbTimeZone = new CComboBox('timezone', $timezone);
    for ($i = -12; $i <= 13; $i++) {
        $cmbTimeZone->addItem($i, 'GMT' . sprintf('%+03d:00', $i));
    }
    $frmNode->addRow(S_TIME_ZONE, $cmbTimeZone);
    $frmNode->addRow(S_IP, new CTextBox('ip', $ip, 15));
    $frmNode->addRow(S_PORT, new CNumericBox('port', $port, 5));
    $frmNode->addRow(S_DO_NOT_KEEP_HISTORY_OLDER_THAN, new CNumericBox('slave_history', $slave_history, 6));
    $frmNode->addRow(S_DO_NOT_KEEP_TRENDS_OLDER_THAN, new CNumericBox('slave_trends', $slave_trends, 6));
    $frmNode->addItemToBottomRow(new CButton('save', S_SAVE));
    if (isset($_REQUEST['nodeid']) && $node_type != ZBX_NODE_LOCAL) {
        $frmNode->addItemToBottomRow(SPACE);
        $frmNode->addItemToBottomRow(new CButtonDelete('Delete selected node?', url_param('form') . url_param('nodeid')));
    }
    $frmNode->addItemToBottomRow(SPACE);
    $frmNode->addItemToBottomRow(new CButtonCancel(url_param('config')));
    $frmNode->Show();
} else {
    show_table_header(S_NODES_BIG);
    $table = new CTableInfo(S_NO_NODES_DEFINED);
    $table->SetHeader(array(make_sorting_link(S_ID, 'n.nodeid'), make_sorting_link(S_NAME, 'n.name'), make_sorting_link(S_TYPE, 'n.nodetype'), make_sorting_link(S_TIME_ZONE, 'n.timezone'), make_sorting_link(S_IP . ':' . S_PORT, 'n.ip')));
    $sql = 'SELECT n.* ' . ' FROM nodes n' . ' WHERE ' . DBcondition('n.nodeid', $available_nodes) . order_by('n.nodeid,n.name,n.nodetype,n.timezone,n.ip', 'n.masterid');
    $db_nodes = DBselect($sql);
    while ($row = DBfetch($db_nodes)) {
        $node_type = detect_node_type($row);
        $node_type_name = node_type2str($node_type);
        $table->AddRow(array($row['nodeid'], array(get_node_path($row['masterid']), new CLink($row['nodetype'] ? new CSpan($row['name'], 'bold') : $row['name'], '?&form=update&nodeid=' . $row['nodeid'], 'action')), $node_type == ZBX_NODE_LOCAL ? new CSpan($node_type_name, 'bold') : $node_type_name, new CSpan('GMT' . sprintf('%+03d:00', $row['timezone']), $row['nodetype'] ? 'bold' : null), new CSpan($row['ip'] . ':' . $row['port'], $row['nodetype'] ? 'bold' : null)));
    }
    $table->Show();
}
include_once 'include/page_footer.php';
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:nodes.php

示例11: CButton

        }
        $frmLcls->addItemToBottomRow(new CButton('prev', '<< ' . S_PREVIOUS));
        $frmLcls->addItemToBottomRow(SPACE);
        $frmLcls->addItemToBottomRow(new CButton('download', S_DOWNLOAD));
        $frmLcls->Show();
    } else {
        show_table_header(S_LOCALES);
        echo SBR;
        $frmLcls = new CFormTable(S_CREATE . SPACE . S_LOCALE_SMALL, 'locales.php', 'post', null, 'form');
        $frmLcls->addOption('id', 'locales');
        $cmbLang = new CComboBox('srclang', get_request('srclang', 'en_gb'));
        foreach ($ZBX_LOCALES as $id => $name) {
            $cmbLang->addItem($id, $name);
        }
        $frmLcls->addRow('Take for default locale', $cmbLang);
        $cmbExtLang = new CComboBox('extlang', get_request('extlang', 'new'));
        $cmbExtLang->addItem('new', S_CREATE . SPACE . S_NEW_SMALL);
        foreach ($ZBX_LOCALES as $id => $name) {
            $cmbExtLang->addItem($id, $name);
        }
        $frmLcls->addRow('Locale to extend', $cmbExtLang);
        $cmbFill = new CComboBox('fill', get_request('fill', 1));
        $cmbFill->addItem('0', S_DO_NOT_ADD);
        $cmbFill->addItem('1', S_LEAVE_EMPTY);
        $cmbFill->addItem('2', S_FILL_WITH_DEFAULT_VALUE);
        $frmLcls->addRow('New entries', $cmbFill);
        $frmLcls->addItemToBottomRow(new CButton('next', S_NEXT . ' >>'));
        $frmLcls->Show();
    }
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:locales.php

示例12: CButton

         array_push($valuemap_el, S_NO_MAPPING_DEFINED);
         $saveButton->setAttribute('disabled', 'true');
     } else {
         array_push($valuemap_el, new CButton('del_map', S_DELETE_SELECTED));
     }
     $frmValmap->addRow(S_MAPPING, $valuemap_el);
     $frmValmap->addRow(S_NEW_MAPPING, array(new CTextBox("add_value", "", 10), new CSpan(RARR, "rarr"), new CTextBox("add_newvalue", "", 10), SPACE, new CButton("add_map", S_ADD)), 'new');
     $frmValmap->addItemToBottomRow($saveButton);
     if (isset($_REQUEST["valuemapid"])) {
         $frmValmap->addItemToBottomRow(SPACE);
         $frmValmap->addItemToBottomRow(new CButtonDelete("Delete selected value mapping?", url_param("form") . url_param("valuemapid") . url_param("config")));
     } else {
     }
     $frmValmap->addItemToBottomRow(SPACE);
     $frmValmap->addItemToBottomRow(new CButtonCancel(url_param("config")));
     $frmValmap->Show();
 } else {
     show_table_header(S_VALUE_MAPPING_BIG);
     $table = new CTableInfo();
     $table->SetHeader(array(S_NAME, S_VALUE_MAP));
     $db_valuemaps = DBselect('SELECT * FROM valuemaps WHERE ' . DBin_node('valuemapid'));
     while ($db_valuemap = DBfetch($db_valuemaps)) {
         $mappings_row = array();
         $db_maps = DBselect('SELECT * FROM mappings' . ' WHERE valuemapid=' . $db_valuemap['valuemapid']);
         while ($db_map = DBfetch($db_maps)) {
             array_push($mappings_row, $db_map['value'], SPACE . RARR . SPACE, $db_map['newvalue'], BR());
         }
         $table->AddRow(array(new CLink($db_valuemap['name'], 'config.php?form=update&' . 'valuemapid=' . $db_valuemap['valuemapid'] . url_param('config'), 'action'), empty($mappings_row) ? SPACE : $mappings_row));
     }
     $table->Show();
 }
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:config.php


注:本文中的CFormTable::Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。