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


PHP CLink::addOption方法代码示例

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


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

示例1: foreach

    if (isset($page['scripts']) && is_array($page['scripts'])) {
        foreach ($page['scripts'] as $id => $script) {
            print '    <script type="text/javascript" src="js/' . $script . '"></script>' . "\n";
        }
    }
    ?>
</head>
<body onload="zbxCallPostScripts();">
<?php 
}
define('PAGE_HEADER_LOADED', 1);
if (isset($_REQUEST['print'])) {
    define('ZBX_PAGE_NO_MENU', 1);
    $req = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'print') - 1);
    $link = new CLink(bold('&laquo;' . S_BACK_BIG), $req, 'small_font');
    $link->addOption('style', 'padding-left: 10px;');
    $printview = new CDiv($link, 'printless');
    $printview->addOption('style', 'border: 1px #333 dotted;');
    $printview->Show();
}
if (!defined('ZBX_PAGE_NO_MENU')) {
    COpt::compare_files_with_menu($ZBX_MENU);
    $help = new CLink(S_HELP, 'http://www.zabbix.com/documentation.php', 'small_font', null, true);
    $help->setTarget('_blank');
    $support = new CLink(S_GET_SUPPORT, 'http://www.zabbix.com/support.php', 'small_font', null, true);
    $support->setTarget('_blank');
    $printview = new CLink(S_PRINT, $_SERVER['REQUEST_URI'] . (empty($_GET) ? '?' : '&') . 'print=1', 'small_font');
    $page_header_r_col = array($help, '|', $support, '|', $printview);
    if ($USER_DETAILS['alias'] != ZBX_GUEST_USER) {
        $page_header_r_col[] = array('|', new CLink(S_PROFILE, 'profile.php', 'small_font'), '|', new CLink(S_LOGOUT, 'index.php?reconnect=1', 'small_font'));
    } else {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:page_header.php

示例2: insert_mass_update_item_form

function insert_mass_update_item_form($elements_array_name)
{
    global $USER_DETAILS;
    $frmItem = new CFormTable(S_ITEM, null, 'post');
    $frmItem->SetHelp('web.items.item.php');
    $frmItem->SetTitle(S_MASS_UPDATE);
    $frmItem->addVar('form_mass_update', 1);
    $frmItem->addVar('group_itemid', get_request('group_itemid', array()));
    $frmItem->addVar('config', get_request('config', 0));
    if ($_REQUEST['groupid'] > 0) {
        $frmItem->addVar('groupid', $_REQUEST['groupid']);
    }
    $frmItem->addVar('hostid', $_REQUEST['hostid']);
    $description = get_request('description', '');
    $key = get_request('key', '');
    $host = get_request('host', null);
    $delay = get_request('delay', 30);
    $history = get_request('history', 90);
    $status = get_request('status', 0);
    $type = get_request('type', 0);
    $snmp_community = get_request('snmp_community', 'public');
    $snmp_oid = get_request('snmp_oid', 'interfaces.ifTable.ifEntry.ifInOctets.1');
    $snmp_port = get_request('snmp_port', 161);
    $value_type = get_request('value_type', ITEM_VALUE_TYPE_UINT64);
    $data_type = get_request('data_type', ITEM_DATA_TYPE_DECIMAL);
    $trapper_hosts = get_request('trapper_hosts', '');
    $units = get_request('units', '');
    $valuemapid = get_request('valuemapid', 0);
    $delta = get_request('delta', 0);
    $trends = get_request('trends', 365);
    $applications = get_request('applications', array());
    $delay_flex = get_request('delay_flex', array());
    $snmpv3_securityname = get_request('snmpv3_securityname', '');
    $snmpv3_securitylevel = get_request('snmpv3_securitylevel', 0);
    $snmpv3_authpassphrase = get_request('snmpv3_authpassphrase', '');
    $snmpv3_privpassphrase = get_request('snmpv3_privpassphrase', '');
    $formula = get_request('formula', '1');
    $logtimefmt = get_request('logtimefmt', '');
    $add_groupid = get_request('add_groupid', get_request('groupid', 0));
    $delay_flex_el = array();
    $i = 0;
    foreach ($delay_flex as $val) {
        if (!isset($val['delay']) && !isset($val['period'])) {
            continue;
        }
        array_push($delay_flex_el, array(new CCheckBox('rem_delay_flex[]', 'no', null, $i), $val['delay'], ' sec at ', $val['period']), BR());
        $frmItem->addVar("delay_flex[" . $i . "][delay]", $val['delay']);
        $frmItem->addVar("delay_flex[" . $i . "][period]", $val['period']);
        $i++;
        if ($i >= 7) {
            break;
        }
        /* limit count of  intervals
         * 7 intervals by 30 symbols = 210 characters
         * db storage field is 256
         */
    }
    if (count($delay_flex_el) == 0) {
        array_push($delay_flex_el, "No flexible intervals");
    } else {
        array_push($delay_flex_el, new CButton('del_delay_flex', 'delete selected'));
    }
    if (count($applications) == 0) {
        array_push($applications, 0);
    }
    $cmbType = new CComboBox('type', $type);
    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_AGGREGATE, ITEM_TYPE_EXTERNAL, ITEM_TYPE_DB_MONITOR) as $it) {
        $cmbType->addItem($it, item_type2str($it));
    }
    $frmItem->addRow(array(new CVisibilityBox('type_visible', get_request('type_visible'), 'type', S_ORIGINAL), S_TYPE), $cmbType);
    $frmItem->addRow(array(new CVisibilityBox('community_visible', get_request('community_visible'), 'snmp_community', S_ORIGINAL), S_SNMP_COMMUNITY), new CTextBox('snmp_community', $snmp_community, 16));
    $frmItem->addRow(array(new CVisibilityBox('securityname_visible', get_request('securityname_visible'), 'snmpv3_securityname', S_ORIGINAL), S_SNMPV3_SECURITY_NAME), new CTextBox('snmpv3_securityname', $snmpv3_securityname, 64));
    $cmbSecLevel = new CComboBox('snmpv3_securitylevel', $snmpv3_securitylevel);
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV, "NoAuthPriv");
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, "AuthNoPriv");
    $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, "AuthPriv");
    $frmItem->addRow(array(new CVisibilityBox('securitylevel_visible', get_request('securitylevel_visible'), 'snmpv3_securitylevel', S_ORIGINAL), S_SNMPV3_SECURITY_LEVEL), $cmbSecLevel);
    $frmItem->addRow(array(new CVisibilityBox('authpassphrase_visible', get_request('authpassphrase_visible'), 'snmpv3_authpassphrase', S_ORIGINAL), S_SNMPV3_AUTH_PASSPHRASE), new CTextBox('snmpv3_authpassphrase', $snmpv3_authpassphrase, 64));
    $frmItem->addRow(array(new CVisibilityBox('privpassphras_visible', get_request('privpassphras_visible'), 'snmpv3_privpassphrase', S_ORIGINAL), S_SNMPV3_PRIV_PASSPHRASE), new CTextBox('snmpv3_privpassphrase', $snmpv3_privpassphrase, 64));
    $frmItem->addRow(array(new CVisibilityBox('port_visible', get_request('port_visible'), 'snmp_port', S_ORIGINAL), S_SNMP_PORT), new CNumericBox('snmp_port', $snmp_port, 5));
    $cmbValType = new CComboBox('value_type', $value_type);
    $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);
    $frmItem->AddRow(array(new CVisibilityBox('value_type_visible', get_request('value_type_visible'), 'value_type', S_ORIGINAL), S_TYPE_OF_INFORMATION), $cmbValType);
    $cmbDataType = new CComboBox('data_type', $data_type);
    $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));
    $frmItem->addRow(array(new CVisibilityBox('data_type_visible', get_request('data_type_visible'), 'data_type', S_ORIGINAL), S_DATA_TYPE), $cmbDataType);
    $frmItem->addRow(array(new CVisibilityBox('units_visible', get_request('units_visible'), 'units', S_ORIGINAL), S_UNITS), new CTextBox('units', $units, 40));
    $frmItem->addRow(array(new CVisibilityBox('formula_visible', get_request('formula_visible'), 'formula', S_ORIGINAL), S_CUSTOM_MULTIPLIER . ' (0 - ' . S_DISABLED . ')'), new CTextBox('formula', $formula, 40));
    $frmItem->addRow(array(new CVisibilityBox('delay_visible', get_request('delay_visible'), 'delay', S_ORIGINAL), S_UPDATE_INTERVAL_IN_SEC), new CNumericBox('delay', $delay, 5));
    $delay_flex_el = new CSpan($delay_flex_el);
    $delay_flex_el->addOption('id', 'delay_flex_list');
    $frmItem->addRow(array(new CVisibilityBox('delay_flex_visible', get_request('delay_flex_visible'), array('delay_flex_list', 'new_delay_flex_el'), S_ORIGINAL), S_FLEXIBLE_INTERVALS), $delay_flex_el);
    $new_delay_flex_el = new CSpan(array(S_DELAY, SPACE, new CNumericBox("new_delay_flex[delay]", "50", 5), S_PERIOD, SPACE, new CTextBox("new_delay_flex[period]", "1-7,00:00-23:59", 27), BR(), new CButton("add_delay_flex", S_ADD)));
    $new_delay_flex_el->addOption('id', 'new_delay_flex_el');
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例3: DBselect

 $dep_res = DBselect($sql_dep);
 while ($dep_row = DBfetch($dep_res)) {
     $dep_table->addRow(SPACE . '-' . SPACE . expand_trigger_description($dep_row['triggerid_down']));
     $dependency = true;
 }
 if ($dependency) {
     $img = new Cimg('images/general/up_icon.png', 'DEP_UP');
     $img->addOption('style', 'vertical-align: middle; border: 0px;');
     $img->SetHint($dep_table);
     $description = array($img, SPACE, $description);
 }
 unset($img, $dep_table, $dependency);
 //------------------------
 if (time(NULL) - $row['lastchange'] < TRIGGER_BLINK_PERIOD) {
     $tr_status = new CLink(trigger_value2str($row['value']));
     $tr_status->addOption('name', 'blink');
 } else {
     $tr_status = trigger_value2str($row['value']);
 }
 $value = new CSpan($tr_status, get_trigger_value_style($row['value']));
 if ($_REQUEST['show_actions']) {
     $actions = array(new CLink(S_CHANGE, 'triggers.php?form=update&triggerid=' . $row['triggerid'] . url_param('hostid'), 'action'));
 } else {
     $actions = NULL;
 }
 // JS menu
 $host = null;
 if ($_REQUEST['hostid'] < 1) {
     $menus = '';
     $host_nodeid = id2nodeid($row['hostid']);
     foreach ($scripts_by_hosts[$row['hostid']] as $id => $script) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:tr_status.php


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