43 parent::__construct(
$config, $reserved);
48 if (array_key_exists(
'singleValued',
$config)) {
49 $this->singleValued =
$config[
'singleValued'];
51 if (array_key_exists(
'firstValue',
$config)) {
52 $this->firstValue =
$config[
'firstValue'];
54 if (array_key_exists(
'flattenWith',
$config)) {
55 $this->flattenWith = is_array(
$config[
'flattenWith']) ? array_shift(
$config[
'flattenWith']) :
$config[
'flattenWith'];
57 if (array_key_exists(
'flatten',
$config)) {
58 $this->flatten =
$config[
'flatten'];
60 if (array_key_exists(
'ignoreEntities',
$config)) {
61 $this->ignoreEntities =
$config[
'ignoreEntities'];
64 if (array_key_exists(
'%ignoreEntities',
$config)) {
65 $this->ignoreEntities =
$config[
'%ignoreEntities'];
77 assert(array_key_exists(
"Attributes",
$request));
79 if (array_key_exists(
'Source',
$request) &&
80 array_key_exists(
'entityid',
$request[
'Source']) &&
81 in_array(
$request[
'Source'][
'entityid'], $this->ignoreEntities,
true)
87 foreach (
$request[
'Attributes'] as $k => $v) {
95 if (in_array($k, $this->singleValued)) {
96 $request[
'core:cardinality:errorAttributes'][$k] = array(count($v),
'0 ≤ n ≤ 1');
99 if (in_array($k, $this->firstValue)) {
100 $request[
'Attributes'][$k] = array(array_shift($v));
103 if (in_array($k, $this->flatten)) {
104 $request[
'Attributes'][$k] = array(implode($this->flattenWith, $v));
110 if (array_key_exists(
'core:cardinality:errorAttributes',
$request)) {
113 $this->
http->redirectTrustedURL(
$url, array(
'StateId' =>
$id));
foreach($paths as $path) $request
__construct($config, $reserved, HTTPAdapter $http=null)
Initialize this filter, parse configuration.
if(!array_key_exists('StateId', $_REQUEST)) $id
process(&$request)
Process this filter.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
static http()
Fetches the global http state from ILIAS.
static saveState(&$state, $stage, $rawId=false)
Save the state.