本文整理汇总了PHP中CProfile::updateArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CProfile::updateArray方法的具体用法?PHP CProfile::updateArray怎么用?PHP CProfile::updateArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CProfile
的用法示例。
在下文中一共展示了CProfile::updateArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
}
if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
require_once dirname(__FILE__) . '/include/page_footer.php';
exit;
}
require_once dirname(__FILE__) . '/include/views/js/monitoring.latest.js.php';
/*
* Filter
*/
if (hasRequest('filter_set')) {
CProfile::update('web.latest.filter.select', getRequest('select', ''), PROFILE_TYPE_STR);
CProfile::update('web.latest.filter.show_without_data', getRequest('show_without_data', 0), PROFILE_TYPE_INT);
CProfile::update('web.latest.filter.show_details', getRequest('show_details', 0), PROFILE_TYPE_INT);
CProfile::update('web.latest.filter.application', getRequest('application', ''), PROFILE_TYPE_STR);
CProfile::updateArray('web.latest.filter.groupids', getRequest('groupids', array()), PROFILE_TYPE_STR);
CProfile::updateArray('web.latest.filter.hostids', getRequest('hostids', array()), PROFILE_TYPE_STR);
} elseif (hasRequest('filter_rst')) {
DBStart();
CProfile::delete('web.latest.filter.select');
CProfile::delete('web.latest.filter.show_without_data');
CProfile::delete('web.latest.filter.show_details');
CProfile::delete('web.latest.filter.application');
CProfile::deleteIdx('web.latest.filter.groupids');
CProfile::deleteIdx('web.latest.filter.hostids');
DBend();
}
$filter = array('select' => CProfile::get('web.latest.filter.select', ''), 'showWithoutData' => CProfile::get('web.latest.filter.show_without_data', 1), 'showDetails' => CProfile::get('web.latest.filter.show_details'), 'application' => CProfile::get('web.latest.filter.application', ''), 'groupids' => CProfile::getArray('web.latest.filter.groupids'), 'hostids' => CProfile::getArray('web.latest.filter.hostids'));
// we'll need to hide the host column if only one host is selected
$singleHostSelected = count($filter['hostids']) == 1;
$sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'name'));
$sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
示例2: getRequest
// ack status
if ($config['event_ack_enable'] == EVENT_ACK_ENABLED) {
CProfile::update('web.overview.filter.ack_status', getRequest('ack_status', ZBX_ACK_STS_ANY), PROFILE_TYPE_INT);
}
// update host inventory filter
$inventoryFields = [];
$inventoryValues = [];
foreach (getRequest('inventory', []) as $field) {
if ($field['value'] === '') {
continue;
}
$inventoryFields[] = $field['field'];
$inventoryValues[] = $field['value'];
}
CProfile::updateArray('web.overview.filter.inventory.field', $inventoryFields, PROFILE_TYPE_STR);
CProfile::updateArray('web.overview.filter.inventory.value', $inventoryValues, PROFILE_TYPE_STR);
} elseif (hasRequest('filter_rst')) {
DBStart();
CProfile::delete('web.overview.filter.show_triggers');
CProfile::delete('web.overview.filter.show_maintenance');
CProfile::delete('web.overview.filter.ack_status');
CProfile::delete('web.overview.filter.show_severity');
CProfile::delete('web.overview.filter.txt_select');
CProfile::delete('web.overview.filter.status_change');
CProfile::delete('web.overview.filter.status_change_days');
CProfile::delete('web.overview.filter.application');
CProfile::deleteIdx('web.overview.filter.inventory.field');
CProfile::deleteIdx('web.overview.filter.inventory.value');
DBend();
}
// overview type
示例3: getRequest
// ack status
if ($config['event_ack_enable'] == EVENT_ACK_ENABLED) {
CProfile::update('web.tr_status.filter.ack_status', getRequest('ack_status', ZBX_ACK_STS_ANY), PROFILE_TYPE_INT);
}
// update host inventory filter
$inventoryFields = array();
$inventoryValues = array();
foreach (getRequest('inventory', array()) as $field) {
if ($field['value'] === '') {
continue;
}
$inventoryFields[] = $field['field'];
$inventoryValues[] = $field['value'];
}
CProfile::updateArray('web.tr_status.filter.inventory.field', $inventoryFields, PROFILE_TYPE_STR);
CProfile::updateArray('web.tr_status.filter.inventory.value', $inventoryValues, PROFILE_TYPE_STR);
} elseif (hasRequest('filter_rst')) {
DBStart();
CProfile::delete('web.tr_status.filter.show_triggers');
CProfile::delete('web.tr_status.filter.show_details');
CProfile::delete('web.tr_status.filter.show_maintenance');
CProfile::delete('web.tr_status.filter.show_events');
CProfile::delete('web.tr_status.filter.ack_status');
CProfile::delete('web.tr_status.filter.show_severity');
CProfile::delete('web.tr_status.filter.txt_select');
CProfile::delete('web.tr_status.filter.status_change');
CProfile::delete('web.tr_status.filter.status_change_days');
CProfile::delete('web.tr_status.filter.application');
CProfile::deleteIdx('web.tr_status.filter.inventory.field');
CProfile::deleteIdx('web.tr_status.filter.inventory.value');
DBend();
示例4: check_fields
$fields = ['groupids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'hostids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null], 'severities' => [T_ZBX_INT, O_OPT, P_SYS, null, null], 'filter_from' => [T_ZBX_STR, O_OPT, P_UNSET_EMPTY, null, null], 'filter_till' => [T_ZBX_STR, O_OPT, P_UNSET_EMPTY, null, null], 'filter_rst' => [T_ZBX_STR, O_OPT, P_SYS, null, null], 'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null]];
check_fields($fields);
$data['config'] = select_config();
/*
* Filter
*/
$today = mktime(0, 0, 0, date('n'), date('j'), date('Y'));
$tomorrow = $today + SEC_PER_DAY;
$timeFrom = hasRequest('filter_from') ? zbxDateToTime(getRequest('filter_from')) : $today;
$timeTill = hasRequest('filter_till') ? zbxDateToTime(getRequest('filter_till')) : $tomorrow;
if (hasRequest('filter_set')) {
// prepare severity array
$severities = hasRequest('severities') ? array_keys(getRequest('severities')) : [];
CProfile::updateArray('web.toptriggers.filter.severities', $severities, PROFILE_TYPE_STR);
CProfile::updateArray('web.toptriggers.filter.groupids', getRequest('groupids', []), PROFILE_TYPE_STR);
CProfile::updateArray('web.toptriggers.filter.hostids', getRequest('hostids', []), PROFILE_TYPE_STR);
CProfile::update('web.toptriggers.filter.from', $timeFrom, PROFILE_TYPE_STR);
CProfile::update('web.toptriggers.filter.till', $timeTill, PROFILE_TYPE_STR);
} elseif (hasRequest('filter_rst')) {
DBstart();
CProfile::deleteIdx('web.toptriggers.filter.severities');
CProfile::deleteIdx('web.toptriggers.filter.groupids');
CProfile::deleteIdx('web.toptriggers.filter.hostids');
CProfile::delete('web.toptriggers.filter.from');
CProfile::delete('web.toptriggers.filter.till');
DBend();
}
if (!hasRequest('filter_set')) {
for ($severity = TRIGGER_SEVERITY_NOT_CLASSIFIED; $severity < TRIGGER_SEVERITY_COUNT; $severity++) {
$defaultSeverities[$severity] = $severity;
}