Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26696

Add COURSE->id in tinymce parameters

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.0
    • Text editor TinyMCE
    • MOODLE_20_STABLE
    • Easy

      It would be nice to add the course id as a parameter inside tinymce lib.php. The reason is that I have developed various tinymce plugins and each time I tried global $COURSE, it would return $COURSE->id = 1 $context->id would then be 2. I need the actual course I am in for these functions to work. So I added in libdir->editor->tinymce->lib.php the following code: (inside protected function get_init_params)

      line 78: global $CFG, $PAGE, $OUTPUT, $COURSE;
      line 113 : 'courseid' => $COURSE->id,

      Then for my module in tiny_mce init I use:

      courseid = ed.getParam('courseid');
      ....
      file : url + '/module.php?id=' + courseid,

      With this, my problem is resolved.

      Thank you for considering.

      This could help other tinymce developers.

            skodak Petr Skoda
            patrickthibaudeau Patrick Thibaudeau (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.