本文整理汇总了PHP中CTable::setEvenRowClass方法的典型用法代码示例。如果您正苦于以下问题:PHP CTable::setEvenRowClass方法的具体用法?PHP CTable::setEvenRowClass怎么用?PHP CTable::setEvenRowClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTable
的用法示例。
在下文中一共展示了CTable::setEvenRowClass方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: simpleHTML
private function simpleHTML()
{
$table = new CTable('', 'tabletree');
$table->setCellSpacing(0);
$table->setCellPadding(0);
$table->setOddRowClass('odd_row');
$table->setEvenRowClass('even_row');
$table->headerClass = 'header';
$table->footerClass = 'footer';
$table->setAttribute('valign', 'top');
// $table->setAttribute('border','1');
$table->addRow($this->makeHeaders());
foreach ($this->tree as $id => $rows) {
$table->addRow($this->makeRow($id));
}
return $table;
}
示例2: CFormTable
$test = false;
}
//------------------------ </ACTIONS> --------------------------
//------------------------ <FORM> ---------------------------
$frm_test = new CFormTable(_('Test'), 'tr_testexpr.php');
$frm_test->setHelp('web.testexpr.service.php');
$frm_test->setTableClass('formlongtable formtable');
$frm_test->addVar('form_refresh', get_request('form_refresh', 1));
$frm_test->addVar('expression', $expression);
/* test data */
$frm_test->addRow(_('Test data'), $data_table);
/* result */
$res_table = new CTable(null, 'tableinfo');
$res_table->setAttribute('id', 'result_list');
$res_table->setOddRowClass('even_row');
$res_table->setEvenRowClass('even_row');
$res_table->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
$result = '-';
if ($allowedTesting && $test && isset($e['expression'])) {
$result = evalExpressionData($e['expression']['value'], $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->addRow(new CRow(array($e['list'], $col)));
}
示例3: bodyToString
public function bodyToString()
{
parent::bodyToString();
$tbl = new CTable(NULL, $this->tableclass);
$tbl->setOddRowClass('form_odd_row');
$tbl->setEvenRowClass('form_even_row');
$tbl->setCellSpacing(0);
$tbl->setCellPadding(1);
$tbl->setAlign($this->align);
// add first row
$col = new CCol(NULL, 'form_row_first');
$col->setColSpan(2);
if (isset($this->help)) {
$col->addItem($this->help);
}
if (isset($this->title)) {
$col->addItem($this->title);
}
foreach ($this->top_items as $item) {
$col->addItem($item);
}
$tbl->setHeader($col);
// add last row
$tbl->setFooter($this->bottom_items);
// add center rows
foreach ($this->center_items as $item) {
$tbl->addRow($item);
}
return $tbl->toString();
}
示例4: insert_map_link_form
function insert_map_link_form()
{
$frmCnct = new CFormTable('New connector', 'sysmap.php');
$frmCnct->SetHelp('web.sysmap.connector.php');
$frmCnct->addVar('sysmapid', $_REQUEST['sysmapid']);
if (isset($_REQUEST['linkid']) && !isset($_REQUEST['form_refresh'])) {
$frmCnct->addVar('linkid', $_REQUEST['linkid']);
$db_links = DBselect('SELECT * FROM sysmaps_links WHERE linkid=' . $_REQUEST['linkid']);
$db_link = DBfetch($db_links);
$selementid1 = $db_link['selementid1'];
$selementid2 = $db_link['selementid2'];
$triggers = array();
$drawtype = $db_link['drawtype'];
$color = $db_link['color'];
$res = DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST['linkid']);
while ($rows = DBfetch($res)) {
$triggers[] = $rows;
}
} else {
if (isset($_REQUEST['linkid'])) {
$frmCnct->addVar('linkid', $_REQUEST['linkid']);
}
$selementid1 = get_request('selementid1', 0);
$selementid2 = get_request('selementid2', 0);
$triggers = get_request('triggers', array());
$drawtype = get_request('drawtype', 0);
$color = get_request('color', 0);
}
/* START comboboxes preparations */
$cmbElements1 = new CComboBox('selementid1', $selementid1);
$cmbElements2 = new CComboBox('selementid2', $selementid2);
$db_selements = DBselect('SELECT selementid,label,elementid,elementtype ' . ' FROM sysmaps_elements ' . ' WHERE sysmapid=' . $_REQUEST['sysmapid']);
while ($db_selement = DBfetch($db_selements)) {
$label = $db_selement['label'];
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_HOST) {
$db_host = get_host_by_hostid($db_selement['elementid']);
$label .= ':' . $db_host['host'];
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_MAP) {
$db_map = get_sysmap_by_sysmapid($db_selement['elementid']);
$label .= ':' . $db_map['name'];
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_TRIGGER) {
if ($db_selement['elementid'] > 0) {
$label .= ':' . expand_trigger_description($db_selement['elementid']);
}
} else {
if ($db_selement['elementtype'] == SYSMAP_ELEMENT_TYPE_HOST_GROUP) {
if ($db_selement['elementid'] > 0) {
$db_group = DBfetch(DBselect('SELECT name FROM groups WHERE groupid=' . $db_selement['elementid']));
$label .= ':' . $db_group['name'];
}
}
}
}
}
$cmbElements1->addItem($db_selement['selementid'], $label);
$cmbElements2->addItem($db_selement['selementid'], $label);
}
$cmbType = new CComboBox('drawtype', $drawtype);
foreach (map_link_drawtypes() as $i) {
$value = map_link_drawtype2str($i);
$cmbType->addItem($i, $value);
}
/* END preparation */
$frmCnct->addRow(S_ELEMENT_1, $cmbElements1);
$frmCnct->addRow(S_ELEMENT_2, $cmbElements2);
//trigger links
foreach ($triggers as $id => $trigger) {
if (isset($trigger['triggerid'])) {
$triggers[$id]['description'] = expand_trigger_description($trigger['triggerid']);
}
}
$table = new CTable();
$table->SetClass('tableinfo');
$table->setOddRowClass('even_row');
$table->setEvenRowClass('even_row');
$table->options['cellpadding'] = 3;
$table->options['cellspacing'] = 1;
$table->headerClass = 'header';
$table->footerClass = 'footer';
$table->SetHeader(array(new CCheckBox('all_triggers', null, "CheckAll('" . $frmCnct->GetName() . "','all_triggers','triggers');"), S_TRIGGERS, S_TYPE, S_COLOR));
$table->addOption('id', 'link_triggers');
foreach ($triggers as $id => $trigger) {
if (!isset($trigger['triggerid'])) {
continue;
}
$colorbox = new CSpan(SPACE . SPACE . SPACE);
$colorbox->addOption('style', 'text-decoration: none; outline-color: black; outline-style: solid; outline-width: 1px; background-color: #' . $trigger['color'] . ';');
$table->addRow(array(array(new CCheckBox('triggers[' . $trigger['triggerid'] . '][triggerid]', null, null, $trigger['triggerid']), new CVar('triggers[' . $trigger['triggerid'] . '][triggerid]', $trigger['triggerid'])), array(new CLink($trigger['description'], "javascript: openWinCentered('popup_link_tr.php?form=1&dstfrm=" . $frmCnct->GetName() . "&triggerid=" . $trigger['triggerid'] . url_param('linkid') . "','ZBX_Link_Indicator',560,260,'scrollbars=1, toolbar=0, menubar=0, resizable=0');"), new CVar('triggers[' . $trigger['triggerid'] . '][description]', $trigger['description'])), array(map_link_drawtype2str($trigger['drawtype']), new CVar('triggers[' . $trigger['triggerid'] . '][drawtype]', $trigger['drawtype'])), array($colorbox, new CVar('triggers[' . $trigger['triggerid'] . '][color]', $trigger['color']))));
}
$btnadd = new CButton('btn1', S_ADD, "javascript: openWinCentered('popup_link_tr.php?form=1&dstfrm=" . $frmCnct->GetName() . url_param('linkid') . "','ZBX_Link_Indicator',560,180,'scrollbars=1, toolbar=0, menubar=0, resizable=0');", 'T');
$btnRemove = new CButton('btn1', S_REMOVE, "javascript: remove_childs('" . $frmCnct->GetName() . "','triggers','tr');", 'T');
$btnadd->SetType('button');
$frmCnct->addRow(S_LINK_STATUS_INDICATORS, array($table, BR(), $btnadd, $btnRemove));
//----------
$frmCnct->addRow(S_TYPE . ' (' . S_OK_BIG . ')', $cmbType);
$frmCnct->addRow(S_COLOR . ' (' . S_OK_BIG . ')', new CColor('color', $color));
$frmCnct->addItemToBottomRow(new CButton("save_link", S_SAVE));
if (isset($_REQUEST["linkid"])) {
//.........这里部分代码省略.........
示例5: CFormTable
if (isset($_REQUEST['test_expression'])) {
show_messages();
$test = true;
} else {
$test = false;
}
// form
$testForm = new CFormTable(_('Test'), 'tr_testexpr.php');
$testForm->addHelpIcon();
$testForm->setTableClass('formlongtable formtable');
$testForm->addVar('expression', $expression);
$testForm->addRow(_('Test data'), $dataTable);
$resultTable = new CTable(null, 'tableinfo');
$resultTable->setAttribute('id', 'result_list');
$resultTable->setOddRowClass('even_row');
$resultTable->setEvenRowClass('even_row');
$resultTable->setHeader(array(_('Expression'), _('Result')));
ksort($rplcts, SORT_NUMERIC);
foreach ($eHTMLTree as $e) {
$result = '-';
$style = 'text-align: center;';
if ($allowedTesting && $test && isset($e['expression'])) {
if (evalExpressionData($e['expression']['value'], $macrosData)) {
$result = 'TRUE';
$style = 'background-color: #ccf; color: #00f;';
} else {
$result = 'FALSE';
$style = 'background-color: #fcc; color: #f00;';
}
}
$col = new CCol($result);
示例6: elseif
}
array_push($expressionRow, $replaceExpressionButton);
}
} elseif ($this->data['input_method'] != IM_FORCED) {
$inputMethodToggle = new CSpan(_('Expression constructor'), 'link');
$inputMethodToggle->setAttribute('onclick', 'javascript: ' . 'document.getElementById("toggle_input_method").value=1;' . 'document.getElementById("input_method").value=' . ($this->data['input_method'] == IM_TREE ? IM_ESTABLISHED : IM_TREE) . ';' . 'document.forms["' . $triggersForm->getName() . '"].submit();');
$expressionRow[] = array(BR(), $inputMethodToggle);
}
$triggersFormList->addRow(_('Expression'), $expressionRow);
// append expression table to form list
if ($this->data['input_method'] == IM_TREE) {
$expressionTable = new CTable(null, 'formElementTable');
$expressionTable->setAttribute('style', 'min-width: 500px;');
$expressionTable->setAttribute('id', 'exp_list');
$expressionTable->setOddRowClass('even_row');
$expressionTable->setEvenRowClass('even_row');
$expressionTable->setHeader(array($this->data['limited'] ? null : _('Target'), _('Expression'), empty($this->data['parent_discoveryid']) ? _('Error') : null, $this->data['limited'] ? null : _('Action')));
$allowedTesting = true;
if (!empty($this->data['eHTMLTree'])) {
foreach ($this->data['eHTMLTree'] as $i => $e) {
if (!$this->data['limited']) {
$deleteUrl = new CSpan(_('Delete'), 'link');
$deleteUrl->setAttribute('onclick', 'javascript:' . ' if (confirm(' . CJs::encodeJson(_('Delete expression?')) . ')) {' . ' delete_expression("' . $e['id'] . '");' . ' document.forms["' . $triggersForm->getName() . '"].submit();' . ' }');
$triggerCheckbox = new CCheckBox('expr_target_single', $i == 0 ? 'yes' : 'no', 'check_target(this);', $e['id']);
} else {
$triggerCheckbox = null;
}
if (empty($this->data['parent_discoveryid'])) {
if (!isset($e['expression']['levelErrors'])) {
$errorImg = new CImg('images/general/ok_icon.png', 'expression_no_errors');
$errorImg->setHint(_('No errors found.'));
示例7: insert_host_form
//.........这里部分代码省略.........
$notes = $db_profile['notes'];
}
// BEGIN: HOSTS PROFILE EXTENDED Section
$useprofile_ext = 'no';
$db_profiles_alt = DBselect('SELECT * FROM hosts_profiles_ext WHERE hostid=' . $_REQUEST['hostid']);
if ($ext_host_profiles = DBfetch($db_profiles_alt)) {
$useprofile_ext = 'yes';
} else {
$ext_host_profiles = array();
}
// END: HOSTS PROFILE EXTENDED Section
$templates = $original_templates;
}
$ext_profiles_fields = array('device_alias' => S_DEVICE_ALIAS, 'device_type' => S_DEVICE_TYPE, 'device_chassis' => S_DEVICE_CHASSIS, 'device_os' => S_DEVICE_OS, 'device_os_short' => S_DEVICE_OS_SHORT, 'device_hw_arch' => S_DEVICE_HW_ARCH, 'device_serial' => S_DEVICE_SERIAL, 'device_model' => S_DEVICE_MODEL, 'device_tag' => S_DEVICE_TAG, 'device_vendor' => S_DEVICE_VENDOR, 'device_contract' => S_DEVICE_CONTRACT, 'device_who' => S_DEVICE_WHO, 'device_status' => S_DEVICE_STATUS, 'device_app_01' => S_DEVICE_APP_01, 'device_app_02' => S_DEVICE_APP_02, 'device_app_03' => S_DEVICE_APP_03, 'device_app_04' => S_DEVICE_APP_04, 'device_app_05' => S_DEVICE_APP_05, 'device_url_1' => S_DEVICE_URL_1, 'device_url_2' => S_DEVICE_URL_2, 'device_url_3' => S_DEVICE_URL_3, 'device_networks' => S_DEVICE_NETWORKS, 'device_notes' => S_DEVICE_NOTES, 'device_hardware' => S_DEVICE_HARDWARE, 'device_software' => S_DEVICE_SOFTWARE, 'ip_subnet_mask' => S_IP_SUBNET_MASK, 'ip_router' => S_IP_ROUTER, 'ip_macaddress' => S_IP_MACADDRESS, 'oob_ip' => S_OOB_IP, 'oob_subnet_mask' => S_OOB_SUBNET_MASK, 'oob_router' => S_OOB_ROUTER, 'date_hw_buy' => S_DATE_HW_BUY, 'date_hw_install' => S_DATE_HW_INSTALL, 'date_hw_expiry' => S_DATE_HW_EXPIRY, 'date_hw_decomm' => S_DATE_HW_DECOMM, 'site_street_1' => S_SITE_STREET_1, 'site_street_2' => S_SITE_STREET_2, 'site_street_3' => S_SITE_STREET_3, 'site_city' => S_SITE_CITY, 'site_state' => S_SITE_STATE, 'site_country' => S_SITE_COUNTRY, 'site_zip' => S_SITE_ZIP, 'site_rack' => S_SITE_RACK, 'site_notes' => S_SITE_NOTES, 'poc_1_name' => S_POC_1_NAME, 'poc_1_email' => S_POC_1_EMAIL, 'poc_1_phone_1' => S_POC_1_PHONE_1, 'poc_1_phone_2' => S_POC_1_PHONE_2, 'poc_1_cell' => S_POC_1_CELL, 'poc_1_screen' => S_POC_1_SCREEN, 'poc_1_notes' => S_POC_1_NOTES, 'poc_2_name' => S_POC_2_NAME, 'poc_2_email' => S_POC_2_EMAIL, 'poc_2_phone_1' => S_POC_2_PHONE_1, 'poc_2_phone_2' => S_POC_2_PHONE_2, 'poc_2_cell' => S_POC_2_CELL, 'poc_2_screen' => S_POC_2_SCREEN, 'poc_2_notes' => S_POC_2_NOTES);
foreach ($ext_profiles_fields as $field => $caption) {
if (!isset($ext_host_profiles[$field])) {
$ext_host_profiles[$field] = '';
}
}
$clear_templates = array_intersect($clear_templates, array_keys($original_templates));
$clear_templates = array_diff($clear_templates, array_keys($templates));
natcasesort($templates);
$frmHost = new CForm('hosts.php', 'post');
$frmHost->setName('web.hosts.host.php.');
// $frmHost->setHelp('web.hosts.host.php');
// $frmHost->addVar('config',get_request('config',0));
$frmHost->addVar('form', get_request('form', 1));
$from_rfr = get_request('form_refresh', 0);
$frmHost->addVar('form_refresh', $from_rfr + 1);
$frmHost->addVar('clear_templates', $clear_templates);
// HOST WIDGET {
$host_tbl = new CTable('', 'tablestripped');
$host_tbl->setOddRowClass('form_odd_row');
$host_tbl->setEvenRowClass('form_even_row');
if ($_REQUEST['hostid'] > 0) {
$frmHost->addVar('hostid', $_REQUEST['hostid']);
}
if ($_REQUEST['groupid'] > 0) {
$frmHost->addVar('groupid', $_REQUEST['groupid']);
}
$host_tbl->addRow(array(S_NAME, new CTextBox('host', $host, 54)));
$grp_tb = new CTweenBox($frmHost, 'groups', $host_groups, 10);
$all_groups = CHostGroup::get(array('editable' => 1, 'extendoutput' => 1));
order_result($all_groups, 'name');
foreach ($all_groups as $group) {
$grp_tb->addItem($group['groupid'], $group['name']);
}
$host_tbl->addRow(array(S_GROUPS, $grp_tb->get(S_IN_GROUPS, S_OTHER_GROUPS)));
$host_tbl->addRow(array(S_NEW_GROUP, new CTextBox('newgroup', $newgroup)));
// onchange does not work on some browsers: MacOS, KDE browser
$host_tbl->addRow(array(S_DNS_NAME, new CTextBox('dns', $dns, '40')));
if (defined('ZBX_HAVE_IPV6')) {
$host_tbl->addRow(array(S_IP_ADDRESS, new CTextBox('ip', $ip, '39')));
} else {
$host_tbl->addRow(array(S_IP_ADDRESS, new CTextBox('ip', $ip, '15')));
}
$cmbConnectBy = new CComboBox('useip', $useip);
$cmbConnectBy->addItem(0, S_DNS_NAME);
$cmbConnectBy->addItem(1, S_IP_ADDRESS);
$host_tbl->addRow(array(S_CONNECT_TO, $cmbConnectBy));
$host_tbl->addRow(array(S_AGENT_PORT, new CNumericBox('port', $port, 5)));
//Proxy
$cmbProxy = new CComboBox('proxy_hostid', $proxy_hostid);
$cmbProxy->addItem(0, S_NO_PROXY);
$options = array('extendoutput' => 1);
$db_proxies = CProxy::get($options);
示例8: array
$templates = $original_templates;
} else {
$groups = get_request('groups', array());
if (isset($_REQUEST['groupid']) && $_REQUEST['groupid'] > 0 && !uint_in_array($_REQUEST['groupid'], $groups)) {
array_push($groups, $_REQUEST['groupid']);
}
$hosts_linked_to = get_request('hosts', array());
}
$clear_templates = array_intersect($clear_templates, array_keys($original_templates));
$clear_templates = array_diff($clear_templates, array_keys($templates));
natcasesort($templates);
$frmHost->addVar('clear_templates', $clear_templates);
// TEMPLATE WIDGET {
$template_tbl = new CTable('', 'tablestripped');
$template_tbl->setOddRowClass('form_odd_row');
$template_tbl->setEvenRowClass('form_even_row');
// FORM ITEM : Template name text box [ ]
$template_tbl->addRow(array(S_NAME, new CTextBox('template_name', $template_name, 54)));
// FORM ITEM : Groups tween box [ ] [ ]
// get all Groups
$group_tb = new CTweenBox($frmHost, 'groups', $groups, 10);
$options = array('editable' => 1, 'extendoutput' => 1);
$all_groups = CHostGroup::get($options);
order_result($all_groups, 'name');
foreach ($all_groups as $gnum => $group) {
$group_tb->addItem($group['groupid'], $group['name']);
}
$template_tbl->addRow(array(S_GROUPS, $group_tb->get(S_IN . SPACE . S_GROUPS, S_OTHER . SPACE . S_GROUPS)));
// FORM ITEM : new group text box [ ]
$template_tbl->addRow(array(S_NEW_GROUP, new CTextBox('newgroup', $newgroup)));
// FORM ITEM : linked Hosts tween box [ ] [ ]