Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2726

Let module site plugins hide default context menu options

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.6.0
    • Component/s: Site add-ons
    • Labels:
    • Testing Instructions:
      Hide
      1. Install the group choice plugin.
      2. Create a group choice activity in a course.
      3. In the app, login as a student and open the group choice. Click the top right icon (menu) and check that you can see several options: Open in browser, Refresh, Download and Description (only if the activity has description).
      4. Edit the file mod/choicegroup/db/mobile.php. Inside the coursechoicegroup array, add the following properties:

                        'displayopeninbrowser' => false,
                        'displaydescription' => false,
                        'displayrefresh' => false,
                        'displayprefetch' => false,
                        'displaysize' => false
        

      5. Clear the Moodle cache.
      6. Back in the app, restart the app and open the group choice again. Check that now you don't see the top right menu.
      7. Edit the file again and remove some of the lines you put before, but leave some of the others. 
      8. Clear the Moodle cache, restart the app and open the group choice again. Check that now you only see the options that aren't set to false.
      9. Leave the db/mobile.php file as it was and now open the file mod/choicegroup/classes/output/mobile.php.
      10. Inside the function mobile_course_view, put this code in the returned 'javascript' field:

        var that = this; setTimeout(function() { that.displayRefresh = false; }, 0);
        

         

      1. Clear the Moodle cache, restart the app and open the group choice again.
      2. Perform a Pull To Refresh to make sure you receive the latest Javascript.
      3. Open the menu in the top right and check that you cannot see the Refresh option.
      Show
      Install the group choice plugin . Create a group choice activity in a course. In the app, login as a student and open the group choice. Click the top right icon (menu) and check that you can see several options: Open in browser, Refresh, Download and Description (only if the activity has description). Edit the file mod/choicegroup/db/mobile.php . Inside the  coursechoicegroup array, add the following properties: 'displayopeninbrowser' => false, 'displaydescription' => false, 'displayrefresh' => false, 'displayprefetch' => false, 'displaysize' => false Clear the Moodle cache. Back in the app, restart the app and open the group choice again. Check that now you don't see the top right menu. Edit the file again and remove some of the lines you put before, but leave some of the others.  Clear the Moodle cache, restart the app and open the group choice again. Check that now you only see the options that aren't set to false. Leave the db/mobile.php file as it was and now open the file mod/choicegroup/classes/output/mobile.php . Inside the function  mobile_course_view , put this code in the returned 'javascript' field: var that = this; setTimeout(function() { that.displayRefresh = false; }, 0);   Clear the Moodle cache, restart the app and open the group choice again. Perform a Pull To Refresh to make sure you receive the latest Javascript. Open the menu in the top right and check that you cannot see the Refresh option.
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Sprint:
      Moodle Mobile 3.6.0

      Description

      Right now, site plugins implementing a resource or activity cannot hide the default context menu options. We should allow them to do so.

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Pau Ferrer
            Integrator:
            Juan Leyva
            Tester:
            Albert Gasset
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Jan/19