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


PHP show_messages函数代码示例

本文整理汇总了PHP中show_messages函数的典型用法代码示例。如果您正苦于以下问题:PHP show_messages函数的具体用法?PHP show_messages怎么用?PHP show_messages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: show_form_add_contact

function show_form_add_contact($contact = array(), $messages = array())
{
    //Определяем значение переменной
    $message_html = show_messages($messages);
    /*Подключаем шаблон*/
    return template_get("contacts/add_contact", array('name' => $contact['name'], 'message' => $message_html));
}
开发者ID:jsib,项目名称:intranet,代码行数:7,代码来源:add_contact.php

示例2: local_showMessage

function local_showMessage()
{
    global $ZBX_MESSAGES;
    if (CSession::keyExists('messageOk') || CSession::keyExists('messageError')) {
        if (CSession::keyExists('messages')) {
            $ZBX_MESSAGES = CSession::getValue('messages');
            CSession::unsetValue(['messages']);
        }
        if (CSession::keyExists('messageOk')) {
            show_messages(true, CSession::getValue('messageOk'));
        } else {
            show_messages(false, null, CSession::getValue('messageError'));
        }
        CSession::unsetValue(['messageOk', 'messageError']);
    }
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:16,代码来源:layout.htmlpage.php

示例3: array

include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('dstfrm' => array(T_ZBX_STR, O_MAND, P_SYS, NOT_EMPTY, null), 'graphid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), 'gid' => array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3'), 'isset({save})'), 'list_name' => array(T_ZBX_STR, O_OPT, P_SYS, NOT_EMPTY, 'isset({save})&&isset({gid})'), 'itemid' => array(T_ZBX_INT, O_OPT, null, DB_ID . '({}!=0)', 'isset({save})'), 'color' => array(T_ZBX_CLR, O_OPT, null, null, 'isset({save})'), 'drawtype' => array(T_ZBX_INT, O_OPT, null, IN(graph_item_drawtypes()), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'sortorder' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 65535), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'yaxisside' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'calc_fnc' => array(T_ZBX_INT, O_OPT, null, IN('1,2,4,7,9'), 'isset({save})'), 'type' => array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({save})'), 'periods_cnt' => array(T_ZBX_INT, O_OPT, null, BETWEEN(0, 360), 'isset({save})'), 'only_hostid' => array(T_ZBX_INT, O_OPT, null, DB_ID, null), 'monitored_hosts' => array(T_ZBX_INT, O_OPT, null, IN('0,1'), null), 'add' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 'form_refresh' => array(T_ZBX_STR, O_OPT, null, null, null));
check_fields($fields);
insert_js_function('add_graph_item');
insert_js_function('update_graph_item');
$_REQUEST['drawtype'] = get_request('drawtype', 0);
$_REQUEST['yaxisside'] = get_request('yaxisside', 0);
$_REQUEST['sortorder'] = get_request('sortorder', 0);
$graphid = get_request('graphid', false);
if (isset($_REQUEST['type']) && $_REQUEST['type'] == GRAPH_ITEM_SUM && $graphid !== false) {
    $sql = 'SELECT COUNT(itemid) as items' . ' FROM graphs_items ' . ' WHERE type=' . GRAPH_ITEM_SUM . ' AND graphid=' . $graphid . ' AND itemid<>' . $_REQUEST['itemid'];
    $res = DBselect($sql);
    while ($rows = DBfetch($res)) {
        if (isset($rows['items']) && $rows['items'] > 0) {
            show_messages(false, null, S_ANOTHER_ITEM_SUM);
            if (isset($_REQUEST['save'])) {
                unset($_REQUEST['save']);
            }
            $_REQUEST['type'] = GRAPH_ITEM_SIMPLE;
        }
    }
}
if (isset($_REQUEST['save']) && !isset($_REQUEST['gid'])) {
    $script = "add_graph_item('" . $_REQUEST['dstfrm'] . "','" . $_REQUEST['itemid'] . "','" . $_REQUEST['color'] . "'," . $_REQUEST['drawtype'] . "," . $_REQUEST['sortorder'] . "," . $_REQUEST['yaxisside'] . "," . $_REQUEST['calc_fnc'] . "," . $_REQUEST['type'] . "," . $_REQUEST['periods_cnt'] . ");\n";
    insert_js($script);
}
if (isset($_REQUEST['save']) && isset($_REQUEST['gid'])) {
    $script = "update_graph_item('" . $_REQUEST['dstfrm'] . "','" . $_REQUEST['list_name'] . "','" . $_REQUEST['gid'] . "','" . $_REQUEST['itemid'] . "','" . $_REQUEST['color'] . "'," . $_REQUEST['drawtype'] . "," . $_REQUEST['sortorder'] . "," . $_REQUEST['yaxisside'] . "," . $_REQUEST['calc_fnc'] . "," . $_REQUEST['type'] . "," . $_REQUEST['periods_cnt'] . ");\n";
    insert_js($script);
} else {
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:popup_gitem.php

示例4: access_deny

$trigger = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'expandDescription' => true]);
if (!$trigger) {
    access_deny();
}
$trigger = reset($trigger);
/*
 * Actions
 */
if (hasRequest('update')) {
    DBstart();
    $result = DBexecute('UPDATE triggers' . ' SET comments=' . zbx_dbstr(getRequest('comments')) . ' WHERE triggerid=' . zbx_dbstr(getRequest('triggerid')));
    $trigger['comments'] = $_REQUEST['comments'];
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_TRIGGER, _('Trigger') . ' [' . $_REQUEST['triggerid'] . '] [' . $trigger['description'] . '] ' . _('Comments') . ' [' . $_REQUEST['comments'] . ']');
    }
    $result = DBend($result);
    show_messages($result, _('Description updated'), _('Cannot update description'));
} elseif (isset($_REQUEST['cancel'])) {
    jsRedirect('tr_status.php');
    exit;
}
/*
 * Display
 */
$triggerEditable = API::Trigger()->get(['triggerids' => $_REQUEST['triggerid'], 'output' => ['triggerid'], 'editable' => true]);
$data = ['triggerid' => getRequest('triggerid'), 'trigger' => $trigger, 'isTriggerEditable' => !empty($triggerEditable), 'isCommentExist' => !empty($trigger['comments'])];
// render view
$triggerCommentView = new CView('monitoring.triggerComment', $data);
$triggerCommentView->render();
$triggerCommentView->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:tr_comments.php

示例5: add_mediatype

        /* ADD */
        /*			$action = AUDIT_ACTION_ADD;*/
        $result = add_mediatype($_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
        show_messages($result, S_ADDED_NEW_MEDIA_TYPE, S_NEW_MEDIA_TYPE_WAS_NOT_ADDED);
    }
    if ($result) {
        /*			add_audit($action,AUDIT_RESOURCE_MEDIA_TYPE,
        				"Media type [".$_REQUEST["description"]."]");
        */
        unset($_REQUEST["form"]);
    }
} elseif (isset($_REQUEST["delete"]) && isset($_REQUEST["mediatypeid"])) {
    /* DELETE */
    /*		$mediatype=get_mediatype_by_mediatypeid($_REQUEST["mediatypeid"]);*/
    $result = delete_mediatype($_REQUEST["mediatypeid"]);
    show_messages($result, S_MEDIA_TYPE_DELETED, S_MEDIA_TYPE_WAS_NOT_DELETED);
    if ($result) {
        /*			add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_MEDIA_TYPE,
        				"Media type [".$mediatype["description"]."]");
        */
        unset($_REQUEST["form"]);
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MEDIA_TYPE));
$row_count = 0;
$numrows = new CSpan(null, 'info');
$numrows->addOption('name', 'numrows');
$header = get_table_header(array(S_CONFIGURATION_OF_MEDIA_TYPES_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows));
show_table_header($header, $form);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:media_types.php

示例6: make_status_of_zbx

function make_status_of_zbx()
{
    $table = new CTableInfo();
    $table->setHeader(array(S_PARAMETER, S_VALUE, S_DETAILS));
    show_messages();
    //because in function get_status(); function clear_messages() is called when fsockopen() fails.
    $status = get_status();
    $table->addRow(array(S_ZABBIX_SERVER_IS_RUNNING, new CSpan($status['zabbix_server'], $status['zabbix_server'] == S_YES ? 'off' : 'on'), ' - '));
    //	$table->addRow(array(S_VALUES_STORED,$status['history_count']));$table->addRow(array(S_TRENDS_STORED,$status['trends_count']));
    $title = new CSpan(S_NUMBER_OF_HOSTS);
    $title->setAttribute('title', 'asdad');
    $table->addRow(array(S_NUMBER_OF_HOSTS, $status['hosts_count'], array(new CSpan($status['hosts_count_monitored'], 'off'), ' / ', new CSpan($status['hosts_count_not_monitored'], 'on'), ' / ', new CSpan($status['hosts_count_template'], 'unknown'))));
    $title = new CSpan(S_NUMBER_OF_ITEMS);
    $title->setAttribute('title', S_NUMBER_OF_ITEMS_TOOLTIP);
    $table->addRow(array($title, $status['items_count'], array(new CSpan($status['items_count_monitored'], 'off'), ' / ', new CSpan($status['items_count_disabled'], 'on'), ' / ', new CSpan($status['items_count_not_supported'], 'unknown'))));
    $title = new CSpan(S_NUMBER_OF_TRIGGERS);
    $title->setAttribute('title', S_NUMBER_OF_TRIGGERS_TOOLTIP);
    $table->addRow(array($title, $status['triggers_count'], array($status['triggers_count_enabled'], ' / ', $status['triggers_count_disabled'] . SPACE . SPACE . '[', new CSpan($status['triggers_count_on'], 'on'), ' / ', new CSpan($status['triggers_count_unknown'], 'unknown'), ' / ', new CSpan($status['triggers_count_off'], 'off'), ']')));
    /*	$table->addRow(array(S_NUMBER_OF_EVENTS,$status['events_count'],' - '));
    	$table->addRow(array(S_NUMBER_OF_ALERTS,$status['alerts_count'],' - '));*/
    //Log Out 10min
    $sql = 'SELECT DISTINCT u.userid, MAX(s.lastaccess) as lastaccess, MAX(u.autologout) as autologout, s.status ' . ' FROM users u ' . ' LEFT JOIN sessions s ON s.userid=u.userid AND s.status=' . ZBX_SESSION_ACTIVE . ' WHERE ' . DBin_node('u.userid') . ' GROUP BY u.userid,s.status';
    $db_users = DBSelect($sql);
    $usr_cnt = 0;
    $online_cnt = 0;
    while ($user = DBFetch($db_users)) {
        $online_time = $user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout'] ? ZBX_USER_ONLINE_TIME : $user['autologout'];
        if (!is_null($user['lastaccess']) && $user['lastaccess'] + $online_time >= time() && ZBX_SESSION_ACTIVE == $user['status']) {
            $online_cnt++;
        }
        $usr_cnt++;
    }
    $table->addRow(array(S_NUMBER_OF_USERS, $usr_cnt, new CSpan($online_cnt, 'green')));
    $table->addRow(array(S_REQUIRED_SERVER_PERFORMANCE_NVPS, $status['qps_total'], ' - '));
    $table->setFooter(new CCol(S_UPDATED . ': ' . date("H:i:s", time())));
    return $table;
}
开发者ID:phedders,项目名称:zabbix,代码行数:37,代码来源:blocks.inc.php

示例7: getRegexp

        $regExps[$regExpId] = getRegexp($regExpId);
    }
    DBstart();
    $result = DBexecute('DELETE FROM regexps WHERE ' . dbConditionInt('regexpid', $regExpIds));
    $regExpCount = count($regExpIds);
    if ($result) {
        foreach ($regExps as $regExpId => $regExp) {
            add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_REGEXP, 'Id [' . $regExpId . '] ' . _('Name') . ' [' . $regExp['name'] . ']');
        }
        unset($_REQUEST['form'], $_REQUEST['regexpid']);
    }
    $result = DBend($result);
    if ($result) {
        uncheckTableRows();
    }
    show_messages($result, _n('Regular expression deleted', 'Regular expressions deleted', $regExpCount), _n('Cannot delete regular expression', 'Cannot delete regular expressions', $regExpCount));
}
/*
 * Display
 */
if (isset($_REQUEST['form'])) {
    $data = ['form_refresh' => getRequest('form_refresh'), 'regexpid' => getRequest('regexpid')];
    if (isset($_REQUEST['regexpid']) && !isset($_REQUEST['form_refresh'])) {
        $regExp = DBfetch(DBSelect('SELECT re.name,re.test_string' . ' FROM regexps re' . ' WHERE re.regexpid=' . zbx_dbstr($_REQUEST['regexpid'])));
        $data['name'] = $regExp['name'];
        $data['test_string'] = $regExp['test_string'];
        $data['expressions'] = DBfetchArray(DBselect('SELECT e.expressionid,e.expression,e.expression_type,e.exp_delimiter,e.case_sensitive' . ' FROM expressions e' . ' WHERE e.regexpid=' . zbx_dbstr($_REQUEST['regexpid']) . ' ORDER BY e.expression_type'));
    } else {
        $data['name'] = getRequest('name', '');
        $data['test_string'] = getRequest('test_string', '');
        $data['expressions'] = getRequest('expressions', [['expression' => '', 'expression_type' => EXPRESSION_TYPE_INCLUDED, 'exp_delimiter' => ',', 'case_sensitive' => 0]]);
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.regexps.php

示例8: get_request

    } else {
        if ($_REQUEST['go'] == 'delete') {
            $result = true;
            $maps = get_request('maps', array());
            DBstart();
            foreach ($maps as $mapid) {
                $result &= delete_sysmap($mapid);
                if (!$result) {
                    break;
                }
            }
            $result = DBend($result);
            if ($result) {
                unset($_REQUEST["form"]);
            }
            show_messages($result, S_MAP_DELETED, S_CANNOT_DELETE_MAP);
        }
    }
}
$form = new CForm();
$form->SetMethod('get');
$form->AddItem(new CButton("form", S_CREATE_MAP));
show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form);
echo SBR;
if (isset($_REQUEST["form"])) {
    insert_map_form();
} else {
    $form = new CForm();
    $form->setName('frm_maps');
    $numrows = new CSpan(null, 'info');
    $numrows->setAttribute('name', 'numrows');
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:sysmaps.php

示例9: show_error_message

function show_error_message($msg)
{
    show_messages(false, '', $msg);
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:4,代码来源:func.inc.php

示例10: DBstart

    $actionSuccessful = true;
    $updatedItemCount = 0;
    DBstart();
    foreach ($applications as $application) {
        foreach ($application['items'] as $item) {
            $actionSuccessful &= $enableApplicationItems ? activate_item($item['itemid']) : disable_item($item['itemid']);
            $updatedItemCount++;
        }
    }
    $actionSuccessful = DBend($actionSuccessful);
    if ($actionSuccessful) {
        uncheckTableRows($pageFilter->hostid);
    }
    $messageSuccess = $enableApplicationItems ? _n('Item enabled', 'Items enabled', $updatedItemCount) : _n('Item disabled', 'Items disabled', $updatedItemCount);
    $messageFailed = $enableApplicationItems ? _n('Cannot enable item', 'Cannot enable items', $updatedItemCount) : _n('Cannot disable item', 'Cannot disable items', $updatedItemCount);
    show_messages($actionSuccessful, $messageSuccess, $messageFailed);
}
/*
 * Display
 */
if (isset($_REQUEST['form'])) {
    $data = array('applicationid' => getRequest('applicationid'), 'form' => getRequest('form'), 'form_refresh' => getRequest('form_refresh', 0));
    if (isset($data['applicationid']) && !isset($_REQUEST['form_refresh'])) {
        $dbApplication = reset($dbApplication);
        $data['appname'] = $dbApplication['name'];
        $data['hostid'] = $dbApplication['hostid'];
    } else {
        $data['appname'] = getRequest('appname', '');
        $data['hostid'] = getRequest('hostid');
    }
    // render view
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:applications.php

示例11: show_messages

        show_messages($result, $msgOk, $msgFail);
    } catch (Exception $e) {
        DBend(false);
        error($e->getMessage());
        show_error_message($msgFail);
    }
} elseif (isset($_REQUEST['delete']) && isset($_REQUEST['imageid'])) {
    DBstart();
    $image = get_image_by_imageid($_REQUEST['imageid']);
    $result = API::Image()->delete([getRequest('imageid')]);
    if ($result) {
        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_IMAGE, 'Image [' . $image['name'] . '] deleted');
        unset($_REQUEST['form'], $image, $_REQUEST['imageid']);
    }
    $result = DBend($result);
    show_messages($result, _('Image deleted'), _('Cannot delete image'));
}
/*
 * Display
 */
$data = ['form' => getRequest('form')];
if (!empty($data['form'])) {
    if (isset($_REQUEST['imageid'])) {
        $data['imageid'] = $_REQUEST['imageid'];
        $data['imagename'] = $dbImage['name'];
        $data['imagetype'] = $dbImage['imagetype'];
    } else {
        $data['imageid'] = null;
        $data['imagename'] = getRequest('name', '');
        $data['imagetype'] = getRequest('imagetype', IMAGE_TYPE_ICON);
    }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:adm.images.php

示例12: add_audit

        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_ITEM, _('Item') . ' [' . $item['key_'] . '] [' . $id . '] ' . _('Host') . ' [' . $host['host'] . '] ' . _('History cleared'));
    }
    $go_result = DBend($go_result);
    show_messages($go_result, _('History cleared'), $go_result);
} elseif ($_REQUEST['go'] == 'delete' && isset($_REQUEST['group_itemid'])) {
    DBstart();
    $group_itemid = $_REQUEST['group_itemid'];
    $itemsToDelete = API::Item()->get(array('output' => array('key_', 'itemid'), 'selectHosts' => array('name'), 'itemids' => $group_itemid, 'preservekeys' => true));
    $go_result = API::Item()->delete($group_itemid);
    if ($go_result) {
        foreach ($itemsToDelete as $item) {
            $host = reset($item['hosts']);
            add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_ITEM, _('Item') . ' [' . $item['key_'] . '] [' . $item['itemid'] . '] ' . _('Host') . ' [' . $host['name'] . ']');
        }
    }
    show_messages(DBend($go_result), _('Items deleted'), _('Cannot delete items'));
}
if ($_REQUEST['go'] != 'none' && !empty($go_result)) {
    $url = new CUrl();
    $path = $url->getPath();
    insert_js('cookie.eraseArray("' . $path . '")');
}
/*
 * Display
 */
if (isset($_REQUEST['form']) && str_in_array($_REQUEST['form'], array(_('Create item'), 'update', 'clone'))) {
    $data = getItemFormData();
    $data['page_header'] = _('CONFIGURATION OF ITEMS');
    // render view
    $itemView = new CView('configuration.item.edit', $data);
    $itemView->render();
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:items.php

示例13: DBstart

    if ($actHosts) {
        DBstart();
        $result = updateHostStatus($actHosts, $status);
        $result = DBend($result);
        $updated = count($actHosts);
        $messageSuccess = $enable ? _n('Host enabled', 'Hosts enabled', $updated) : _n('Host disabled', 'Hosts disabled', $updated);
        $messageFailed = $enable ? _n('Cannot enable host', 'Cannot enable hosts', $updated) : _n('Cannot disable host', 'Cannot disable hosts', $updated);
        ################################################################
        # update racktables object
        require_once 'racktablesapi.php';
        $response = updateObjectStatus($hostNames, $status);
        if (isset($response['error'])) {
            show_messages(false, '', "Updating racktables object is failed. Error message:" . $response['error']);
        }
        ################################################################
        show_messages($result, $messageSuccess, $messageFailed);
        clearCookies($result);
    }
}
/*
 * Display
 */
$hostsWidget = new CWidget();
$pageFilter = new CPageFilter(array('groups' => array('real_hosts' => true, 'editable' => true), 'groupid' => get_request('groupid', null)));
$_REQUEST['groupid'] = $pageFilter->groupid;
$_REQUEST['hostid'] = get_request('hostid', 0);
if ($_REQUEST['go'] == 'massupdate' && isset($_REQUEST['hosts'])) {
    $hostsWidget->addPageHeader(_('CONFIGURATION OF HOSTS'));
    $data = array('hosts' => get_request('hosts', array()), 'visible' => get_request('visible', array()), 'mass_replace_tpls' => get_request('mass_replace_tpls'), 'mass_clear_tpls' => get_request('mass_clear_tpls'), 'groups' => get_request('groups', array()), 'newgroup' => get_request('newgroup', ''), 'status' => get_request('status', HOST_STATUS_MONITORED), 'proxy_hostid' => get_request('proxy_hostid', ''), 'ipmi_authtype' => get_request('ipmi_authtype', -1), 'ipmi_privilege' => get_request('ipmi_privilege', 2), 'ipmi_username' => get_request('ipmi_username', ''), 'ipmi_password' => get_request('ipmi_password', ''), 'inventory_mode' => get_request('inventory_mode', HOST_INVENTORY_DISABLED), 'host_inventory' => get_request('host_inventory', array()), 'templates' => get_request('templates', array()));
    // sort templates
    natsort($data['templates']);
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:31,代码来源:hosts.php

示例14: CUploadFile

            if (array_key_exists('deleteMissing', $rule)) {
                $requestRules[$ruleName]['deleteMissing'] = false;
            }
        }
        if (!isset($requestRules[$ruleName]['updateExisting']) && isset($rule['updateExisting'])) {
            $requestRules[$ruleName]['updateExisting'] = false;
        }
        if (!isset($requestRules[$ruleName]['createMissing']) && isset($rule['createMissing'])) {
            $requestRules[$ruleName]['createMissing'] = false;
        }
        if (!isset($requestRules[$ruleName]['deleteMissing']) && isset($rule['deleteMissing'])) {
            $requestRules[$ruleName]['deleteMissing'] = false;
        }
    }
    $data['rules'] = $requestRules;
}
if (isset($_FILES['import_file'])) {
    $result = false;
    // CUploadFile throws exceptions, so we need to catch them
    try {
        $file = new CUploadFile($_FILES['import_file']);
        $result = API::Configuration()->import(['format' => CImportReaderFactory::fileExt2ImportFormat($file->getExtension()), 'source' => $file->getContent(), 'rules' => $data['rules']]);
    } catch (Exception $e) {
        error($e->getMessage());
    }
    show_messages($result, _('Imported successfully'), _('Import failed'));
}
$view = new CView('conf.import', $data);
$view->render();
$view->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:conf.import.php

示例15: get_request

    } else {
        $screenItem['x'] = get_request('x');
        $screenItem['y'] = get_request('y');
        $result = API::ScreenItem()->create($screenItem);
        show_messages($result, _('Item added'), _('Cannot add item'));
    }
    DBend($result);
    if ($result) {
        add_audit_details(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCREEN, $screen['screenid'], $screen['name'], 'Cell changed ' . (isset($_REQUEST['screenitemid']) ? 'screen itemid "' . $_REQUEST['screenitemid'] . '"' : '') . (isset($_REQUEST['x']) && isset($_REQUEST['y']) ? ' coordinates "' . $_REQUEST['x'] . ',' . $_REQUEST['y'] . '"' : '') . (isset($_REQUEST['resourcetype']) ? ' resource type "' . $_REQUEST['resourcetype'] . '"' : ''));
        unset($_REQUEST['form']);
    }
} elseif (isset($_REQUEST['delete'])) {
    DBstart();
    $screenitemid = API::ScreenItem()->delete($_REQUEST['screenitemid']);
    $result = DBend($screenitemid);
    show_messages($result, _('Item deleted'), _('Cannot delete item'));
    if ($result && !empty($screenitemid)) {
        $screenitemid = reset($screenitemid);
        $screenitemid = reset($screenitemid);
        add_audit_details(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCREEN, $screen['screenid'], $screen['name'], 'Screen itemid "' . $screenitemid . '"');
    }
    unset($_REQUEST['x']);
} elseif (isset($_REQUEST['add_row'])) {
    DBexecute('UPDATE screens SET vsize=(vsize+1) WHERE screenid=' . zbx_dbstr($screen['screenid']));
    $add_row = get_request('add_row', 0);
    if ($screen['vsize'] > $add_row) {
        DBexecute('UPDATE screens_items SET y=(y+1) WHERE screenid=' . zbx_dbstr($screen['screenid']) . ' AND y>=' . zbx_dbstr($add_row));
    }
    add_audit_details(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_SCREEN, $screen['screenid'], $screen['name'], 'Row added');
} elseif (isset($_REQUEST['add_col'])) {
    DBexecute('UPDATE screens SET hsize=(hsize+1) WHERE screenid=' . zbx_dbstr($screen['screenid']));
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:screenedit.php


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