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
Plugins bot
moodle-plugins-snapshots
Commits
3dc33059
Commit
3dc33059
authored
Jan 18, 2017
by
Andrew Nicols
Browse files
Merge branch 'wip_MDL-57590_master_forum_search' of
https://github.com/mchurchward/moodle
parents
c5bd22b1
d679a45f
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/forum/classes/output/big_search_form.php
View file @
3dc33059
...
...
@@ -53,6 +53,8 @@ class big_search_form implements renderable, templatable {
public
$subject
;
public
$user
;
public
$words
;
/** @var string The URL of the search form. */
public
$actionurl
;
/**
* Constructor.
...
...
@@ -65,6 +67,7 @@ class big_search_form implements renderable, templatable {
$this
->
course
=
$course
;
$this
->
scripturl
=
new
moodle_url
(
'/mod/forum/forum.js'
);
$this
->
showfullwords
=
$DB
->
get_dbfamily
()
==
'mysql'
||
$DB
->
get_dbfamily
()
==
'postgres'
;
$this
->
actionurl
=
new
moodle_url
(
'/mod/forum/search.php'
);
$forumoptions
=
[
''
=>
get_string
(
'allforums'
,
'forum'
)]
+
forum_menu_list
(
$course
);
$this
->
forumoptions
=
array_map
(
function
(
$option
)
use
(
$forumoptions
)
{
...
...
@@ -161,6 +164,7 @@ class big_search_form implements renderable, templatable {
$data
->
subject
=
$this
->
subject
;
$data
->
user
=
$this
->
user
;
$data
->
showfullwords
=
$this
->
showfullwords
;
$data
->
actionurl
=
$this
->
actionurl
->
out
(
false
);
$datefrom
=
$this
->
datefrom
;
if
(
empty
(
$datefrom
))
{
...
...
mod/forum/templates/big_search_form.mustache
View file @
3dc33059
...
...
@@ -15,7 +15,38 @@
along
with
Moodle.
If
not
,
see
<
http
:
//
www
.
gnu
.
org
/
licenses
/
>
.
}}
{{
!
@template
mod_forum
/
big_search_form
Big
search
form.
Example
context
(
json
)
:
{
"scripturl"
:
"https://example.com/mod/forum/forum.js"
,
"actionurl"
:
"https://example.com/mod/forum/search.php"
,
"courseid"
:
"2"
,
"words"
:
"apples"
,
"phrase"
:
"Lorem ipsum dolor"
,
"notwords"
:
"Not these words"
,
"showfullwords"
:
[
{
"fullwords"
:
"Exactly"
}
]
,
"datefromchecked"
:
1
,
"datetochecked"
:
""
,
"forumoptions"
:
[
{
"name"
:
"Forum One"
,
"value"
:
"23"
},
{
"name"
:
"Forum Two"
,
"value"
:
"34"
}
]
,
"subject"
:
"Help me please"
,
"user"
:
"Helpy McUser"
}
}}
<div
id=
"intro"
class=
"box searchbox boxaligncenter"
>
{{#
str
}}
searchforumintro, forum
{{/
str
}}
...
...
@@ -92,7 +123,7 @@
<label
for=
"menuforumid"
>
{{#
str
}}
searchwhichforums, forum
{{/
str
}}
</label>
</td>
<td
class=
"c1"
>
<select
name=
"
menu
forumid"
id=
"menuforumid"
>
<select
name=
"forumid"
id=
"menuforumid"
>
{{#
forumoptions
}}
<option
value=
"
{{
value
}}
"
>
{{
name
}}
</option>
{{/
forumoptions
}}
...
...
theme/boost/templates/mod_forum/big_search_form.mustache
View file @
3dc33059
...
...
@@ -15,7 +15,38 @@
along
with
Moodle.
If
not
,
see
<
http
:
//
www
.
gnu
.
org
/
licenses
/
>
.
}}
{{
!
@template
mod_forum
/
big_search_form
Big
search
form.
Example
context
(
json
)
:
{
"scripturl"
:
"https://example.com/mod/forum/forum.js"
,
"actionurl"
:
"https://example.com/mod/forum/search.php"
,
"courseid"
:
"2"
,
"words"
:
"apples"
,
"phrase"
:
"Lorem ipsum dolor"
,
"notwords"
:
"Not these words"
,
"showfullwords"
:
[
{
"fullwords"
:
"Exactly"
}
]
,
"datefromchecked"
:
1
,
"datetochecked"
:
""
,
"forumoptions"
:
[
{
"name"
:
"Forum One"
,
"value"
:
"23"
},
{
"name"
:
"Forum Two"
,
"value"
:
"34"
}
]
,
"subject"
:
"Help me please"
,
"user"
:
"Helpy McUser"
}
}}
<div
id=
"intro"
class=
"box searchbox boxaligncenter"
>
{{#
str
}}
searchforumintro, forum
{{/
str
}}
...
...
@@ -92,7 +123,7 @@
<label
for=
"menuforumid"
>
{{#
str
}}
searchwhichforums, forum
{{/
str
}}
</label>
</td>
<td
class=
"c1"
>
<select
name=
"
menu
forumid"
id=
"menuforumid"
class=
"form-control"
>
<select
name=
"forumid"
id=
"menuforumid"
class=
"form-control"
>
{{#
forumoptions
}}
<option
value=
"
{{
value
}}
"
>
{{
name
}}
</option>
{{/
forumoptions
}}
...
...
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