Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Http
Input.php
Go to the documentation of this file.
1
<?php
2
namespace
Elgg\Http
;
3
14
class
Input
{
20
private
$CONFIG;
21
25
public
function
__construct
() {
26
global
$CONFIG;
27
$this->CONFIG = $CONFIG;
28
}
29
40
public
function
set
($variable,
$value
) {
41
42
if
(!isset($this->CONFIG->input)) {
43
$this->CONFIG->input = array();
44
}
45
46
if
(is_array(
$value
)) {
47
array_walk_recursive(
$value
,
function
(&$v, $k) { $v = trim($v);});
48
$this->CONFIG->input[trim($variable)] =
$value
;
49
}
else
{
50
$this->CONFIG->input[trim($variable)] = trim(
$value
);
51
}
52
}
53
54
72
function
get
($variable,
$default
= null, $filter_result =
true
) {
73
74
75
76
$result
=
$default
;
77
78
elgg_push_context
(
'input'
);
79
80
if
(isset($this->CONFIG->input[$variable])) {
81
// a plugin has already set this variable
82
$result
= $this->CONFIG->input[$variable];
83
if
($filter_result) {
84
$result
=
filter_tags
(
$result
);
85
}
86
}
else
{
87
$request =
_elgg_services
()->request;
88
$value
= $request->get($variable);
89
if
(
$value
!== null) {
90
$result
=
$value
;
91
if
(is_string(
$result
)) {
92
// @todo why trim
93
$result
= trim(
$result
);
94
}
95
96
if
($filter_result) {
97
$result
=
filter_tags
(
$result
);
98
}
99
}
100
}
101
102
elgg_pop_context
();
103
104
return
$result
;
105
106
}
107
}
Elgg\Http\Input\__construct
__construct()
Constructor.
Definition:
Input.php:25
$result
$result
Definition:
set_maintenance_mode.php:11
Elgg\Http\Input
Definition:
Input.php:14
$value
$value
Definition:
longtext.php:42
$default
$default
Definition:
checkbox.php:34
filter_tags
filter_tags($var)
Filter tags from a given string based on registered hooks.
Definition:
input.php:53
elgg_pop_context
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition:
pageowner.php:225
global
elgg global
Pointer to the global context.
Definition:
elgglib.js:12
_elgg_services
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition:
autoloader.php:17
Elgg\Http
Definition:
DatabaseSessionHandler.php:2
elgg_push_context
elgg_push_context($context)
Push a context onto the top of the stack.
Definition:
pageowner.php:215
Generated on Thu Nov 14 2024 00:01:01 for Elgg by
1.8.11