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


PHP CTable::addStyle方法代码示例

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


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

示例1: setDoubleHeader

 public function setDoubleHeader($left, $right)
 {
     $table = new CTable();
     $table->addStyle('width: 100%;');
     $lCol = new CCol($left);
     $lCol->addStyle('text-align: left; border: 0;');
     $rCol = new CCol($right);
     $rCol->addStyle('text-align: right; border: 0;');
     $table->addRow(array($lCol, $rCol));
     $this->_header = new CDiv(null, 'nowrap ui-corner-all ui-widget-header ' . $this->css_class);
     $this->_header->addItem($table);
     return $this->_header;
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:13,代码来源:class.cuiwidget.php

示例2: CDiv

         $div_node_tree = new CDiv();
         $div_node_tree->addItem($node_tree->getHTML());
         $div_node_tree->addItem(new CSubmit('select_nodes', _('Select'), "\$('div_node_tree').setStyle({display: 'none'});"));
         $div_node_tree->setAttribute('id', 'div_node_tree');
         $div_node_tree->addStyle('display: none');
         if (!is_null($nodesComboBox)) {
             $node_form->addItem(array(new CSpan(_('Current node') . SPACE, 'textcolorstyles'), $nodesComboBox));
         }
         $node_form->addItem($button_show_tree);
         $node_form->addItem($div_node_tree);
         unset($nodesComboBox);
     }
 }
 if (isset($ZBX_SERVER_NAME) && !zbx_empty($ZBX_SERVER_NAME)) {
     $table = new CTable();
     $table->addStyle('width: 100%;');
     $tableColumn = new CCol(new CSpan($ZBX_SERVER_NAME, 'textcolorstyles'));
     if (is_null($node_form)) {
         $tableColumn->addStyle('padding-right: 5px;');
     } else {
         $tableColumn->addStyle('padding-right: 20px; padding-bottom: 2px;');
     }
     $table->addRow(array($tableColumn, $node_form));
     $node_form = $table;
 }
 // 1st level menu
 $table = new CTable(null, 'maxwidth');
 $r_col = new CCol($node_form, 'right');
 $r_col->setAttribute('style', 'line-height: 1.8em;');
 $table->addRow(array($menu_table, $r_col));
 $page_menu = new CDiv(null, 'textwhite');
开发者ID:hujingguang,项目名称:work,代码行数:31,代码来源:page_header.php

示例3: get_regexp_form

function get_regexp_form()
{
    $frm_title = S_REGULAR_EXPRESSION;
    if (isset($_REQUEST['regexpid']) && !isset($_REQUEST["form_refresh"])) {
        $sql = 'SELECT re.* ' . ' FROM regexps re ' . ' WHERE ' . DBin_node('re.regexpid') . ' AND re.regexpid=' . $_REQUEST['regexpid'];
        $regexp = DBfetch(DBSelect($sql));
        $frm_title .= ' [' . $regexp['name'] . ']';
        $rename = $regexp['name'];
        $test_string = $regexp['test_string'];
        $expressions = array();
        $sql = 'SELECT e.* ' . ' FROM expressions e ' . ' WHERE ' . DBin_node('e.expressionid') . ' AND e.regexpid=' . $regexp['regexpid'] . ' ORDER BY e.expression_type';
        $db_exps = DBselect($sql);
        while ($exp = DBfetch($db_exps)) {
            $expressions[] = $exp;
        }
    } else {
        $rename = get_request('rename', '');
        $test_string = get_request('test_string', '');
        $expressions = get_request('expressions', array());
    }
    $tblRE = new CTable('', 'nowrap');
    $tblRE->addStyle('border-left: 1px #AAA solid; border-right: 1px #AAA solid; background-color: #EEE; padding: 2px; padding-left: 6px; padding-right: 6px;');
    $tblRE->addRow(array(S_NAME, new CTextBox('rename', $rename, 60)));
    $tblRE->addRow(array(S_TEST_STRING, new CTextArea('test_string', $test_string, 66, 5)));
    $tabExp = new CTableInfo();
    $td1 = new CCol(S_EXPRESSION);
    $td1->addStyle('background-color: #CCC;');
    $td2 = new CCol(S_EXPECTED_RESULT);
    $td2->addStyle('background-color: #CCC;');
    $td3 = new CCol(S_RESULT);
    $td3->addStyle('background-color: #CCC;');
    $tabExp->setHeader(array($td1, $td2, $td3));
    $final_result = !empty($test_string);
    foreach ($expressions as $id => $expression) {
        $results = array();
        $paterns = array($expression['expression']);
        if (!empty($test_string)) {
            if ($expression['expression_type'] == EXPRESSION_TYPE_ANY_INCLUDED) {
                $paterns = explode($expression['exp_delimiter'], $expression['expression']);
            }
            if (uint_in_array($expression['expression_type'], array(EXPRESSION_TYPE_TRUE, EXPRESSION_TYPE_FALSE))) {
                if ($expression['case_sensitive']) {
                    $results[$id] = ereg($paterns[0], $test_string);
                } else {
                    $results[$id] = eregi($paterns[0], $test_string);
                }
                if ($expression['expression_type'] == EXPRESSION_TYPE_TRUE) {
                    $final_result &= $results[$id];
                } else {
                    $final_result &= !$results[$id];
                }
            } else {
                $results[$id] = true;
                $tmp_result = false;
                if ($expression['case_sensitive']) {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_stristr($test_string, $patern) !== false;
                    }
                } else {
                    foreach ($paterns as $pid => $patern) {
                        $tmp_result |= zbx_strstr($test_string, $patern) !== false;
                    }
                }
                $results[$id] &= $tmp_result;
                $final_result &= $results[$id];
            }
        }
        if (isset($results[$id]) && $results[$id]) {
            $exp_res = new CSpan(S_TRUE_BIG, 'green bold');
        } else {
            $exp_res = new CSpan(S_FALSE_BIG, 'red bold');
        }
        $expec_result = expression_type2str($expression['expression_type']);
        if (EXPRESSION_TYPE_ANY_INCLUDED == $expression['expression_type']) {
            $expec_result .= ' (' . S_DELIMITER . "='" . $expression['exp_delimiter'] . "')";
        }
        $tabExp->addRow(array($expression['expression'], $expec_result, $exp_res));
    }
    $td = new CCol(S_COMBINED_RESULT, 'bold');
    $td->setColSpan(2);
    if ($final_result) {
        $final_result = new CSpan(S_TRUE_BIG, 'green bold');
    } else {
        $final_result = new CSpan(S_FALSE_BIG, 'red bold');
    }
    $tabExp->addRow(array($td, $final_result));
    $tblRE->addRow(array(S_RESULT, $tabExp));
    $tblFoot = new CTableInfo(null);
    $td = new CCol(array(new CButton('save', S_SAVE)));
    $td->setColSpan(2);
    $td->addStyle('text-align: right;');
    $td->addItem(SPACE);
    $td->addItem(new CButton('test', S_TEST));
    if (isset($_REQUEST['regexpid'])) {
        $td->addItem(SPACE);
        $td->addItem(new CButton('clone', S_CLONE));
        $td->addItem(SPACE);
        $td->addItem(new CButtonDelete(S_DELETE_REGULAR_EXPRESSION_Q, url_param('form') . url_param('config') . url_param('regexpid')));
    }
    $td->addItem(SPACE);
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例4: setDoubleHeader

 /**
  * Set widget header with left and right parts.
  *
  * @param string|array|CTag $leftColumn
  * @param string|array|CTag $rightColumn
  */
 public function setDoubleHeader($leftColumn, $rightColumn)
 {
     $leftColumn = (new CCol($leftColumn))->addStyle('text-align: left; border: 0;');
     $rightColumn = (new CCol($rightColumn))->addStyle('text-align: right; border: 0;');
     $table = new CTable();
     $table->addStyle('width: 100%;');
     $table->addRow([$leftColumn, $rightColumn]);
     $this->header = (new CDiv($table))->addClass(ZBX_STYLE_NOWRAP)->addClass('ui-widget-header header');
     return $this;
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:16,代码来源:CUiWidget.php

示例5: setDoubleHeader

 /**
  * Set widget header with left and right parts.
  *
  * @param string|array|CTag $leftColumn
  * @param string|array|CTag $rightColumn
  */
 public function setDoubleHeader($leftColumn, $rightColumn)
 {
     $leftColumn = new CCol($leftColumn);
     $leftColumn->addStyle('text-align: left; border: 0;');
     $rightColumn = new CCol($rightColumn);
     $rightColumn->addStyle('text-align: right; border: 0;');
     $table = new CTable();
     $table->addStyle('width: 100%;');
     $table->addRow(array($leftColumn, $rightColumn));
     $this->header = new CDiv($table, 'nowrap ui-corner-all ui-widget-header header');
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:17,代码来源:CUiWidget.php

示例6: CComboBox

     $cmbDrawType->addItem($dt, graph_item_drawtype2str($dt));
 }
 // Yaxisside selector
 $cmbYaxisside = new CComboBox('yaxisside', $yaxisside);
 foreach (array(0, 1) as $side) {
     $cmbYaxisside->addItem($side, $side == 0 ? _('Left') : _('Right'));
 }
 $graph_params_w = new CWidget();
 $graph_params_w->setClass('header');
 $graph_params_w->addHeader(_('Graphs'));
 $graph_params_div = new CDiv();
 $graph_params_div->setAttribute("id", "graphparams");
 $graph_params_div->addStyle("width: {$right_widget_width};");
 $graph_params_tbl = new CTable();
 $graph_params_tbl->attr('class', 'formtable');
 $graph_params_tbl->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl->setCellPadding(0);
 $graph_params_tbl->setCellSpacing(0);
 $graph_params_tbl1 = new CTable();
 $graph_params_tbl1->attr('class', 'formtable');
 $graph_params_tbl1->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl1->addRow(array(_('Create graph'), $graphCreate, _('Name') . ':', $graphName, _('Width') . ':', $graphWidth, _('Height') . ':', $graphHeight, _('Graph type') . ':', $cmbGraphType));
 $graph_params_tbl2 = new CTable();
 $graph_params_tbl2->attr('class', 'formtable');
 $graph_params_tbl2->addStyle("width: 100%; align: left; border-width: 0 0 0 0;");
 $graph_params_tbl2->addRow(array(_('Function') . ':', $cmbGraphFunc, _('Draw style') . ':', $cmbDrawType, _('Y axis side') . ':', $cmbYaxisside));
 $graph_params_tbl->addRow($graph_params_tbl1);
 $graph_params_tbl->addRow($graph_params_tbl2);
 $graph_params_div->addItem($graph_params_tbl);
 $graph_params_w->addItem($graph_params_div);
 $right_tab->addRow($empty_row);
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:snmp_builder.php

示例7: CForm

                            $regexp[$exp['regexpid']]['expressions'][$exp['expressionid']] = $exp;
                        }
                        $form = new CForm(null, 'post');
                        $form->setName('regexp');
                        $table = new CTableInfo();
                        $table->setHeader(array(new CCheckBox('all_regexps', NULL, "checkAll('" . $form->GetName() . "','all_regexps','regexpids');"), S_NAME, S_EXPRESSIONS));
                        foreach ($regexps as $regexpid => $regexp) {
                            $table->addRow(array(new CCheckBox('regexpids[' . $regexp['regexpid'] . ']', NULL, NULL, $regexp['regexpid']), new CLink($regexp['name'], 'config.php?form=update' . url_param('config') . '&regexpid=' . $regexp['regexpid'] . '#form'), isset($expressions[$regexpid]) ? $expressions[$regexpid] : '-'));
                        }
                        $table->setFooter(new CCol(array(new CButtonQMessage('delete', S_DELETE_SELECTED, S_DELETE_SELECTED_REGULAR_EXPRESSIONS_Q))));
                        $form->addItem($table);
                        $cnf_wdgt->addItem($form);
                    }
                } else {
                    if ($_REQUEST['config'] == 11) {
                        // Macros
                        $form = new CForm();
                        $tbl = new CTable();
                        $tbl->addRow(get_macros_widget());
                        $tbl->addStyle('width: 50%;');
                        $tbl->addStyle('margin: 0 auto;');
                        $form->addItem($tbl);
                        $cnf_wdgt->addItem($form);
                    }
                }
            }
        }
    }
}
$cnf_wdgt->show();
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:config.php


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