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


PHP CFormTable::SetHelp方法代码示例

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


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

示例1: CFormTable

//]]>
-->
</script>
<?php 
if (isset($_REQUEST['save']) && isset($_REQUEST['triggerid']) && isset($_REQUEST['dstfrm'])) {
    echo '<script language="JavaScript" type="text/javascript">
	<!--
			add_trigger_link("' . $_REQUEST['dstfrm'] . '","' . $_REQUEST['triggerid'] . '","' . $_REQUEST['drawtype'] . '","' . $_REQUEST['color'] . '");
	-->
	</script>';
} else {
    if (isset($_REQUEST['form'])) {
        echo SBR;
        $frmCnct = new CFormTable("New connector", "popup_link_tr.php");
        $frmCnct->SetHelp("web.sysmap.connector.php");
        $frmCnct->AddVar("dstfrm", $_REQUEST["dstfrm"]);
        if (isset($_REQUEST["linkid"]) && isset($_REQUEST['triggerid'])) {
            $frmCnct->AddVar("linkid", $_REQUEST["linkid"]);
            $db_link = DBfetch(DBselect('SELECT * FROM sysmaps_link_triggers WHERE linkid=' . $_REQUEST["linkid"] . ' AND triggerid=' . $_REQUEST['triggerid']));
            $triggerid = $_REQUEST['triggerid'];
            $drawtype = $db_link["drawtype"];
            $color = $db_link["color"];
        } else {
            $triggerid = get_request("triggerid", 0);
            $drawtype = get_request("drawtype", 0);
            $color = get_request("color", 0);
        }
        $frmCnct->AddVar("triggerid", $triggerid);
        /* START comboboxes preparations */
        $cmbType = new CComboBox("drawtype", $drawtype);
开发者ID:phedders,项目名称:zabbix,代码行数:30,代码来源:popup_link_tr.php

示例2: array

    $severity = array();
    for ($i = 0; $i < 6; $i++) {
        if ($rq_severity & 1 << $i) {
            $severity[$i] = $i;
        }
    }
} else {
    $severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp('web.media.php');
$frmMedia->addVar('media', $media);
$frmMedia->addVar('dstfrm', $_REQUEST['dstfrm']);
$cmbType = new CComboBox('mediatypeid', $mediatypeid);
$sql = 'SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type';
$types = DBselect($sql);
while ($type = DBfetch($types)) {
    $cmbType->addItem($type['mediatypeid'], get_node_name_by_elid($type['mediatypeid'], null, ': ') . $type['description']);
}
$frmMedia->addRow(S_TYPE, $cmbType);
$frmMedia->addRow(S_SEND_TO, new CTextBox('sendto', $sendto, 20));
$frmMedia->addRow(S_WHEN_ACTIVE, new CTextBox('period', $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
    array_push($frm_row, array(new CCheckBox('severity[' . $i . ']', str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:popup_media.php

示例3: array

    $severity = array();
    for ($i = 0; $i < 6; $i++) {
        if ($rq_severity & 1 << $i) {
            $severity[$i] = $i;
        }
    }
} else {
    $severity = get_request('severity', array(0, 1, 2, 3, 4, 5));
}
$media = get_request('media', -1);
$sendto = get_request('sendto', '');
$mediatypeid = get_request('mediatypeid', 0);
$active = get_request('active', 0);
$period = get_request('period', '1-7,00:00-23:59');
$frmMedia = new CFormTable(S_NEW_MEDIA);
$frmMedia->SetHelp("web.media.php");
$frmMedia->AddVar("media", $media);
$frmMedia->AddVar("dstfrm", $_REQUEST["dstfrm"]);
$cmbType = new CComboBox("mediatypeid", $mediatypeid);
$types = DBselect('SELECT mediatypeid,description ' . ' FROM media_type' . ' WHERE ' . DBin_node('mediatypeid') . ' ORDER BY type');
while ($type = DBfetch($types)) {
    $cmbType->AddItem($type["mediatypeid"], get_node_name_by_elid($type["mediatypeid"]) . $type["description"]);
}
$frmMedia->AddRow(S_TYPE, $cmbType);
$frmMedia->AddRow(S_SEND_TO, new CTextBox("sendto", $sendto, 20));
$frmMedia->AddRow(S_WHEN_ACTIVE, new CTextBox("period", $period, 48));
$frm_row = array();
for ($i = 0; $i <= 5; $i++) {
    array_push($frm_row, array(new CCheckBox("severity[{$i}]", str_in_array($i, $severity) ? 'yes' : 'no', null, $i), get_severity_description($i)), BR());
}
$frmMedia->AddRow(S_USE_IF_SEVERITY, $frm_row);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_media.php

示例4: CTextBox

                    $usr_test->addItem($db_user['alias'], $db_user['alias']);
                }
            }
        } else {
            $usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
        }
        $frmAuth->addRow(S_LOGIN, $usr_test);
        $frmAuth->addRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
        $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
        $frmAuth->addItemToBottomRow(new CButton('test', S_TEST));
        $frmAuth->Show();
    } else {
        if (ZBX_AUTH_HTTP == $_REQUEST['config']) {
            $form_refresh_http = get_request('form_refresh_http', 0);
            $form_refresh_http++;
            $frmAuth = new CFormTable(S_HTTP_AUTH, 'authentication.php');
            $frmAuth->SetHelp('web.authentication.php');
            $frmAuth->addVar('form_refresh_http', $form_refresh_http);
            $cmbConfig = new CCombobox('config', ZBX_AUTH_HTTP, 'submit()');
            $cmbConfig->addItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
            $cmbConfig->addItem(ZBX_AUTH_LDAP, S_LDAP);
            $cmbConfig->addItem(ZBX_AUTH_HTTP, S_HTTP);
            $frmAuth->addRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
            $action = "javascript: if(confirm('" . S_SWITCHING_HTTP . "')) return true; else return false;";
            $frmAuth->addRow(S_HTTP_AUTH . SPACE . S_ENABLED, new CCheckBox('authentication_type', ZBX_AUTH_HTTP == $config['authentication_type'], $action, ZBX_AUTH_HTTP));
            $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
            $frmAuth->Show();
        }
    }
}
include_once 'include/page_footer.php';
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:authentication.php

示例5: CFormTable

	if(el)
	{
		InsertText(el, <?php 
    echo zbx_jsvalue($expression);
    ?>
);
		close_window();
	}
}
-->
</script>
<?php 
}
echo SBR;
$form = new CFormTable(S_CONDITION);
$form->SetHelp('config_triggers.php');
$form->SetName('expression');
$form->AddVar('dstfrm', $dstfrm);
$form->AddVar('dstfld1', $dstfld1);
$form->AddVar('itemid', $itemid);
$form->AddRow(S_ITEM, array(new CTextBox('description', $description, 50, 'yes'), new CButton('select', S_SELECT, "return PopUp('popup.php?dstfrm=" . $form->GetName() . "&dstfld1=itemid&dstfld2=description&" . "srctbl=items&srcfld1=itemid&srcfld2=description',0,0,'zbx_popup_item');")));
$cmbFnc = new CComboBox('expr_type', $expr_type, 'submit()');
foreach ($functions as $id => $f) {
    foreach ($f['operators'] as $op => $txt_op) {
        $cmbFnc->AddItem($id . '[' . $op . ']', str_replace('{OP}', $txt_op, $f['description']));
    }
}
$form->AddRow(S_FUNCTION, $cmbFnc);
if (isset($functions[$function]['params'])) {
    foreach ($functions[$function]['params'] as $pid => $pf) {
        $pv = isset($param[$pid]) ? $param[$pid] : null;
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_trexpr.php

示例6: array

** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/forms.inc.php";
$page["title"] = "S_INSTALLATION";
$page["file"] = "instal.php";
include_once "include/page_header.php";
include_once "setup.php";
include_once "include/page_footer.php";
/*******************************/
/* THIS POINT NEVER BE REACHED */
/*******************************/
$fields = array("install" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "update" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL));
check_fields($fields);
if (isset($_REQUEST['install'])) {
    redirect('setup.php');
} elseif (isset($_REQUEST['update'])) {
    error('*UNDER CONSTRUCTION*');
}
$form = new CFormTable(S_INSTALLATION_UPDATE);
$form->SetHelp('install_source_web.php');
$form->AddRow(array(bold(S_NEW_INSTALLATION_BIG), BR(), BR(), bold(S_DESCRIPTION), BR(), 'Not implemented yet!', BR(), BR(), BR()), new CButton('install', S_NEW_INSTALLATION));
$form->AddRow(array(bold(S_UPDATE_BIG), BR(), BR(), bold(S_DESCRIPTION), BR(), 'Not implemented yet!', BR(), BR(), BR()), new CButton('update', S_UPDATE));
$form->Show();
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:instal.php

示例7: 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"])) {
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例8: get_screen_item_form

function get_screen_item_form()
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
    $form = new CFormTable(S_SCREEN_CELL_CONFIGURATION, 'screenedit.php#form');
    $form->SetHelp('web.screenedit.cell.php');
    if (isset($_REQUEST['screenitemid'])) {
        $iresult = DBSelect('SELECT * FROM screens_items' . ' WHERE screenid=' . $_REQUEST['screenid'] . ' AND screenitemid=' . $_REQUEST['screenitemid']);
        $form->AddVar('screenitemid', $_REQUEST['screenitemid']);
    } else {
        $form->AddVar('x', $_REQUEST['x']);
        $form->AddVar('y', $_REQUEST['y']);
    }
    if (isset($_REQUEST['screenitemid']) && !isset($_REQUEST['form_refresh'])) {
        $irow = DBfetch($iresult);
        $resourcetype = $irow['resourcetype'];
        $resourceid = $irow['resourceid'];
        $width = $irow['width'];
        $height = $irow['height'];
        $colspan = $irow['colspan'];
        $rowspan = $irow['rowspan'];
        $elements = $irow['elements'];
        $valign = $irow['valign'];
        $halign = $irow['halign'];
        $style = $irow['style'];
        $url = $irow['url'];
        $dynamic = $irow['dynamic'];
    } else {
        $resourcetype = get_request('resourcetype', 0);
        $resourceid = get_request('resourceid', 0);
        $width = get_request('width', 500);
        $height = get_request('height', 100);
        $colspan = get_request('colspan', 0);
        $rowspan = get_request('rowspan', 0);
        $elements = get_request('elements', 25);
        $valign = get_request('valign', VALIGN_DEFAULT);
        $halign = get_request('halign', HALIGN_DEFAULT);
        $style = get_request('style', 0);
        $url = get_request('url', '');
        $dynamic = get_request('dynamic', SCREEN_SIMPLE_ITEM);
    }
    $form->addVar('screenid', $_REQUEST['screenid']);
    $cmbRes = new CCombobox('resourcetype', $resourcetype, 'submit()');
    $cmbRes->addItem(SCREEN_RESOURCE_GRAPH, S_GRAPH);
    $cmbRes->addItem(SCREEN_RESOURCE_SIMPLE_GRAPH, S_SIMPLE_GRAPH);
    $cmbRes->addItem(SCREEN_RESOURCE_PLAIN_TEXT, S_PLAIN_TEXT);
    $cmbRes->addItem(SCREEN_RESOURCE_MAP, S_MAP);
    $cmbRes->addItem(SCREEN_RESOURCE_SCREEN, S_SCREEN);
    $cmbRes->addItem(SCREEN_RESOURCE_SERVER_INFO, S_SERVER_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_HOSTS_INFO, S_HOSTS_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_INFO, S_TRIGGERS_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, S_TRIGGERS_OVERVIEW);
    $cmbRes->addItem(SCREEN_RESOURCE_STATUS_OF_TRIGGERS, S_STATUS_OF_TRIGGERS);
    $cmbRes->addItem(SCREEN_RESOURCE_DATA_OVERVIEW, S_DATA_OVERVIEW);
    $cmbRes->addItem(SCREEN_RESOURCE_CLOCK, S_CLOCK);
    $cmbRes->addItem(SCREEN_RESOURCE_URL, S_URL);
    $cmbRes->addItem(SCREEN_RESOURCE_ACTIONS, S_HISTORY_OF_ACTIONS);
    $cmbRes->addItem(SCREEN_RESOURCE_EVENTS, S_HISTORY_OF_EVENTS);
    $form->addRow(S_RESOURCE, $cmbRes);
    if ($resourcetype == SCREEN_RESOURCE_GRAPH) {
        // User-defined graph
        $resourceid = graph_accessible($resourceid) ? $resourceid : 0;
        $caption = '';
        $id = 0;
        if ($resourceid > 0) {
            $result = DBselect('SELECT DISTINCT g.graphid,g.name,n.name as node_name, h.host' . ' FROM graphs g ' . ' LEFT JOIN graphs_items gi ON g.graphid=gi.graphid ' . ' LEFT JOIN items i ON gi.itemid=i.itemid ' . ' LEFT JOIN hosts h ON h.hostid=i.hostid ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('g.graphid') . ' WHERE g.graphid=' . $resourceid);
            while ($row = DBfetch($result)) {
                $row['node_name'] = isset($row['node_name']) ? '(' . $row['node_name'] . ') ' : '';
                $caption = $row['node_name'] . $row['host'] . ':' . $row['name'];
                $id = $resourceid;
            }
        }
        $form->addVar('resourceid', $id);
        $textfield = new Ctextbox('caption', $caption, 75, 'yes');
        $selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=graphs&srcfld1=graphid&srcfld2=name',800,450);");
        $selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
        $form->AddRow(S_GRAPH_NAME, array($textfield, SPACE, $selectbtn));
    } else {
        if ($resourcetype == SCREEN_RESOURCE_SIMPLE_GRAPH) {
            // Simple graph
            $caption = '';
            $id = 0;
            if ($resourceid > 0) {
                $result = DBselect('SELECT n.name as node_name,h.host,i.description,i.itemid,i.key_ ' . ' FROM hosts h,items i ' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('i.itemid') . ' WHERE h.hostid=i.hostid ' . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND ' . DBcondition('i.hostid', $available_hosts) . ' AND i.itemid=' . $resourceid);
                while ($row = DBfetch($result)) {
                    $description_ = item_description($row);
                    $row["node_name"] = isset($row["node_name"]) ? "(" . $row["node_name"] . ") " : '';
                    $caption = $row['node_name'] . $row['host'] . ': ' . $description_;
                    $id = $resourceid;
                }
            }
            $form->AddVar('resourceid', $id);
            $textfield = new Ctextbox('caption', $caption, 75, 'yes');
            $selectbtn = new Cbutton('select', S_SELECT, "javascript: return PopUp('popup.php?dstfrm=" . $form->getName() . "&dstfld1=resourceid&dstfld2=caption&srctbl=simple_graph&srcfld1=itemid&srcfld2=description',800,450);");
            $selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
            $form->AddRow(S_PARAMETER, array($textfield, SPACE, $selectbtn));
        } else {
            if ($resourcetype == SCREEN_RESOURCE_MAP) {
                // Map
                $caption = '';
//.........这里部分代码省略.........
开发者ID:phedders,项目名称:zabbix,代码行数:101,代码来源:screens.inc.php

示例9: get_screen_item_form

function get_screen_item_form()
{
    global $USER_DETAILS;
    $form = new CFormTable(S_SCREEN_CELL_CONFIGURATION, 'screenedit.php?screenid=' . $_REQUEST['screenid']);
    $form->SetHelp('web.screenedit.cell.php');
    if (isset($_REQUEST['screenitemid'])) {
        $sql = 'SELECT * ' . ' FROM screens_items' . ' WHERE screenid=' . $_REQUEST['screenid'] . ' AND screenitemid=' . $_REQUEST['screenitemid'];
        $iresult = DBSelect($sql);
        $form->addVar('screenitemid', $_REQUEST['screenitemid']);
    } else {
        $form->addVar('x', $_REQUEST['x']);
        $form->addVar('y', $_REQUEST['y']);
    }
    if (isset($_REQUEST['screenitemid']) && !isset($_REQUEST['form_refresh'])) {
        $irow = DBfetch($iresult);
        $resourcetype = $irow['resourcetype'];
        $resourceid = $irow['resourceid'];
        $width = $irow['width'];
        $height = $irow['height'];
        $colspan = $irow['colspan'];
        $rowspan = $irow['rowspan'];
        $elements = $irow['elements'];
        $valign = $irow['valign'];
        $halign = $irow['halign'];
        $style = $irow['style'];
        $url = $irow['url'];
        $dynamic = $irow['dynamic'];
    } else {
        $resourcetype = get_request('resourcetype', 0);
        $resourceid = get_request('resourceid', 0);
        $width = get_request('width', 500);
        $height = get_request('height', 100);
        $colspan = get_request('colspan', 0);
        $rowspan = get_request('rowspan', 0);
        $elements = get_request('elements', 25);
        $valign = get_request('valign', VALIGN_DEFAULT);
        $halign = get_request('halign', HALIGN_DEFAULT);
        $style = get_request('style', 0);
        $url = get_request('url', '');
        $dynamic = get_request('dynamic', SCREEN_SIMPLE_ITEM);
    }
    $form->addVar('screenid', $_REQUEST['screenid']);
    // a-z order!!!
    $cmbRes = new CCombobox('resourcetype', $resourcetype, 'submit()');
    $cmbRes->addItem(SCREEN_RESOURCE_CLOCK, S_CLOCK);
    $cmbRes->addItem(SCREEN_RESOURCE_DATA_OVERVIEW, S_DATA_OVERVIEW);
    $cmbRes->addItem(SCREEN_RESOURCE_GRAPH, S_GRAPH);
    $cmbRes->addItem(SCREEN_RESOURCE_ACTIONS, S_HISTORY_OF_ACTIONS);
    $cmbRes->addItem(SCREEN_RESOURCE_EVENTS, S_HISTORY_OF_EVENTS);
    $cmbRes->addItem(SCREEN_RESOURCE_HOSTS_INFO, S_HOSTS_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_MAP, S_MAP);
    $cmbRes->addItem(SCREEN_RESOURCE_PLAIN_TEXT, S_PLAIN_TEXT);
    $cmbRes->addItem(SCREEN_RESOURCE_SCREEN, S_SCREEN);
    $cmbRes->addItem(SCREEN_RESOURCE_SERVER_INFO, S_SERVER_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_SIMPLE_GRAPH, S_SIMPLE_GRAPH);
    $cmbRes->addItem(SCREEN_RESOURCE_HOSTGROUP_TRIGGERS, S_STATUS_OF_HOSTGROUP_TRIGGERS);
    $cmbRes->addItem(SCREEN_RESOURCE_HOST_TRIGGERS, S_STATUS_OF_HOST_TRIGGERS);
    $cmbRes->addItem(SCREEN_RESOURCE_SYSTEM_STATUS, S_SYSTEM_STATUS);
    $cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_INFO, S_TRIGGERS_INFO);
    $cmbRes->addItem(SCREEN_RESOURCE_TRIGGERS_OVERVIEW, S_TRIGGERS_OVERVIEW);
    $cmbRes->addItem(SCREEN_RESOURCE_URL, S_URL);
    $form->addRow(S_RESOURCE, $cmbRes);
    if ($resourcetype == SCREEN_RESOURCE_GRAPH) {
        // User-defined graph
        $options = array('graphids' => $resourceid, 'select_hosts' => array('hostid', 'host'), 'output' => API_OUTPUT_EXTEND);
        $graphs = CGraph::get($options);
        $caption = '';
        $id = 0;
        if (!empty($graphs)) {
            $id = $resourceid;
            $graph = reset($graphs);
            order_result($graph['hosts'], 'host');
            $graph['host'] = reset($graph['hosts']);
            $caption = $graph['host']['host'] . ':' . $graph['name'];
            $nodeName = get_node_name_by_elid($graph['host']['hostid']);
            if (!zbx_empty($nodeName)) {
                $caption = '(' . $nodeName . ') ' . $caption;
            }
        }
        $form->addVar('resourceid', $id);
        $textfield = new CTextbox('caption', $caption, 75, 'yes');
        $selectbtn = new CButton('select', S_SELECT, "javascript: return PopUp('popup.php?writeonly=1&dstfrm=" . $form->getName() . "&real_hosts=1&dstfld1=resourceid&dstfld2=caption&srctbl=graphs&srcfld1=graphid&srcfld2=name',800,450);");
        $selectbtn->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
        $form->addRow(S_GRAPH_NAME, array($textfield, SPACE, $selectbtn));
    } else {
        if ($resourcetype == SCREEN_RESOURCE_SIMPLE_GRAPH) {
            // Simple graph
            $options = array('itemids' => $resourceid, 'select_hosts' => array('hostid', 'host'), 'output' => API_OUTPUT_EXTEND);
            $items = CItem::get($options);
            $caption = '';
            $id = 0;
            if (!empty($items)) {
                $id = $resourceid;
                $item = reset($items);
                $item['host'] = reset($item['hosts']);
                $caption = item_description($item);
                $nodeName = get_node_name_by_elid($item['itemid']);
                if (!zbx_empty($nodeName)) {
                    $caption = '(' . $nodeName . ') ' . $caption;
                }
//.........这里部分代码省略.........
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:screens.inc.php

示例10: CButton

        $table->AddRow(array(array($prefix, $description), algorithm2str($db_service_data["algorithm"]), $trigger));
    }
    $cb = new CButton('cancel', S_CANCEL);
    $cb->SetType('button');
    $cb->SetAction('javascript: self.close();');
    $td = new CCol($cb);
    $td->setAttribute('style', 'text-align:right;');
    $table->SetFooter($td);
    $form->AddItem($table);
    $form->Show();
}
//--------------------------------------------	</CHILD SERVICES LIST>  --------------------------------------------
//--------------------------------------------	<FORM>  --------------------------------------------
if (isset($_REQUEST['sform'])) {
    $frmService = new CFormTable(S_SERVICE, 'services_form.php', 'POST', null, 'sform');
    $frmService->SetHelp("web.services.service.php");
    $frmService->SetTableClass('formlongtable');
    //service times
    if (isset($_REQUEST["add_service_time"]) && isset($_REQUEST["new_service_time"])) {
        $_REQUEST['service_times'] = get_request('service_times', array());
        $new_service_time['type'] = $_REQUEST["new_service_time"]['type'];
        if ($_REQUEST["new_service_time"]['type'] == SERVICE_TIME_TYPE_ONETIME_DOWNTIME) {
            $new_service_time['from'] = $_REQUEST['new_service_time']['from'];
            $new_service_time['to'] = $_REQUEST['new_service_time']['to'];
            $new_service_time['note'] = $_REQUEST["new_service_time"]['note'];
        } else {
            $new_service_time['from'] = strtotime($_REQUEST["new_service_time"]['from_week'] . ' ' . $_REQUEST["new_service_time"]['from']);
            $new_service_time['to'] = strtotime($_REQUEST["new_service_time"]['to_week'] . ' ' . $_REQUEST["new_service_time"]['to']);
            $new_service_time['note'] = $_REQUEST["new_service_time"]['note'];
        }
        while ($new_service_time['to'] && $new_service_time['to'] <= $new_service_time['from']) {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:services_form.php

示例11: insert_map_element_form

function insert_map_element_form()
{
    global $USER_DETAILS;
    $frmEl = new CFormTable('New map element', 'sysmap.php');
    $frmEl->SetHelp('web.sysmap.host.php');
    $frmEl->addVar('sysmapid', $_REQUEST['sysmapid']);
    if (isset($_REQUEST['selementid'])) {
        $frmEl->addVar('selementid', $_REQUEST['selementid']);
        $element = get_sysmaps_element_by_selementid($_REQUEST['selementid']);
        $frmEl->SetTitle('Map element "' . $element['label'] . '"');
    }
    if (isset($_REQUEST['selementid']) && !isset($_REQUEST['form_refresh'])) {
        $elementid = $element['elementid'];
        $elementtype = $element['elementtype'];
        $label = $element['label'];
        $x = $element['x'];
        $y = $element['y'];
        $url = $element['url'];
        $iconid_off = $element['iconid_off'];
        $iconid_on = $element['iconid_on'];
        $iconid_unknown = $element['iconid_unknown'];
        $iconid_disabled = $element['iconid_disabled'];
        $label_location = $element['label_location'];
        if (is_null($label_location)) {
            $label_location = -1;
        }
    } else {
        $elementid = get_request('elementid', 0);
        $elementtype = get_request('elementtype', SYSMAP_ELEMENT_TYPE_HOST);
        $label = get_request('label', '');
        $x = get_request('x', 0);
        $y = get_request('y', 0);
        $url = get_request('url', '');
        $iconid_off = get_request('iconid_off', 0);
        $iconid_on = get_request('iconid_on', 0);
        $iconid_unknown = get_request('iconid_unknown', 0);
        $iconid_disabled = get_request('iconid_disabled', 0);
        $label_location = get_request('label_location', '-1');
    }
    $cmbType = new CComboBox('elementtype', $elementtype, 'submit()');
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, null, get_current_nodeid(true));
    $sql = 'SELECT DISTINCT n.name as node_name,h.hostid,h.host ' . ' FROM hosts h' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('h.hostid') . ' WHERE ' . DBcondition('h.hostid', $available_hosts) . ' ORDER BY node_name,h.host';
    $db_hosts = DBselect($sql);
    if ($db_hosts) {
        $cmbType->addItem(SYSMAP_ELEMENT_TYPE_HOST, S_HOST);
    }
    $db_maps = DBselect('SELECT sysmapid FROM sysmaps WHERE sysmapid!=' . $_REQUEST['sysmapid']);
    if (DBfetch($db_maps)) {
        $cmbType->addItem(SYSMAP_ELEMENT_TYPE_MAP, S_MAP);
    }
    $cmbType->addItem(SYSMAP_ELEMENT_TYPE_TRIGGER, S_TRIGGER);
    $cmbType->addItem(SYSMAP_ELEMENT_TYPE_HOST_GROUP, S_HOST_GROUP);
    $cmbType->addItem(SYSMAP_ELEMENT_TYPE_IMAGE, S_IMAGE);
    $frmEl->addRow(S_TYPE, $cmbType);
    $frmEl->addRow(S_LABEL, new CTextArea('label', $label, 32, 4));
    $cmbLocation = new CComboBox('label_location', $label_location);
    $cmbLocation->addItem(-1, '-');
    $cmbLocation->addItem(0, S_BOTTOM);
    $cmbLocation->addItem(1, S_LEFT);
    $cmbLocation->addItem(2, S_RIGHT);
    $cmbLocation->addItem(3, S_TOP);
    $frmEl->addRow(S_LABEL_LOCATION, $cmbLocation);
    if ($elementtype == SYSMAP_ELEMENT_TYPE_HOST) {
        $host = '';
        $host_info = DBfetch(DBselect('SELECT DISTINCT n.name as node_name,h.hostid,h.host ' . ' FROM hosts h ' . ' LEFT JOIN nodes n ON n.nodeid=' . DBid2nodeid('h.hostid') . ' WHERE ' . DBcondition('h.hostid', $available_hosts) . ' AND hostid=' . $elementid . ' ORDER BY node_name,h.host'));
        if ($host_info) {
            $host = $host_info['host'];
        } else {
            $elementid = 0;
        }
        if ($elementid == 0) {
            $host = '';
            $elementid = 0;
        }
        $frmEl->addVar('elementid', $elementid);
        $frmEl->addRow(S_HOST, array(new CTextBox('host', $host, 32, 'yes'), new CButton('btn1', S_SELECT, "return PopUp('popup.php?dstfrm=" . $frmEl->GetName() . "&dstfld1=elementid&dstfld2=host&srctbl=hosts&srcfld1=hostid&srcfld2=host',450,450);", 'T')));
    } else {
        if ($elementtype == SYSMAP_ELEMENT_TYPE_MAP) {
            $cmbMaps = new CComboBox('elementid', $elementid);
            $db_maps = DBselect('SELECT DISTINCT n.name as node_name,s.sysmapid,s.name ' . ' FROM sysmaps s' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('s.sysmapid') . ' ORDER BY node_name,s.name');
            while ($db_map = DBfetch($db_maps)) {
                if (!sysmap_accessible($db_map['sysmapid'], PERM_READ_ONLY)) {
                    continue;
                }
                $node_name = isset($db_map['node_name']) ? '(' . $db_map['node_name'] . ') ' : '';
                $cmbMaps->addItem($db_map['sysmapid'], $node_name . $db_map['name']);
            }
            $frmEl->addRow(S_MAP, $cmbMaps);
        } else {
            if ($elementtype == SYSMAP_ELEMENT_TYPE_TRIGGER) {
                $available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY, get_current_nodeid(true));
                $trigger = '';
                $trigger_info = DBfetch(DBselect('SELECT DISTINCT n.name as node_name,h.hostid,h.host,t.*' . ' FROM triggers t ' . ' LEFT JOIN functions f on t.triggerid=f.triggerid ' . ' LEFT JOIN items i on i.itemid=f.itemid ' . ' LEFT JOIN hosts h on h.hostid=i.hostid ' . ' LEFT JOIN nodes n on n.nodeid=' . DBid2nodeid('t.triggerid') . ' WHERE t.triggerid=' . $elementid . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' ORDER BY node_name,h.host,t.description'));
                if ($trigger_info) {
                    $trigger = expand_trigger_description_by_data($trigger_info);
                } else {
                    $elementid = 0;
                }
                if ($elementid == 0) {
                    $trigger = '';
//.........这里部分代码省略.........
开发者ID:phedders,项目名称:zabbix,代码行数:101,代码来源:forms.inc.php

示例12: CButton

$frmForm->addItem($cmbConf);
if (!isset($_REQUEST['form'])) {
    $frmForm->addItem(new CButton('form', S_NEW_NODE));
}
show_table_header(S_CONFIGURATION_OF_NODES, $frmForm);
if (isset($_REQUEST['form'])) {
    global $ZBX_CURMASTERID;
    $frm_title = S_NODE;
    if (isset($_REQUEST['nodeid'])) {
        $node_data = get_node_by_nodeid($_REQUEST['nodeid']);
        $node_type = detect_node_type($node_data);
        $masterid = $node_data['masterid'];
        $frm_title = S_NODE . ' "' . $node_data['name'] . '"';
    }
    $frmNode = new CFormTable($frm_title);
    $frmNode->SetHelp('node.php');
    if (isset($_REQUEST['nodeid'])) {
        $frmNode->addVar('nodeid', $_REQUEST['nodeid']);
    }
    if (isset($_REQUEST['nodeid']) && (!isset($_REQUEST['form_refresh']) || isset($_REQUEST['register']))) {
        $new_nodeid = $node_data['nodeid'];
        $name = $node_data['name'];
        $timezone = $node_data['timezone'];
        $ip = $node_data['ip'];
        $port = $node_data['port'];
        $slave_history = $node_data['slave_history'];
        $slave_trends = $node_data['slave_trends'];
    } else {
        $new_nodeid = get_request('new_nodeid', 0);
        $name = get_request('name', '');
        $timezone = get_request('timezone', 0);
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:nodes.php

示例13: define

     define('S_NEW_LOCALE_STEP_4_5', 'For example see implementation of other locales.');
     $help_table->addRow(array(S_STEP . SPACE . '1:', S_NEW_LOCALE_STEP_1));
     $help_table->addRow(array(S_STEP . SPACE . '2:', S_NEW_LOCALE_STEP_2));
     $help_table->addRow(array(S_STEP . SPACE . '3:', array(S_NEW_LOCALE_STEP_3_1, BR(), S_NEW_LOCALE_STEP_3_2)));
     $help_table->addRow(array(S_STEP . SPACE . '4:', array(S_NEW_LOCALE_STEP_4_1, BR(), S_NEW_LOCALE_STEP_4_2, BR(), S_NEW_LOCALE_STEP_4_3, BR(), S_NEW_LOCALE_STEP_4_4, BR(), S_NEW_LOCALE_STEP_4_5)));
 } else {
     $help_table->addRow(array(S_STEP . SPACE . '1:', 'Download newly created locale file by pressing "Download".'));
     $help_table->addRow(array(S_STEP . SPACE . '2:', 'Place it to "/PATH_TO_ZABBIX_FRONTEND/include/locales".'));
     $help_table->addRow(array(S_STEP . SPACE . '3:', 'Replace previous locale file with one you have downloaded.'));
 }
 $help->SetHint($help_table);
 show_table_header(array($help, S_LOCALES));
 echo SBR;
 $frmLcls = new CFormTable(S_CREATE . SPACE . S_LOCALE_SMALL . SPACE . S_FROM_SMALL . SPACE . $ZBX_LOCALES[$_REQUEST['srclang']], 'locales.php?action=1', 'post', null, 'form');
 $frmLcls->addOption('id', 'locales');
 $frmLcls->SetHelp($help);
 $fileFrom = 'include/locales/' . $_REQUEST['srclang'] . '.inc.php';
 if (preg_match('/^[a-z0-9_]+$/i', $_REQUEST['srclang']) && file_exists($fileFrom)) {
     include $fileFrom;
     if (!isset($TRANSLATION) || !is_array($TRANSLATION)) {
         error('Passed SOURCE is NOT valid PHP file.');
     }
     $transFrom = $TRANSLATION;
 }
 unset($TRANSLATION);
 $frmLcls->addVar('extlang', $_REQUEST['extlang']);
 if (preg_match('/^[a-z0-9_]+$/i', $_REQUEST['extlang']) && $_REQUEST['extlang'] != 'new') {
     $fileTo = 'include/locales/' . $_REQUEST['extlang'] . '.inc.php';
     if (file_exists($fileTo)) {
         include $fileTo;
         if (!isset($TRANSLATION) || !is_array($TRANSLATION)) {
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:locales.php

示例14: CLink

                     $imagetype = S_BACKGROUND;
                 } else {
                     $imagetype = S_UNKNOWN;
                 }
             }
             $name = new CLink($row['name'], 'config.php?form=update' . url_param('config') . '&imageid=' . $row['imageid']);
             $table->addRow(array($name, $imagetype, $actions = new CLink(new CImg('image.php?height=24&imageid=' . $row['imageid'], 'no image', NULL), 'image.php?imageid=' . $row['imageid'])));
         }
         $table->show();
     }
 } elseif ($_REQUEST['config'] == 6) {
     // Value Mapping
     echo SBR;
     if (isset($_REQUEST['form'])) {
         $frmValmap = new CFormTable(S_VALUE_MAP);
         $frmValmap->SetHelp("web.mapping.php");
         $frmValmap->addVar("config", get_request("config", 6));
         if (isset($_REQUEST["valuemapid"])) {
             $frmValmap->addVar("valuemapid", $_REQUEST["valuemapid"]);
             $db_valuemaps = DBselect("select * FROM valuemaps" . " WHERE valuemapid=" . $_REQUEST["valuemapid"]);
             $db_valuemap = DBfetch($db_valuemaps);
             $frmValmap->SetTitle(S_VALUE_MAP . ' "' . $db_valuemap["name"] . '"');
         }
         if (isset($_REQUEST["valuemapid"]) && !isset($_REQUEST["form_refresh"])) {
             $valuemap = array();
             $mapname = $db_valuemap["name"];
             $mappings = DBselect("select * FROM mappings WHERE valuemapid=" . $_REQUEST["valuemapid"]);
             while ($mapping = DBfetch($mappings)) {
                 $value = array("value" => $mapping["value"], "newvalue" => $mapping["newvalue"]);
                 array_push($valuemap, $value);
             }
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:config.php


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