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
c39834fd
Commit
c39834fd
authored
Mar 19, 2018
by
Alexander Del Ponte
Committed by
Cecilia Vela Gurovic
May 08, 2018
Browse files
Bug 1749408: Make it possible for PlugIns defining a grouptab
behatnotneeded Change-Id: If9c4bfbc7e1113cd4de131712db821a048ba2136
parent
a51cddc7
Changes
7
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lib.php
View file @
c39834fd
...
...
@@ -154,15 +154,20 @@ class PluginArtefactBlog extends PluginArtefact {
return
'artefact/blog/view/index.php'
;
}
public
static
function
group_tabs
(
$groupid
)
{
return
array
(
'blogs'
=>
array
(
'path'
=>
'groups/blogs'
,
'url'
=>
'artefact/blog/index.php?group='
.
$groupid
,
'title'
=>
get_string
(
'Blogs'
,
'artefact.blog'
),
'weight'
=>
65
,
),
);
public
static
function
group_tabs
(
$groupid
,
$role
)
{
if
(
$role
)
{
return
array
(
'blogs'
=>
array
(
'path'
=>
'groups/blogs'
,
'url'
=>
'artefact/blog/index.php?group='
.
$groupid
,
'title'
=>
get_string
(
'Blogs'
,
'artefact.blog'
),
'weight'
=>
65
,
),
);
}
else
{
return
array
();
}
}
}
...
...
htdocs/artefact/file/lib.php
View file @
c39834fd
...
...
@@ -52,15 +52,20 @@ class PluginArtefactFile extends PluginArtefact {
);
}
public
static
function
group_tabs
(
$groupid
)
{
return
array
(
'files'
=>
array
(
'path'
=>
'groups/files'
,
'url'
=>
'artefact/file/groupfiles.php?group='
.
$groupid
,
'title'
=>
get_string
(
'Files'
,
'artefact.file'
),
'weight'
=>
80
,
),
);
public
static
function
group_tabs
(
$groupid
,
$role
)
{
if
(
$role
)
{
return
array
(
'files'
=>
array
(
'path'
=>
'groups/files'
,
'url'
=>
'artefact/file/groupfiles.php?group='
.
$groupid
,
'title'
=>
get_string
(
'Files'
,
'artefact.file'
),
'weight'
=>
80
,
),
);
}
else
{
return
array
();
}
}
public
static
function
get_event_subscriptions
()
{
...
...
htdocs/artefact/lib.php
View file @
c39834fd
...
...
@@ -73,7 +73,7 @@ abstract class PluginArtefact extends Plugin implements IPluginArtefact {
* - url relative to wwwroot
* @return array
*/
public
static
function
group_tabs
(
$groupid
)
{
public
static
function
group_tabs
(
$groupid
,
$role
)
{
return
array
();
}
...
...
htdocs/blocktype/lib.php
View file @
c39834fd
...
...
@@ -1753,4 +1753,16 @@ class BlockInstance {
}
return
$js
;
}
/**
* This function returns an array of menu items to be displayed
* on a group page when viewed by group members.
* Each item should be a StdClass object containing -
* - title language pack key
* - url relative to wwwroot
* @return array
*/
public
static
function
group_tabs
(
$groupid
,
$role
)
{
return
array
();
}
}
htdocs/grouptype/lib.php
View file @
c39834fd
...
...
@@ -91,8 +91,4 @@ abstract class GroupType implements IGroupType {
public
static
function
can_become_admin
(
$userid
)
{
return
true
;
}
public
static
function
get_group_artefact_plugins
()
{
return
array
(
'file'
,
'blog'
);
}
}
htdocs/lib/group.php
View file @
c39834fd
...
...
@@ -2062,16 +2062,16 @@ function group_get_menu_tabs() {
);
}
if
(
$role
)
{
safe_require
(
'grouptype'
,
$group
->
grouptype
);
$artefactplugins
=
call_static_method
(
'GroupType'
.
$group
->
grouptype
,
'get_group_artefact_plugins'
);
if
(
$plugins
=
plugin
s
_installed
(
'artefact
'
))
{
foreach
(
$plugins
as
&
$plugin
)
{
if
(
!
in_array
(
$plugin
->
name
,
$artefactplugins
))
{
continue
;
}
safe_require
(
'artefact'
,
$plugin
->
name
);
$plugin_menu
=
call_static_method
(
generate_class_name
(
'artefact'
,
$plugin
->
name
),
'group_tabs'
,
$group
->
id
);
foreach
(
plugin_types_installed
()
as
$plugin_type_installed
)
{
foreach
(
plugins_installed
(
$plugin_type_installed
)
as
$plugin
)
{
safe_require
(
$plugin_type_installed
,
$plugin
->
name
);
if
(
method_exists
(
generate_class_name
(
$
plugin
_type
_installed
,
$plugin
->
name
),
'group_tabs
'
))
{
$plugin_menu
=
call_static_method
(
generate_class_name
(
$plugin_type_installed
,
$plugin
->
name
),
'group_tabs'
,
$group
->
id
,
$role
);
$menu
=
array_merge
(
$menu
,
$plugin_menu
);
}
}
...
...
htdocs/module/lib.php
View file @
c39834fd
...
...
@@ -89,4 +89,16 @@ abstract class PluginModule extends Plugin {
public
static
function
institution_staff_menu_items
()
{
return
array
();
}
/**
* This function returns an array of menu items to be displayed
* on a group page when viewed by group members.
* Each item should be a StdClass object containing -
* - title language pack key
* - url relative to wwwroot
* @return array
*/
public
static
function
group_tabs
(
$groupid
,
$role
)
{
return
array
();
}
}
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