Make it possible for PlugIns defining a grouptab

Bug #1749408 reported by Alexander Del Ponte
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Unassigned

Bug Description

Currently we are developing an artefact plugin and a module plugin and therefore we need to have related grouptabs for users to use the new functionalities of these plugins.

Unfortunately such additional tabs are only considered for interaction plugins.

For our purposes we use a workaround by adding some code to the lib/group.php file at line 2046 to get this handled for our plugins like it is implemented as core code at line 2022 and following.

It would be nice if group menu items of other plugin types than interaction could be defined if necessary by default without modifying the mahara core.

Thank you
Alex

Revision history for this message
Alexander Del Ponte (delponte) wrote :

For this perhaps following idea could be a kind of code basis:

    // ToDo: Make it possible to insert group_tabs by PlugIn conventions based on following code
    foreach (plugin_types_installed() as $plugin_type_installed) {
        foreach (plugins_installed($plugin_type_installed) as $plugin) {
            // ToDo: Call PlugIn Method display_group_tab_allowed which provides the code which does all the checks here
            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);
                $menu = array_merge($menu, $plugin_menu);
            }
        }
    }

Changed in mahara:
importance: Undecided → Wishlist
status: New → In Progress
milestone: none → 18.10.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/8661

Revision history for this message
Alexander Del Ponte (delponte) wrote :

The code I posted was only though as a basis for a developer for implementation. It is not really functional. :-)

Revision history for this message
Robert Lyon (robertl-9) wrote :

This bug looks to be similar to https://bugs.launchpad.net/mahara/+bug/1718480

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Alex, can you please take a look at https://bugs.launchpad.net/mahara/+bug/1718480 and see if that would be what you are looking for?

Changed in mahara:
status: In Progress → Incomplete
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :

the issue described in bug#1718480 is a particular case of this one. I marked the other bug as duplicated of this one since the patch for this one also resolves both issues.

Changed in mahara:
status: Incomplete → In Progress
Revision history for this message
Steven (stevens-q) wrote :

Environment tested: Master
Browser tested: Chrome

===================
Manual Test Script
===================

Preconditions:
1. Tester must have access to the code
2. Group must exist

Test Steps:
1. Browse to a a group
2. Confirm Group tabs are displayed (ie. About | Members | Forums etc...)
3. edit code file
/module/framework/lib.php
4. Add the following code to the end of the class
   public static function group_tabs($groupid, $role) {
         return array(
                'test' => array(
                    'path' => 'groups/files',
                    'url' => 'artefact/file/groupfiles.php?group='.$groupid,
                    'title' => Test,
                    'weight' => 80,
                ),
            );
        }
5. Refresh the Group page
6. confirm that the title "Test" is now displayed in the group tabs
7. edit code file /artefact/annotation/lib.php
8. Add the following code to the end of the class
   public static function group_tabs($groupid, $role) {
        return array(
                'test11111' => array(
                    'path' => 'groups/files',
                    'url' => 'artefact/file/groupfiles.php?group='.$groupid,
                    'title' => Test11111,
                    'weight' => 80,
                ),
            );
        }
9. confirm that the title "Test11111" is now displayed in the group tabs

Catalyst QA Approved ✔

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8661
Committed: https://git.mahara.org/mahara/mahara/commit/c39834fdade561a4925f351886e9be368cb0465d
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit c39834fdade561a4925f351886e9be368cb0465d
Author: Alexander Del Ponte <email address hidden>
Date: Mon Mar 19 17:19:52 2018 +1300

Bug 1749408: Make it possible for PlugIns defining a grouptab

behatnotneeded

Change-Id: If9c4bfbc7e1113cd4de131712db821a048ba2136

Changed in mahara:
status: In Progress → Fix Committed
tags: added: nominatedfeature
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.