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
d2edab77
Commit
d2edab77
authored
Feb 19, 2007
by
Martyn Smith
Committed by
Martyn Smith
Feb 19, 2007
Browse files
Move search plugin selection into the application
parent
5c9f5afb
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/site/options.php
View file @
d2edab77
...
...
@@ -31,6 +31,7 @@ define('SUBMENUITEM', 'siteoptions');
require
(
dirname
(
dirname
(
dirname
(
__FILE__
)))
.
'/init.php'
);
require_once
(
'pieforms/pieform.php'
);
require_once
(
'searchlib.php'
);
define
(
'TITLE'
,
get_string
(
'siteoptions'
,
'admin'
));
$langoptions
=
get_languages
();
...
...
@@ -38,6 +39,8 @@ $themeoptions = get_themes();
$yesno
=
array
(
true
=>
get_string
(
'yes'
),
false
=>
get_string
(
'no'
));
$searchpluginoptions
=
get_search_plugins
();
$siteoptionform
=
pieform
(
array
(
'name'
=>
'siteoptions'
,
'jsform'
=>
true
,
...
...
@@ -65,6 +68,14 @@ $siteoptionform = pieform(array(
'collapseifoneoption'
=>
true
,
'options'
=>
$themeoptions
,
),
'searchplugin'
=>
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'searchplugin'
,
'admin'
),
'description'
=>
get_string
(
'searchplugindescription'
,
'admin'
),
'defaultvalue'
=>
get_config
(
'searchplugin'
),
'collapseifoneoption'
=>
true
,
'options'
=>
$searchpluginoptions
,
),
'pathtofile'
=>
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'pathtofile'
,
'admin'
),
...
...
@@ -116,7 +127,7 @@ function siteoptions_fail(Pieform $form, $field) {
function
siteoptions_submit
(
Pieform
$form
,
$values
)
{
$fields
=
array
(
'sitename'
,
'language'
,
'theme'
,
'pathtofile'
,
'pathtoclam'
,
'allowpublicviews'
,
'artefactviewinactivitytime'
);
'allowpublicviews'
,
'artefactviewinactivitytime'
,
'searchplugin'
);
foreach
(
$fields
as
$field
)
{
if
(
!
set_config
(
$field
,
$values
[
$field
]))
{
siteoptions_fail
(
$form
,
$field
);
...
...
htdocs/config-dist.php
View file @
d2edab77
...
...
@@ -36,9 +36,6 @@ $cfg->dbuser = 'mahara';
$cfg
->
dbpass
=
'mahara'
;
$cfg
->
dbprefix
=
''
;
// search plugin to use (currently only 'internal' exists)
$cfg
->
searchplugin
=
'internal'
;
// wwwroot - the web-visible path to your Mahara installation
// Normally, this is automatically detected - if it doesn't work for you
// then try specifying it here
...
...
htdocs/lib/searchlib.php
View file @
d2edab77
...
...
@@ -197,4 +197,25 @@ function search_selfsearch($query_string, $limit, $offset, $type = 'all') {
return
call_static_method
(
generate_class_name
(
'search'
,
$plugin
),
'self_search'
,
$query_string
,
$limit
,
$offset
,
$type
);
}
function
get_search_plugins
()
{
$searchpluginoptions
=
array
();
if
(
$searchplugins
=
get_records_array
(
'search_installed'
))
{
foreach
(
$searchplugins
as
$plugin
)
{
$searchpluginoptions
[
$plugin
->
name
]
=
$plugin
->
name
;
$config_path
=
get_config
(
'docroot'
)
.
'search/'
.
$plugin
->
name
.
'/version.php'
;
if
(
is_readable
(
$config_path
))
{
$config
=
new
StdClass
;
require_once
(
$config_path
);
if
(
isset
(
$config
->
name
))
{
$searchpluginoptions
[
$plugin
->
name
]
=
$config
->
name
;
}
}
}
}
return
$searchpluginoptions
;
}
?>
htdocs/lib/upgrade.php
View file @
d2edab77
...
...
@@ -421,6 +421,10 @@ function core_postinst() {
else
{
$status
=
false
;
}
// Set default search plugin
set_config
(
'searchplugin'
,
'internal'
);
return
$status
;
}
...
...
htdocs/search/internal/version.php
View file @
d2edab77
...
...
@@ -26,6 +26,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
->
name
=
'Internal'
;
$config
->
version
=
2006111600
;
$config
->
release
=
'0.1'
;
...
...
htdocs/search/solr/version.php
View file @
d2edab77
...
...
@@ -26,6 +26,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
->
name
=
'Solr'
;
$config
->
version
=
2007021900
;
$config
->
release
=
'0.2'
;
...
...
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