Support function extracting configuration event information

@param array event configuration record $am_eventInfo
@return array configured event info record
336745
private function getEventInfo(array $am_eventInfo) {

		// Target is taken care of - empty means everything
		if (!array_key_exists('target', $am_eventInfo)) {
			$am_eventInfo['target'] = '*';
		}
		$s_target = $am_eventInfo['target'];

		// Event is also taken care of - empty again is everything
		if (!array_key_exists('event',$am_eventInfo)) {
			$am_eventInfo['event'] = '*';
		}
		$s_event = $am_eventInfo['event'];

		// If no severity is specified, notice is used as default
		if (!array_key_exists('severity', $am_eventInfo)) {
			$am_eventInfo['severity'] = 'notice';
		}
		$s_severity = $am_eventInfo['severity'];

		// If no severity is specified, notice is used as default
		if (!array_key_exists('verbose', $am_eventInfo)) {
			$am_eventInfo['verbose'] = false;
		}
		$b_verbose = $am_eventInfo['verbose'];

		$as_filters = array();
		if (array_key_exists('filter_exception_messages_containing', $am_eventInfo) &&
		is_array($am_eventInfo['filter_exception_messages_containing'])) {
		    $as_filters = $am_eventInfo['filter_exception_messages_containing'];
		}

		$as_errorsToDrop = array();
		if (array_key_exists('filter_event_errors_containing', $am_eventInfo) &&
		is_array($am_eventInfo['filter_event_errors_containing'])) {
		    $as_errorsToDrop = $am_eventInfo['filter_event_errors_containing'];
		}
		
		return array($s_target, $s_event, $s_severity, $b_verbose, $as_errorsToDrop, $as_filters);

	}
1036030
function event_list($params) {
		if ($this->version == 1) {
			// not supported currently.
			//$request_url = "{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}";
		} elseif ($this->version == 2) {
			$request_url = "{$this->url_base}/track/event";
		}
		$response = $this->curl($request_url, array(), "GET", "tracking_event_list");
		return $response;
	}
151446
public function processExtensionInfo()
    {
        $phpinfo = '';

        $info = $this->config->get('info');
        if (\is_array($info)) {
            foreach ($info as $table) {
                $phpinfo .= "\t".'php_info_print_table_start();'.PHP_EOL;
                if (isset($table['header'])) {
                    $headerArray = [];
                    foreach ($table['header'] as $header) {
                        $headerArray[] = '"'.htmlentities($header).'"';
                    }

                    $phpinfo .= "\t".'php_info_print_table_header('.\count($headerArray).', '.
                            implode(', ', $headerArray).');'.PHP_EOL;
                }
                if (isset($table['rows'])) {
                    foreach ($table['rows'] as $row) {
                        $rowArray = [];
                        foreach ($row as $field) {
                            $rowArray[] = '"'.htmlentities($field).'"';
                        }

                        $phpinfo .= "\t".'php_info_print_table_row('.\count($rowArray).', '.
                                implode(', ', $rowArray).');'.PHP_EOL;
                    }
                }
                $phpinfo .= "\t".'php_info_print_table_end();'.PHP_EOL;
            }
        }

        return $phpinfo;
    }
682845
public function getAllActiveEvents(): array
    {
        $activeEvents = [];
        foreach (self::$eventsMap as $eventName => $eventClass) {
            if (!class_exists($eventClass)) {
                continue;
            }

            $activeEvents[] = $eventName;
        }

        $listeners = $this->eventDispatcher->getListeners();
        $activeEvents = array_unique(array_merge($activeEvents, array_keys($listeners)));

        asort($activeEvents);

        return $activeEvents;
    }
637460
def get_event_list(config):
    """"""
    eventinstances = session_request(
        config.session.post, device_event_url.format(
            proto=config.web_proto, host=config.host, port=config.port),
        auth=config.session.auth, headers=headers, data=request_xml)

    raw_event_list = _prepare_event(eventinstances)

    event_list = {}
    for entry in MAP + METAMAP:
        instance = raw_event_list
        try:
            for item in sum(entry[MAP_BASE].values(), []):
                instance = instance[item]
        except KeyError:
            continue
        event_list[entry[MAP_TYPE]] = instance

    return event_list
1118274
public function getEventsForApiFilter($restriction = null)
    {
        $resourceOption = 'resource';
        $allOption = 'all';
        $eventNames = $this->getEvents($restriction);
        sort($eventNames);
        $sortedEvents = ['all' => 'all'];
        $genericResourceEvents = ['all' => 'all'];
        $tempResourceEvents = ['all' => []];

        foreach ($eventNames as $eventName) {
            $eventNameChunks = explode('-', $eventName);
            $eventKey = "log_${eventName}_filter";

            if ($eventNameChunks[0] !== 'clacoformbundle' && !isset($sortedEvents[$eventNameChunks[0]])) {
                $sortedEvents[$eventNameChunks[0]] = ['all' => "${eventNameChunks[0]}::all"];
            }

            if ($resourceOption === $eventNameChunks[0]) {
                if (isset($eventNameChunks[2])) {
                    $tempResourceEvents[$eventNameChunks[1]][$eventKey] = $eventName;
                } else {
                    $genericResourceEvents[$eventKey] = $eventName;
                }
            } elseif ($eventNameChunks[0] === 'clacoformbundle') {
                $tempResourceEvents[$eventNameChunks[0]][$eventKey] = $eventName;
            } else {
                $sortedEvents[$eventNameChunks[0]][$eventKey] = $eventName;
            }
        }

        // adding resource types that don't define specific event classes
        $sortedEvents[$resourceOption][$allOption] = [];
        $remainingTypes = $this->om
            ->getRepository('ClarolineCoreBundle:Resource\ResourceType')
            ->findTypeNamesNotIn(array_keys($tempResourceEvents));

        foreach ($remainingTypes as $type) {
            $tempResourceEvents[$type['name']] = [];
        }

        foreach (array_keys($tempResourceEvents) as $resourceType) {
            if ($resourceType === 'resource_shortcut') {
                continue;
            }

            foreach ($genericResourceEvents as $genericEventKey => $genericEventName) {
                $eventPrefix = '';
                if ($allOption !== $resourceType) {
                    $eventPrefix = "${resourceOption}::${resourceType}::";
                }
                if ($allOption === $resourceType && $genericEventName === $allOption) {
                    $eventPrefix = "${resourceOption}::";
                }
                $sortedEvents[$resourceOption][$resourceType][$genericEventKey] = $eventPrefix.$genericEventName;
            }

            if ($allOption !== $resourceType) {
                foreach ($tempResourceEvents[$resourceType] as $resourceEventKey => $resourceEventName) {
                    $sortedEvents[$resourceOption][$resourceType][$resourceEventKey] = $resourceEventName;
                }
            }
        }

        return $this->formatEventsTableForApi($sortedEvents);
    }
1234283
public function findEventTypes()
    {
        $xmlQuery = $this->metaApiService->getEventTypes();

        $types = new Types();

        $mapper = new \RGU\Dvoconnector\Mapper\EventTypes($xmlQuery);
        $mapper->mapToAbstractEntity($types);

        return $types;
    }
164488
protected function getEventLogObject($eventInfo)
    {
        if (empty($eventInfo)) {
            return null;
        }

        if ($eventInfo instanceof BaseAuditLog) {
            return $eventInfo;
        }

        return $this->createEventObjectFromArray($eventInfo);
    }
1292943
protected function get_legacy_eventdata() {
        $legacyeventdata = $this->get_record_snapshot('user_enrolments', $this->objectid);
        $legacyeventdata->enrol = $this->other['enrol'];
        $legacyeventdata->courseid = $this->courseid;
        return $legacyeventdata;
    }
1239722
protected function get_legacy_eventdata() {
        $attempt = $this->get_record_snapshot('quiz_attempts', $this->objectid);

        $legacyeventdata = new \stdClass();
        $legacyeventdata->component = 'mod_quiz';
        $legacyeventdata->attemptid = $this->objectid;
        $legacyeventdata->timestamp = $attempt->timemodified;
        $legacyeventdata->userid = $this->relateduserid;
        $legacyeventdata->quizid = $attempt->quiz;
        $legacyeventdata->cmid = $this->contextinstanceid;
        $legacyeventdata->courseid = $this->courseid;
        $legacyeventdata->submitterid = $this->other['submitterid'];

        return $legacyeventdata;
    }
329019
function getEvents (date) {
  date = this.toDate(date);
  if (!date) {
    return null;
  }
  var info = getDayInfo(this.dayInfo, date);
  return info ? info.events : [];
}
141996
public function getLoggableEvents() {
		$list = [
			EVENT_CORE_USER_REGISTER,
			EVENT_CORE_BO_LOGIN_OK,
			EVENT_CORE_BO_LOGIN_FAIL,
			EVENT_CORE_LOG_CLEAR,
			//EVENT_CORE_DIR_CREATE,
			//EVENT_CORE_DIR_EDIT,
			//EVENT_CORE_DIR_DELETE,
			//EVENT_CORE_MATH_CREATE,
			//EVENT_CORE_MATH_EDIT,
			//EVENT_CORE_MATH_DELETE,
			//EVENT_CORE_MATH_PUB,
			//EVENT_CORE_MATH_UNPUB,
			//EVENT_CORE_USER_PROP,
		];
		
		return  array_diff(
			array_merge ( $list, (array)$this->configGet('events_log_enabled') ),
			(array)$this->configGet('events_log_disabled')
		);
	}
997909
public function getSortedEventsForConfigForm($restriction = null)
    {
        $events = array();

        foreach ($this->getEvents($restriction) as $event) {
            $events[$event] = 'log_' . $event . '_title';
        }

        return $events;
    }
40612
protected function getListEvent()
    {
        $options = array(
            'order' => 'desc',
            'sort' => 'created',
            'limit' => $this->getLimit(),
            'severity' => $this->getParam('severity')
        );

        return (array) $this->report->getList($options);
    }
252512
public function info()
    {
        $data = [
            'id' => $this->id,
            'type' => $this->type
        ];

        if ($this->uncompressedSizeBytes) {
            $data['uncompressedSizeBytes'] = $this->uncompressedSizeBytes;
        }
        if ($this->compressedSizeBytes) {
            $data['compressedSizeBytes'] = $this->compressedSizeBytes;
        }

        return [
            'time' => $this->time,
            'messageEvent' => $data
        ];
    }
875067
public function listEventsAction()
    {
        $this->checkStaticTemplateIsIncluded();
        $this->checkSettings();

        $this->slotExtendedAssignMultiple([
            self::VIEW_VARIABLE_ASSOCIATION_ID => $this->settings[self::SETTINGS_ASSOCIATION_ID],
            self::VIEW_VARIABLE_FILTER => $this->getEventsFilter()
        ], __CLASS__, __FUNCTION__);

        return $this->view->render();
    }
353739
protected function get_legacy_eventdata() {
        $eventdata = new \stdClass();
        $eventdata->groupid = $this->objectid;
        $eventdata->userid  = $this->relateduserid;
        $eventdata->component = $this->other['component'];
        $eventdata->itemid = $this->other['itemid'];
        return $eventdata;
    }