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
integration
prechecker
Commits
eef76074
Commit
eef76074
authored
May 01, 2009
by
jerome
Browse files
repository MDL-15404 display instance number into the administration
parent
b8aa76c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
lang/en_utf8/repository.php
View file @
eef76074
...
...
@@ -51,6 +51,8 @@ $string['keyword'] = 'Keyword';
$string
[
'instance'
]
=
'instance'
;
$string
[
'instancedeleted'
]
=
'Instance deleted'
;
$string
[
'instances'
]
=
'Repository instances'
;
$string
[
'instancesforadmin'
]
=
'common instance(s)'
;
$string
[
'instancesforothers'
]
=
'private instance(s)'
;
$string
[
'invalidrepositoryid'
]
=
'Invalid repository ID'
;
$string
[
'invalidplugin'
]
=
'Invalid repository $a plug-in'
;
$string
[
'invalidjson'
]
=
'Invalid JSON string'
;
...
...
lib/adminlib.php
View file @
eef76074
...
...
@@ -4698,9 +4698,24 @@ class admin_setting_managerepository extends admin_setting {
//display edit link only if you can config the type or if it has multiple instances (e.g. has instance config)
$typeoptionnames
=
repository
::
static_function
(
$i
->
get_typename
(),
'get_type_option_names'
);
$instanceoptionnames
=
repository
::
static_function
(
$i
->
get_typename
(),
'get_instance_option_names'
);
if
(
!
empty
(
$typeoptionnames
)
||
!
empty
(
$instanceoptionnames
))
{
//calculate number of instances in order to display them for the Moodle administrator
if
(
!
empty
(
$instanceoptionnames
))
{
$admininstancenumber
=
count
(
repository
::
static_function
(
$i
->
get_typename
(),
'get_instances'
,
array
(
get_context_instance
(
CONTEXT_SYSTEM
)),
null
,
false
,
$i
->
get_typename
()));
$admininstancenumbertext
=
" <br/> "
.
$admininstancenumber
.
" "
.
get_string
(
'instancesforadmin'
,
'repository'
);
$instancenumber
=
count
(
repository
::
static_function
(
$i
->
get_typename
(),
'get_instances'
,
array
(),
null
,
false
,
$i
->
get_typename
()))
-
$admininstancenumber
;
$instancenumbertext
=
"<br/>"
.
$instancenumber
.
" "
.
get_string
(
'instancesforothers'
,
'repository'
);
}
else
{
$admininstancenumbertext
=
""
;
$instancenumbertext
=
""
;
}
$settings
.
=
'<a href="'
.
$this
->
baseurl
.
'&edit='
.
$i
->
get_typename
()
.
'">'
.
$settingsstr
.
'</a>'
.
"
\n
"
;
.
$settingsstr
.
'</a>'
.
$admininstancenumbertext
.
$instancenumbertext
.
"
\n
"
;
}
$delete
=
'<a href="'
.
$this
->
baseurl
.
'&delete='
.
$i
->
get_typename
()
.
'">'
.
$deletestr
.
'</a>'
.
"
\n
"
;
...
...
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