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


PHP CFormTable::addAction方法代码示例

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


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

示例1: CButton

}
$next_page = new CButton('next_page', S_NEXT . ' »');
if ($count < $limit) {
    $next_page->setAttribute('disabled', 'disabled');
}
//*/
$navForm->addItem(array($prev_page, SPACE, $next_page));
$navigation = $navForm;
//------------
/************************* FILTER **************************/
/***********************************************************/
$filterForm = new CFormTable();
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$script = new CScript("javascript: if(CLNDR['audit_since'].clndr.setSDateFromOuterObj()){" . "\$('nav_time').value = parseInt(CLNDR['audit_since'].clndr.sdt.getTime()/1000);}");
$filterForm->addAction('onsubmit', $script);
$filterForm->addVar('nav_time', $_REQUEST['nav_time'] > 0 ? $_REQUEST['nav_time'] : '');
$filterForm->addVar('config', $_REQUEST['config']);
$filterForm->addVar('userid', $_REQUEST['userid']);
if (isset($_REQUEST['userid']) && $_REQUEST['userid'] > 0) {
    $user = get_user_by_userid($_REQUEST['userid']);
} else {
    $user['alias'] = '';
}
$row = new CRow(array(new CCol($config == 1 ? S_RECIPIENT : S_USER, 'form_row_l'), new CCol(array(new CTextBox("user", $user['alias'], 32, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=userid&dstfld2=user" . "&srctbl=users&srcfld1=userid&srcfld2=alias&real_hosts=1');", 'T')), 'form_row_r')));
$filterForm->addRow($row);
if ($config == 0) {
    $cmbAction = new CComboBox('action', $_REQUEST['action']);
    $cmbAction->addItem(-1, S_ALL_S);
    $cmbAction->addItem(AUDIT_ACTION_LOGIN, S_LOGIN);
    $cmbAction->addItem(AUDIT_ACTION_LOGOUT, S_LOGOUT);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:audit.php

示例2: get_item_filter_form

function get_item_filter_form()
{
    $selection_mode = $_REQUEST['selection_mode'];
    $filter_node = $_REQUEST['filter_node'];
    $filter_group = $_REQUEST['filter_group'];
    $filter_host = $_REQUEST['filter_host'];
    $filter_application = $_REQUEST['filter_application'];
    $filter_description = $_REQUEST['filter_description'];
    $filter_type = $_REQUEST['filter_type'];
    $filter_key = $_REQUEST['filter_key'];
    $filter_snmp_community = $_REQUEST['filter_snmp_community'];
    $filter_snmp_oid = $_REQUEST['filter_snmp_oid'];
    $filter_snmp_port = $_REQUEST['filter_snmp_port'];
    $filter_snmpv3_securityname = $_REQUEST['filter_snmpv3_securityname'];
    $filter_snmpv3_securitylevel = $_REQUEST['filter_snmpv3_securitylevel'];
    $filter_snmpv3_authpassphrase = $_REQUEST['filter_snmpv3_authpassphrase'];
    $filter_snmpv3_privpassphrase = $_REQUEST['filter_snmpv3_privpassphrase'];
    $filter_value_type = $_REQUEST['filter_value_type'];
    $filter_data_type = $_REQUEST['filter_data_type'];
    $filter_units = $_REQUEST['filter_units'];
    $filter_formula = $_REQUEST['filter_formula'];
    $filter_delay = $_REQUEST['filter_delay'];
    $filter_history = $_REQUEST['filter_history'];
    $filter_trends = $_REQUEST['filter_trends'];
    $filter_status = $_REQUEST['filter_status'];
    $filter_logtimefmt = $_REQUEST['filter_logtimefmt'];
    $filter_delta = $_REQUEST['filter_delta'];
    $filter_trapper_hosts = $_REQUEST['filter_trapper_hosts'];
    $form = new CFormTable(S_ITEM . ' ' . S_FILTER);
    $form->addOption('name', 'zbx_filter');
    $form->addOption('id', 'zbx_filter');
    $form->SetMethod('get');
    $form->addAction('onsubmit', "javascript: if(empty_form(this)) return Confirm('Filter is empty! All items will be selected. Proceed?');");
    $form->addVar('filter_hostid', get_request('filter_hostid', get_request('hostid')));
    $form->addVar('selection_mode', $selection_mode);
    $modeLink = new CSpan($selection_mode == 0 ? S_ADVANCED : S_SIMPLE, 'link');
    $modeLink->addAction('onclick', "javascript: create_var('" . $form->GetName() . "','selection_mode'," . ($selection_mode == 0 ? 1 : 0) . ',true);');
    $form->addRow(S_SELECTION_MODE, $modeLink);
    if (ZBX_DISTRIBUTED && $selection_mode) {
        $form->addRow(array('from ', bold(S_NODE), ' like'), array(new CTextBox('filter_node', $filter_node, 32), new CButton('btn_node', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_node&srctbl=nodes&srcfld1=name',450,450);", "G")));
    }
    if ($selection_mode) {
        $form->addRow(array('from ', bold(S_HOST_GROUP), ' like'), array(new CTextBox('filter_group', $filter_group, 32), new CButton("btn_group", S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_group&srctbl=host_group&srcfld1=name',450,450);", "G")));
    }
    $form->addRow(array('from ', bold(S_HOST), ' like'), array(new CTextBox('filter_host', $filter_host, 32), new CButton("btn_host", S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=filter_host&dstfld2=filter_hostid&srctbl=hosts&srcfld1=host&srcfld2=hostid',450,450);", 'H')));
    if ($selection_mode) {
        $form->addRow(array('from ', bold(S_APPLICATION), ' like'), array(new CTextBox('filter_application', $filter_application, 32), new CButton('btn_app', S_SELECT, 'return PopUp("popup.php?dstfrm=' . $form->GetName() . '&dstfld1=filter_application&srctbl=applications' . '&srcfld1=name",400,300,"application");', 'A')));
    }
    $form->addRow(array('with ', bold(S_DESCRIPTION), ' like'), new CTextBox("filter_description", $filter_description, 40));
    if ($selection_mode) {
        $cmbType = new CComboBox("filter_type", $filter_type, "submit()");
        $cmbType->addItem(-1, S_ALL_SMALL);
        foreach (array(ITEM_TYPE_ZABBIX, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_SIMPLE, ITEM_TYPE_SNMPV1, ITEM_TYPE_SNMPV2C, ITEM_TYPE_SNMPV3, ITEM_TYPE_TRAPPER, ITEM_TYPE_INTERNAL, ITEM_TYPE_AGGREGATE, ITEM_TYPE_HTTPTEST, ITEM_TYPE_DB_MONITOR, ITEM_TYPE_IPMI) as $it) {
            $cmbType->addItem($it, item_type2str($it));
        }
        $form->addRow(array('with ', bold(S_TYPE)), $cmbType);
    }
    $form->addRow(array('with ', bold(S_KEY), ' like'), array(new CTextBox("filter_key", $filter_key, 40)));
    if ($selection_mode) {
        if ($filter_type == ITEM_TYPE_SNMPV1 || $filter_type == ITEM_TYPE_SNMPV2C || $filter_type == ITEM_TYPE_SNMPV3) {
            $form->addRow(array('with ', bold(S_SNMP_COMMUNITY), ' like'), new CTextBox("filter_snmp_community", $filter_snmp_community, 16));
            $form->addRow(array('with ', bold(S_SNMP_OID), ' like'), new CTextBox("filter_snmp_oid", $filter_snmp_oid, 40));
            $form->addRow(array('with ', bold(S_SNMP_PORT), ' like'), new CNumericBox("filter_snmp_port", $filter_snmp_port, 5, null, true));
        }
        if ($filter_type == ITEM_TYPE_SNMPV3) {
            $form->addRow(array('with ', bold(S_SNMPV3_SECURITY_NAME), ' like'), new CTextBox("filter_snmpv3_securityname", $filter_snmpv3_securityname, 64));
            $cmbSecLevel = new CComboBox("filter_snmpv3_securitylevel", $filter_snmpv3_securitylevel);
            $cmbSecLevel->addItem(-1, S_ALL_SMALL);
            $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV, "NoAuthPriv");
            $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, "AuthNoPriv");
            $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, "AuthPriv");
            $form->addRow(array('with ', bold(S_SNMPV3_SECURITY_LEVEL)), $cmbSecLevel);
            $form->addRow(array('with ', bold(S_SNMPV3_AUTH_PASSPHRASE), ' like'), new CTextBox("filter_snmpv3_authpassphrase", $filter_snmpv3_authpassphrase, 64));
            $form->addRow(array('with ', bold(S_SNMPV3_PRIV_PASSPHRASE), ' like'), new CTextBox("filter_snmpv3_privpassphrase", $filter_snmpv3_privpassphrase, 64));
        }
        $cmbValType = new CComboBox("filter_value_type", $filter_value_type, "submit()");
        $cmbValType->AddItem(-1, S_ALL_SMALL);
        $cmbValType->AddItem(ITEM_VALUE_TYPE_UINT64, S_NUMERIC_UNSIGNED);
        $cmbValType->AddItem(ITEM_VALUE_TYPE_FLOAT, S_NUMERIC_FLOAT);
        $cmbValType->AddItem(ITEM_VALUE_TYPE_STR, S_CHARACTER);
        $cmbValType->AddItem(ITEM_VALUE_TYPE_LOG, S_LOG);
        $cmbValType->AddItem(ITEM_VALUE_TYPE_TEXT, S_TEXT);
        $form->AddRow(array('with ', bold(S_TYPE_OF_INFORMATION)), $cmbValType);
        if ($filter_value_type == ITEM_VALUE_TYPE_UINT64) {
            $cmbDataType = new CComboBox("filter_data_type", $filter_data_type, "submit()");
            $cmbDataType->addItem(-1, S_ALL_SMALL);
            $cmbDataType->addItem(ITEM_DATA_TYPE_DECIMAL, item_data_type2str(ITEM_DATA_TYPE_DECIMAL));
            $cmbDataType->addItem(ITEM_DATA_TYPE_OCTAL, item_data_type2str(ITEM_DATA_TYPE_OCTAL));
            $cmbDataType->addItem(ITEM_DATA_TYPE_HEXADECIMAL, item_data_type2str(ITEM_DATA_TYPE_HEXADECIMAL));
            $form->addRow(array('with ', bold(S_DATA_TYPE)), $cmbDataType);
        }
        if ($filter_value_type == ITEM_VALUE_TYPE_FLOAT || $filter_value_type == ITEM_VALUE_TYPE_UINT64) {
            $form->addRow(array('with ', bold(S_UNITS)), new CTextBox("filter_units", $filter_units, 40));
            $form->addRow(array('with ', bold(S_CUSTOM_MULTIPLIER), ' like'), new CTextBox("filter_formula", $filter_formula, 40));
        }
        if ($filter_type != ITEM_TYPE_TRAPPER && $filter_type != ITEM_TYPE_HTTPTEST) {
            $form->addRow(array('with ', bold(S_UPDATE_INTERVAL_IN_SEC)), new CNumericBox("filter_delay", $filter_delay, 5, null, true));
        }
        $form->addRow(array('with ', bold(S_KEEP_HISTORY_IN_DAYS)), new CNumericBox("filter_history", $filter_history, 8, null, true));
        $form->addRow(array('with ', bold(S_KEEP_TRENDS_IN_DAYS)), new CNumericBox("filter_trends", $filter_trends, 8, null, true));
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php


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