Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
f50d4fa4
Commit
f50d4fa4
authored
Nov 13, 2007
by
Nigel McNie
Browse files
Changes to make searching work.
parent
289c1f57
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/view.php
View file @
f50d4fa4
...
...
@@ -1142,8 +1142,8 @@ class View {
public
static
function
make_base_url
()
{
static
$allowed_keys
=
array
(
'id'
,
'change'
,
'c'
,
'new'
,
'search'
);
$baseurl
=
'?'
;
foreach
(
array_merge
(
$_POST
,
$_GET
)
as
$key
=>
$value
)
{
if
(
in_array
(
$key
,
$allowed_keys
)
||
preg_match
(
'/^action_.*_x
$/'
,
$key
)
/* || preg_match('/^cb_\d+_[a-z_]+_o
$/', $key)
*/
)
{
foreach
(
$_POST
+
$_GET
as
$key
=>
$value
)
{
if
(
in_array
(
$key
,
$allowed_keys
)
||
preg_match
(
'/^action_.*
(
_x
)?
$/'
,
$key
))
{
$baseurl
.
=
hsc
(
$key
)
.
'='
.
hsc
(
$value
)
.
'&'
;
}
}
...
...
@@ -1163,10 +1163,15 @@ class View {
public
static
function
build_artefactchooser_data
(
$data
)
{
global
$USER
;
$search
=
param_variable
(
'search'
,
''
);
//if (strlen($search) < 3) {
// $search = '';
//}
$search
=
''
;
if
(
!
empty
(
$data
[
'search'
])
&&
param_boolean
(
's'
))
{
$search
=
param_variable
(
'search'
,
''
);
// Maybe later, depending on performance - don't search if there's
// not enough characters. Prompts should be added to the UI too.
//if (strlen($search) < 3) {
// $search = '';
//}
}
$artefacttypes
=
$data
[
'artefacttypes'
];
$offset
=
$data
[
'offset'
];
...
...
@@ -1245,7 +1250,7 @@ class View {
$pagination
=
build_pagination
(
array
(
'id'
=>
$elementname
.
'_pagination'
,
'class'
=>
'ac-pagination'
,
'url'
=>
View
::
make_base_url
(),
'url'
=>
View
::
make_base_url
()
.
(
param_boolean
(
's'
)
?
'&s=1'
:
''
)
,
'count'
=>
$totalartefacts
,
'limit'
=>
$limit
,
'offset'
=>
$offset
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment