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


PHP CButton::setAttribute方法代码示例

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


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

示例1: get

 public function get($caption_l = null, $caption_r = null)
 {
     if (empty($caption_l)) {
         $caption_l = _('In');
     }
     if (empty($caption_r)) {
         $caption_r = _('Other');
     }
     $grp_tab = new CTable();
     $grp_tab->attr('name', $this->name);
     $grp_tab->attr('id', zbx_formatDomId($this->name));
     $grp_tab->setCellSpacing(0);
     $grp_tab->setCellPadding(0);
     if (!is_null($caption_l) || !is_null($caption_r)) {
         $grp_tab->addRow(array($caption_l, SPACE, $caption_r));
     }
     $add_btn = new CButton('add', ' « ', null, 'formlist');
     $add_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_r . '", "' . $this->id_l . '", "add");');
     $rmv_btn = new CButton('remove', ' » ', null, 'formlist');
     $rmv_btn->setAttribute('onclick', 'javascript: moveListBoxSelectedItem("' . $this->form->getName() . '", "' . $this->varname . '", "' . $this->id_l . '", "' . $this->id_r . '", "rmv");');
     $grp_tab->addRow(array($this->lbox, new CCol(array($add_btn, BR(), $rmv_btn), 'top'), $this->rbox));
     return $grp_tab;
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:23,代码来源:class.ctweenbox.php

示例2: CRow

            $row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ack_cb_col : null, $status, $clock, zbx_date2age($row_event['clock']), zbx_date2age($next_clock, $row_event['clock']), $config['event_ack_enable'] ? $ack : NULL, is_show_all_nodes() ? SPACE : null, $empty_col), 'odd_row');
            $row->setAttribute('data-parentid', $trigger['triggerid']);
            $row->addStyle('display: none;');
            $table->addRow($row);
            if ($i > $config['event_show_max']) {
                break;
            }
        }
    }
}
//----- GO ------
$footer = null;
if ($config['event_ack_enable']) {
    $goBox = new CComboBox('go');
    $goBox->addItem('bulkacknowledge', S_BULK_ACKNOWLEDGE);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    $show_event_col ? zbx_add_post_js('chkbxRange.pageGoName = "events";') : zbx_add_post_js('chkbxRange.pageGoName = "triggers";');
    $footer = get_table_header(array($goBox, $goButton));
}
//----
$table = array($paging, $table, $paging, $footer);
$m_form->addItem($table);
$trigg_wdgt->addItem($m_form);
$trigg_wdgt->show();
zbx_add_post_js('blink.init();');
zbx_add_post_js("var switcher = new CSwitcher('{$switcherName}');");
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php

示例3: CCol

$slideTable->setAttribute('style', 'min-width: 500px;');
$slideTable->setAttribute('id', 'slideTable');
$slideTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), new CCol(_('Screen'), null, null, '140'), new CCol(_('Delay'), null, null, '70'), new CCol(_('Action'), null, null, '50')));
$i = 1;
foreach ($this->data['slides'] as $step => $slides) {
    $name = '';
    if (!empty($slides['screenid'])) {
        $screen = get_screen_by_screenid($slides['screenid']);
        if (!empty($screen['name'])) {
            $name = $screen['name'];
        }
    }
    $delay = new CNumericBox('slides[' . $step . '][delay]', !empty($slides['delay']) ? $slides['delay'] : '', 5, 'no', true, false);
    $delay->setAttribute('placeholder', _('default'));
    $removeButton = new CButton('remove_' . $step, _('Remove'), 'javascript: removeSlide(this);', 'link_menu');
    $removeButton->setAttribute('remove_slide', $step);
    $row = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), new CSpan($i++ . ':', 'rowNum', 'current_slide_' . $step), $name, $delay, $removeButton), 'sortable', 'slides_' . $step);
    $slideTable->addRow($row);
}
$addButtonColumn = new CCol(empty($this->data['work_slide']) ? new CButton('add', _('Add'), 'return PopUp("popup.php?srctbl=screens&srcfld1=screenid&dstfrm=' . $slideForm->getName() . '&multiselect=1", 450, 450)', 'link_menu') : null, null, 5);
$addButtonColumn->setAttribute('style', 'vertical-align: middle;');
$slideTable->addRow(new CRow($addButtonColumn, null, 'screenListFooter'));
$slideFormList->addRow(_('Slides'), new CDiv($slideTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$slideTab = new CTabView();
$slideTab->addTab('slideTab', _('Slide'), $slideFormList);
$slideForm->addItem($slideTab);
// append buttons to form
if (empty($this->data['slideshowid'])) {
    $slideForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButtonCancel()));
} else {
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:configuration.slideconf.edit.php

示例4: CDiv

	$prev_page = new CDiv(SPACE,'arrowleft');
	$prev_page->setAttribute('title','Previous page');
	$prev_page->addAction('onclick',new CScript("javascript: alert('left');"));

	$next_page = new CDiv(SPACE,'arrowright');
	$next_page->setAttribute('title','Next page');
	$next_page->addAction('onclick',new CScript("javascript: alert('right');"));
//*/
//*
$prev_page = new CButton('prev_page', '« ' . S_BACK);
if (empty($prev_clock)) {
    $prev_page->setAttribute('disabled', 'disabled');
}
$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']);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:audit.php

示例5: CSpan

    $numSpan->addClass('rowNum');
    $numSpan->setAttribute('id', 'current_step_' . $stepid);
    $name = new CSpan($step['name'], 'link');
    $name->setAttributes(array('id' => 'name_' . $stepid, 'name_step' => $stepid));
    if (zbx_strlen($step['url']) > 70) {
        $url = new CSpan(substr($step['url'], 0, 35) . SPACE . '...' . SPACE . substr($step['url'], zbx_strlen($step['url']) - 25, 25));
        $url->setHint($step['url']);
    } else {
        $url = $step['url'];
    }
    if ($this->data['templated']) {
        $removeButton = SPACE;
        $dragHandler = SPACE;
    } else {
        $removeButton = new CButton('remove_' . $stepid, _('Remove'), 'javascript: removeStep(this);', 'link_menu');
        $removeButton->setAttribute('remove_step', $stepid);
        $dragHandler = new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move');
    }
    $row = new CRow(array($dragHandler, $numSpan, $name, $step['timeout'] . SPACE . _('sec'), $url, htmlspecialchars($step['required']), $step['status_codes'], $removeButton), 'sortable', 'steps_' . $stepid);
    $stepsTable->addRow($row);
}
if (!$this->data['templated']) {
    $stepsTable->addRow(new CCol(new CButton('add_step', _('Add'), null, 'link_menu'), null, 8));
}
$httpStepFormList->addRow(_('Steps'), new CDiv($stepsTable, 'objectgroup inlineblock border_dotted ui-corner-all'));
// append tabs to form
$httpTab = new CTabView();
if (!$this->data['form_refresh']) {
    $httpTab->setSelected(0);
}
$httpTab->addTab('scenarioTab', _('Scenario'), $httpFormList);
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.httpconf.edit.php

示例6: CComboBox

 $frmTRLog->addVar('itemid', $itemid);
 $exp_select = new CComboBox('expr_type');
 $exp_select->setAttribute('id', 'expr_type');
 $exp_select->addItem(REGEXP_INCLUDE, S_INCLUDE_S);
 $exp_select->addItem(REGEXP_EXCLUDE, S_EXCLUDE);
 $ctb = new CTextBox('expression', '', 80);
 $ctb->setAttribute('id', 'logexpr');
 $cb = new CButton('add_exp', S_ADD, 'javascript: add_logexpr();');
 $cb->setType('button');
 $cb->setAttribute('id', 'add_exp');
 $cbAdd = new CButton('add_key_and', S_AND_BIG, 'javascript: add_keyword_and();');
 $cbAdd->setType('button');
 $cbAdd->setAttribute('id', 'add_key_and');
 $cbOr = new CButton('add_key_or', S_OR_BIG, 'javascript: add_keyword_or();');
 $cbOr->setType('button');
 $cbOr->setAttribute('id', 'add_key_or');
 $cbIregexp = new CCheckBox('iregexp', 'no', null, 1);
 $cbIregexp->setAttribute('id', 'iregexp');
 $frmTRLog->addRow(S_EXPRESSION, array($ctb, BR(), $cbIregexp, 'iregexp', SPACE, $cbAdd, SPACE, $cbOr, SPACE, $exp_select, SPACE, $cb));
 $keyTable = new CTableInfo(null);
 $keyTable->setAttribute('id', 'key_list');
 $keyTable->setHeader(array(S_KEYWORD, S_TYPE, S_ACTION));
 $table = new CTableInfo(null);
 $table->setAttribute('id', 'exp_list');
 $table->setHeader(array(S_EXPRESSION, S_TYPE, S_POSITION, S_ACTION));
 $maxid = 0;
 $bExprResult = true;
 $exprData = new CTriggerExpression(array('expression' => empty($expressions) ? '' : construct_expression($itemid, $expressions)));
 if (isset($_REQUEST['triggerid']) && !isset($_REQUEST['save_trigger']) && !empty($exprData->errors) && !isset($_REQUEST['form_refresh'])) {
     info($exprData->errors);
     unset($expressions);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_logform.php

示例7: make_operation_box_footer

function make_operation_box_footer($hostids, $form_name)
{
    $box = new CComboBox("script");
    $hostScripts = API::Script()->getScriptsByHosts($hostids);
    $scripts = array();
    foreach ($hostScripts as $hostid => $hscripts) {
        foreach ($hscripts as $script) {
            if (!in_array($script, $scripts) && check_script($form_name, $script['name'])) {
                array_push($scripts, $script);
            }
        }
    }
    foreach ($scripts as $script) {
        $option = new CComboItem($script['scriptid'], $script['name']);
        $box->addItem($option);
    }
    $button = new CButton('execute', _('Execute'), "return executeScriptOnMultipleHosts('{$form_name}', 'script', 'hostids[]', 'Execute');");
    $button->setAttribute('id', 'executeButton');
    return array($box, $button);
}
开发者ID:sogaoh,项目名称:hyclops,代码行数:20,代码来源:additional_blocks_func.inc.php

示例8: CCol

$slideTable->setAttribute('style', 'min-width: 312px;');
$slideTable->setAttribute('id', 'slideTable');
$slideTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), _('Screen'), new CCol(_('Delay'), null, null, '70'), new CCol(_('Action'), null, null, '50')));
$i = 1;
foreach ($this->data['slides'] as $key => $slides) {
    $name = '';
    if (!empty($slides['screenid'])) {
        $screen = get_screen_by_screenid($slides['screenid']);
        if ($screen) {
            $name = $screen['name'];
        }
    }
    $delay = new CNumericBox('slides[' . $key . '][delay]', !empty($slides['delay']) ? $slides['delay'] : '', 5, false, true, false);
    $delay->setAttribute('placeholder', _('default'));
    $removeButton = new CButton('remove_' . $key, _('Remove'), 'javascript: removeSlide(this);', 'link_menu');
    $removeButton->setAttribute('remove_slide', $key);
    $row = new CRow(array(new CSpan(null, 'ui-icon ui-icon-arrowthick-2-n-s move'), new CSpan($i++ . ':', 'rowNum', 'current_slide_' . $key), $name, $delay, $removeButton), 'sortable', 'slides_' . $key);
    $slideTable->addRow($row);
}
$addButtonColumn = new CCol(empty($this->data['work_slide']) ? new CButton('add', _('Add'), 'return PopUp("popup.php?srctbl=screens&srcfld1=screenid&dstfrm=' . $slideForm->getName() . '&multiselect=1&writeonly=1", 450, 450)', 'link_menu') : null, null, 5);
$addButtonColumn->setAttribute('style', 'vertical-align: middle;');
$slideTable->addRow(new CRow($addButtonColumn, null, 'screenListFooter'));
$slideFormList->addRow(_('Slides'), new CDiv($slideTable, 'objectgroup inlineblock border_dotted'));
// append tabs to form
$slideTab = new CTabView();
$slideTab->addTab('slideTab', _('Slide'), $slideFormList);
$slideForm->addItem($slideTab);
// append buttons to form
if (isset($this->data['slideshowid'])) {
    $slideForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete slide show?'), url_params(array('form', 'slideshowid'))), new CButtonCancel())));
} else {
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.slideconf.edit.php

示例9: CRow

                    if (gettype($e['list'][$i]) == 'object' && get_class($e['list'][$i]) == 'CSpan' && $e['list'][$i]->getAttribute('class') == 'link') {
                        $e['list'][$i]->removeAttribute('class');
                        $e['list'][$i]->setAttribute('onclick', '');
                    }
                }
            }
            $row = new CRow(array($triggerCheckbox, $e['list'], $errorColumn, isset($deleteUrl) ? $deleteUrl : null));
            $expressionTable->addRow($row);
        }
    } else {
        $allowedTesting = false;
        $this->data['outline'] = '';
    }
    $testButton = new CButton('test_expression', _('Test'), 'openWinCentered("tr_testexpr.php?expression=" + encodeURIComponent(this.form.elements["expression"].value),' . '"ExpressionTest", 850, 400, "titlebar=no, resizable=yes, scrollbars=yes"); return false;', 'link_menu');
    if (!$allowedTesting) {
        $testButton->setAttribute('disabled', 'disabled');
    }
    if (empty($this->data['outline'])) {
        $testButton->setAttribute('disabled', 'disabled');
    }
    $wrapOutline = new CSpan(array($this->data['outline']));
    $triggersFormList->addRow(SPACE, array($wrapOutline, BR(), BR(), new CDiv(array($expressionTable, $testButton), 'objectgroup inlineblock border_dotted ui-corner-all')));
    $inputMethodToggle = new CSpan(_('Close expression constructor'), 'link');
    $inputMethodToggle->setAttribute('onclick', 'javascript: ' . 'document.getElementById("toggle_input_method").value=1;' . 'document.getElementById("input_method").value=' . IM_ESTABLISHED . ';' . 'document.forms["' . $triggersForm->getName() . '"].submit();');
    $triggersFormList->addRow(SPACE, array($inputMethodToggle, BR()));
}
$triggersFormList->addRow(_('Multiple PROBLEM events generation'), new CCheckBox('type', $this->data['type'] == TRIGGER_MULT_EVENT_ENABLED ? 'yes' : 'no', null, 1));
$triggersFormList->addRow(_('Description'), new CTextArea('comments', $this->data['comments']));
$triggersFormList->addRow(_('URL'), new CTextBox('url', $this->data['url'], ZBX_TEXTBOX_STANDARD_SIZE));
$triggersFormList->addRow(_('Severity'), new CSeverity(array('name' => 'priority', 'value' => $this->data['priority'])));
// append status to form list
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:configuration.triggers.edit.php

示例10: insert_user_form


//.........这里部分代码省略.........
    $media_type_ids = array();
    foreach ($user_medias as $one_media) {
        $media_type_ids[$one_media['mediatypeid']] = 1;
    }
    if (count($media_type_ids) > 0) {
        $db_media_types = DBselect('SELECT mt.mediatypeid, mt.description ' . ' FROM media_type mt ' . ' WHERE mt.mediatypeid IN (' . implode(',', array_keys($media_type_ids)) . ')');
        while ($db_media_type = DBfetch($db_media_types)) {
            $media_types[$db_media_type['mediatypeid']] = $db_media_type['description'];
        }
    }
    $frmUser = new CFormTable($frm_title);
    $frmUser->SetName('user_form');
    $frmUser->SetHelp('web.users.php');
    $frmUser->addVar('config', get_request('config', 0));
    if (isset($userid)) {
        $frmUser->addVar('userid', $userid);
    }
    if ($profile == 0) {
        $frmUser->addRow(S_ALIAS, new CTextBox('alias', $alias, 40));
        $frmUser->addRow(S_NAME, new CTextBox('name', $name, 40));
        $frmUser->addRow(S_SURNAME, new CTextBox('surname', $surname, 40));
    }
    $auth_type = isset($userid) ? get_user_system_auth($userid) : $config['authentication_type'];
    if (ZBX_AUTH_INTERNAL == $auth_type) {
        if (!isset($userid) || isset($change_password)) {
            $frmUser->addRow(S_PASSWORD, new CPassBox('password1', $password1, 20));
            $frmUser->addRow(S_PASSWORD_ONCE_AGAIN, new CPassBox('password2', $password2, 20));
            if (isset($change_password)) {
                $frmUser->addVar('change_password', $change_password);
            }
        } else {
            $passwd_but = new CButton('change_password', S_CHANGE_PASSWORD);
            if ($alias == ZBX_GUEST_USER) {
                $passwd_but->setAttribute('disabled', 'disabled');
            }
            $frmUser->addRow(S_PASSWORD, $passwd_but);
        }
    } else {
        if (!isset($userid) || isset($change_password)) {
            $frmUser->addVar('password1', '');
            $frmUser->addVar('password2', '');
        }
    }
    if ($profile == 0) {
        $frmUser->addVar('user_groups', $user_groups);
        if (isset($userid) && bccomp($USER_DETAILS['userid'], $userid) == 0) {
            $frmUser->addVar('user_type', $user_type);
        } else {
            $cmbUserType = new CComboBox('user_type', $user_type, $perm_details ? 'submit();' : null);
            $cmbUserType->addItem(USER_TYPE_ZABBIX_USER, user_type2str(USER_TYPE_ZABBIX_USER));
            $cmbUserType->addItem(USER_TYPE_ZABBIX_ADMIN, user_type2str(USER_TYPE_ZABBIX_ADMIN));
            $cmbUserType->addItem(USER_TYPE_SUPER_ADMIN, user_type2str(USER_TYPE_SUPER_ADMIN));
            $frmUser->addRow(S_USER_TYPE, $cmbUserType);
        }
        $lstGroups = new CListBox('user_groups_to_del[]');
        $lstGroups->attributes['style'] = 'width: 320px';
        foreach ($user_groups as $groupid => $group_name) {
            $lstGroups->addItem($groupid, $group_name);
        }
        $frmUser->addRow(S_GROUPS, array($lstGroups, BR(), new CButton('add_group', S_ADD, 'return PopUp("popup_usrgrp.php?dstfrm=' . $frmUser->GetName() . '&list_name=user_groups_to_del[]&var_name=user_groups",450, 450);'), SPACE, count($user_groups) > 0 ? new CButton('del_user_group', S_DELETE_SELECTED) : null));
    }
    $cmbLang = new CComboBox('lang', $lang);
    foreach ($ZBX_LOCALES as $loc_id => $loc_name) {
        $cmbLang->addItem($loc_id, $loc_name);
    }
    $frmUser->addRow(S_LANGUAGE, $cmbLang);
开发者ID:phedders,项目名称:zabbix,代码行数:67,代码来源:forms.inc.php

示例11: campoPadrao

$reporttimetab2->addRow(array(array(bold(_zeT('Analysis')), ': '), array($cmbTimeSource, $cmbAgregation)));
$reporttimetab2->addRow(array(array(bold(_zeT('Projection')), ': '), array($cmbTimeProjection, array(bold(_zeT('Amount')), ': '), new CTextBox('num_projection', get_request('num_projection', 7), 2))));
$reporttimetab2->addRow(array(array(bold(_zeT('Formatting')), ': '), array($cmbFormato)));
/*----------- Implementa o Filtro por período ---------------*/
$filter_table->addRow(array(array(bold(_('Group')), ': ', $cmbGroups), array(bold(_('Host')), ': ', $cmbHosts), exibeConteudo($hostid > 0, array(bold(_zeT('Application')), ': ', $cmbApplications)), array()));
$filter_table->addRow(array(exibeConteudo($applicationid > 0, array(bold(_('Item')), ': ', $cmbItems)), exibeConteudo($itemid > 0, $reporttimetab), exibeConteudo($itemid > 0, $reporttimetab2)));
$filter_form = new CForm();
$filter_form->setMethod('get');
$filter_form->setAttribute('name', 'zbx_filter');
$filter_form->setAttribute('id', 'zbx_filter');
$reset = new CButton('reset', _('Reset'));
$reset->onClick("javascript: clearAllForm('zbx_filter');");
$grafico = new CButton('grafico', _zeT('Chart'));
// Habilita o botão de geração de gráfico quando tem host e item selecionado =============================================
if ($hostid < 1 and $itemid < 1) {
    $grafico->setAttribute('disabled', '');
}
$grafico->onClick("javascript: fnGrafico();");
$filter = new CButton('filter', _zeT("Update Filter"));
$filter->onClick("javascript: submit();");
$footer_col = new CCol(array($filter, SPACE, $reset, SPACE, $grafico), 'center');
$footer_col->setColSpan(4);
$filter_table->addRow($footer_col);
$filter_form->addItem($filter_table);
$filter_form->addVar('report_timesince', date('YmdHis', $report_timesince));
$filter_form->addVar('report_timetill', date('YmdHis', $report_timetill));
$hostprof_wdgt->addFlicker($filter_form, true);
function campoPadrao($p_campo, $p_mascara)
{
}
// FIM Formulario de Filtro =========================================================
开发者ID:zubayr,项目名称:zabbix-extras,代码行数:31,代码来源:zbxe-cat.php

示例12: CCol

    }
    $col = new CCol($result);
    $col->setAttribute('style', $style);
    $res_table->addRow(new CRow(array($e['list'], $col)));
}
$result = '-';
if ($allowedTesting && $test) {
    $result = evalExpressionData($expression, $macrosData, $octet);
}
$style = 'text-align: center;';
if ($result != '-') {
    $style = $result == 'TRUE' ? 'background-color: #ccf; color: #00f;' : 'background-color: #fcc; color: #f00;';
}
$col = new CCol($result);
$col->setAttribute('style', $style);
$res_table->setFooter(array($outline, $col), $res_table->headerClass);
$frm_test->addRow(S_RESULT, $res_table);
// action buttons
$btn_test = new CButton('test_expression', S_TEST);
if (!$allowedTesting) {
    $btn_test->setAttribute('disabled', 'disabled');
}
$frm_test->addItemToBottomRow($btn_test);
$frm_test->addItemToBottomRow(SPACE);
$btn_close = new CButton('close', S_CLOSE);
$btn_close->setType('button');
$btn_close->setAction('javascript: self.close();');
$frm_test->addItemToBottomRow($btn_close);
$frm_test->show();
//------------------------ </FORM> ---------------------------
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_testexpr.php

示例13: insert_trigger_form

function insert_trigger_form()
{
    $frmTrig = new CFormTable(S_TRIGGER, 'triggers.php');
    $frmTrig->setHelp('config_triggers.php');
    //		if(isset($_REQUEST['hostid'])){
    //			$frmTrig->addVar('hostid',$_REQUEST['hostid']);
    //		}
    $dep_el = array();
    $dependencies = get_request('dependencies', array());
    $limited = null;
    if (isset($_REQUEST['triggerid'])) {
        $frmTrig->addVar('triggerid', $_REQUEST['triggerid']);
        $trigger = get_trigger_by_triggerid($_REQUEST['triggerid']);
        $caption = array();
        $trigid = $_REQUEST['triggerid'];
        do {
            $sql = 'SELECT t.triggerid, t.templateid, h.host' . ' FROM triggers t, functions f, items i, hosts h' . ' WHERE t.triggerid=' . $trigid . ' AND h.hostid=i.hostid' . ' AND i.itemid=f.itemid' . ' AND f.triggerid=t.triggerid';
            $trig = DBfetch(DBselect($sql));
            if ($_REQUEST['triggerid'] != $trigid) {
                $caption[] = ' : ';
                $caption[] = new CLink($trig['host'], 'triggers.php?form=update&triggerid=' . $trig['triggerid'], 'highlight underline');
            }
            $trigid = $trig['templateid'];
        } while ($trigid != 0);
        $caption[] = S_TRIGGER . ' "';
        $caption = array_reverse($caption);
        $caption[] = htmlspecialchars($trigger['description']);
        $caption[] = '"';
        $frmTrig->setTitle($caption);
        $limited = $trigger['templateid'] ? 'yes' : null;
    }
    $expression = get_request('expression', '');
    $description = get_request('description', '');
    $type = get_request('type', 0);
    $priority = get_request('priority', 0);
    $status = get_request('status', 0);
    $comments = get_request('comments', '');
    $url = get_request('url', '');
    $expr_temp = get_request('expr_temp', '');
    $input_method = get_request('input_method', IM_ESTABLISHED);
    if (isset($_REQUEST['triggerid']) && !isset($_REQUEST['form_refresh']) || isset($limited)) {
        $description = $trigger['description'];
        $expression = explode_exp($trigger['expression'], 0);
        if (!isset($limited) || !isset($_REQUEST['form_refresh'])) {
            $type = $trigger['type'];
            $priority = $trigger['priority'];
            $status = $trigger['status'];
            $comments = $trigger['comments'];
            $url = $trigger['url'];
            $trigs = DBselect('SELECT t.triggerid,t.description,t.expression ' . ' FROM triggers t,trigger_depends d ' . ' WHERE t.triggerid=d.triggerid_up ' . ' AND d.triggerid_down=' . $_REQUEST['triggerid']);
            while ($trig = DBfetch($trigs)) {
                if (uint_in_array($trig['triggerid'], $dependencies)) {
                    continue;
                }
                array_push($dependencies, $trig['triggerid']);
            }
        }
    }
    $frmTrig->addRow(S_NAME, new CTextBox('description', $description, 90, $limited));
    if ($input_method == IM_TREE) {
        $alz = analyze_expression($expression);
        if ($alz !== false) {
            list($outline, $eHTMLTree) = $alz;
            if (isset($_REQUEST['expr_action']) && $eHTMLTree != null) {
                $new_expr = remake_expression($expression, $_REQUEST['expr_target_single'], $_REQUEST['expr_action'], $expr_temp);
                if ($new_expr !== false) {
                    $expression = $new_expr;
                    $alz = analyze_expression($expression);
                    if ($alz !== false) {
                        list($outline, $eHTMLTree) = $alz;
                    } else {
                        show_messages(false, '', S_EXPRESSION_SYNTAX_ERROR);
                    }
                    $expr_temp = '';
                } else {
                    show_messages(false, '', S_EXPRESSION_SYNTAX_ERROR);
                }
            }
            $frmTrig->addVar('expression', $expression);
            $exprfname = 'expr_temp';
            $exprtxt = new CTextBox($exprfname, $expr_temp, 65, 'yes');
            $macrobtn = new CButton('insert_macro', S_INSERT_MACRO, 'return call_ins_macro_menu(event);');
            //disabling button, if this trigger is templated
            if ($limited == 'yes') {
                $macrobtn->setAttribute('disabled', 'disabled');
            }
            $exprparam = "this.form.elements['{$exprfname}'].value";
        } else {
            show_messages(false, '', S_EXPRESSION_SYNTAX_ERROR);
            $input_method = IM_ESTABLISHED;
        }
    }
    if ($input_method != IM_TREE) {
        $exprfname = 'expression';
        $exprtxt = new CTextBox($exprfname, $expression, 75, $limited);
        $exprparam = "getSelectedText(this.form.elements['{$exprfname}'])";
    }
    $add_expr_button = new CButton('insert', $input_method == IM_TREE ? S_EDIT : S_ADD, "return PopUp('popup_trexpr.php?dstfrm=" . $frmTrig->getName() . "&dstfld1={$exprfname}&srctbl=expression" . "&srcfld1=expression&expression=' + escape({$exprparam}),1000,700);");
    //disabling button, if this trigger is templated
    if ($limited == 'yes') {
//.........这里部分代码省略.........
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:forms.inc.php

示例14: array

         $mapname = get_request("mapname", "");
         $valuemap = get_request("valuemap", array());
     }
     $frmValmap->addRow(S_NAME, new CTextBox("mapname", $mapname, 40));
     $i = 0;
     $valuemap_el = array();
     foreach ($valuemap as $value) {
         array_push($valuemap_el, array(new CCheckBox("rem_value[]", 'no', null, $i), $value["value"] . SPACE . RARR . SPACE . $value["newvalue"]), BR());
         $frmValmap->addVar("valuemap[{$i}][value]", $value["value"]);
         $frmValmap->addVar("valuemap[{$i}][newvalue]", $value["newvalue"]);
         $i++;
     }
     $saveButton = new CButton('save', S_SAVE);
     if (count($valuemap_el) == 0) {
         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 {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:config.php

示例15: CListBox

    order_result($groups, 'name');
    $lstGroups = new CListBox('del_groups[]', null, 15);
    $lstGroups->setAttribute('style', 'width: 200px;');
    foreach ($groups as $gnum => $group) {
        $lstGroups->addItem($group['groupid'], get_node_name_by_elid($group['groupid'], true, ':') . $group['name']);
    }
    if (!$filterEnable) {
        $lstGroups->setAttribute('disabled', 'disabled');
    }
    $addButton = new CButton('add', S_ADD, "return PopUp('popup_right.php?dstfrm=" . $dashForm->getName() . "&permission=" . PERM_READ_WRITE . "',450,450);");
    if (!$filterEnable) {
        $addButton->setAttribute('disabled', 'disabled');
    }
    $delButton = new CButton('delete', S_DELETE_SELECTED);
    if (!$filterEnable) {
        $delButton->setAttribute('disabled', 'disabled');
    }
    $dashForm->addRow(S_GROUPS, array($lstGroups, BR(), $addButton, $delButton));
}
//HOSTS
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
    $cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:dashconf.php


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